[Mono-devel-list] CFG of PInvoke wrappers

Willibald Krenn Willibald.Krenn at gmx.at
Mon Oct 25 21:41:37 EDT 2004


Hi!

In order to get a CFG of a PInvoke wrapper, I had to change driver.c a
little bit. Just in case anyone is interested in the few lines that did the
trick, I send them to this list... (Note that I did not check how nm has to
be freed, so this will probably give a leak..)

add in driver.c: (around line number 870)

+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
+ 	MonoMethod *nm;
+	nm = mono_marshal_get_native_wrapper (method);
+	cfg = mini_method_compile (nm, opt, mono_get_root_domain (), FALSE, part);
+}
+else
	cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE,
part);

if ((mono_graph_options & MONO_GRAPH_CFG_SSA) && !(cfg->comp_done &
MONO_COMP_SSA)) {
	g_warning ("no SSA info available (use -O=deadce)");

Without a patch mono will sigsev when trying to create a CFG of a PInvoke
wrapper.

Thanks, 
 Willi

-- 
+++ GMX DSL Premiumtarife 3 Monate gratis* + WLAN-Router 0,- EUR* +++
Clevere DSL-Nutzer wechseln jetzt zu GMX: http://www.gmx.net/de/go/dsl




More information about the Mono-devel-list mailing list