[Mono-list] soft debugger and embedded API (SOLVED)

Jonathan Mitchell jonathan at mugginsoft.com
Wed Mar 18 21:20:48 UTC 2015


After some more experimentation I seem to have this sorted:
Resequencing the setup code was key to getting the debuggee up and talking:

    mono_jit_parse_options(2, (char**)jit_options);
    mono_debug_init(MONO_DEBUG_FORMAT_MONO);
   _monoDomain = mono_jit_init_version(domainName, version);

To successful set breakpoints I also had to:

1. Run the app outside of Xcode so that its debugger signal handler did not conflict with the Mono soft debugger signal handler.
2. Disable my HockeyApp PLCrashReporter powered crash catcher. This uses an in process signal handle that also interferes with the soft debugger.

With these issues resolved I was able to run my OS X Obj-C app and debug the managed code on a Windows vm running under Fusion.

see https://github.com/ThesaurusSoftware/Dubrovnik/commit/4bf62fabbc6c9c5375bee1f31ed71897a2f13de7

> On 18 Mar 2015, at 10:38, Jonathan Mitchell <jonathan at mugginsoft.com> wrote:
> 
> HI
> 
> I am trying to connect via the soft debugger to an app that uses the embedded API.
> 
> The debuggee is on OS X, the debugger is on a windows machine VM at 192.168.1.72.
> The debugee has .mdb files available that reference symbol source locations on the debugger.
> 
> I have been guided by the following so far:
> http://www.jeffongames.com/2012/03/debugging-embedded-mono/
> 
> On the debug I do my setup like so prior to loading any app specific assemblies:
> 
>    _monoDomain = mono_jit_init_version(domainName, version);
>    mono_debug_init(MONO_DEBUG_FORMAT_MONO);
>    mono_debug_domain_create(_monoDomain);
> 
>    const char* jit_options[] = {
>        "--soft-breakpoints",
>        "--debugger-agent=transport=dt_socket,address=192.168.1.72:10000"
>    };
> 
>    mono_jit_parse_options(2, (char**)jit_options);
> 
> 
> I have configured Xamarin Studio to use the soft debugger and when it is listening I can telnet into 192.168.1.72:10000.
> However I don’t get any sort of debug activity when I run the debugee with the debugger listening.
> 
> Any pointers would be appreciated.
> 
> Two points:
> 
> 1. The link above states : If the Mono client can't connect to the debugging server when it starts up, it will call exit, which is no good.
> I don’t see this behaviour. The app runs whether the debug server is up or not.
> 
> 2. A source note for mono_debug_init at https://github.com/mono/mono/blob/adb9681393a8dfec2ca9c2e8c5a4ed72d663878d/mono/metadata/mono-debug.c#L121
> says 
> 
> * This method must be called after loading corlib,
> * but before opening the application's main assembly because we need to set some
> * callbacks here.
> 
> Is the prior call to  mono_jit_init_version enough to satisfy the above condition?
> 
> Thanks
> 
> Jonathan
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list



More information about the Mono-list mailing list