My program embeds Mono. Most part of the application are in c++ I wrote. Sometimes, the application has Mono JIT compile some assemblycode, and that generated code gets executed.
When breaking the debugger while dynamically generated functions are on the callstack, I would like to make the visual studio debugger a bit more useful by displaying descriptive names for these dynamically generated assembly functions.
Is there a way to tell the debugger: “Hey from 0x78f0000 to 0x78f0300 I wrote the assembly implementation for SomeClass::SomeMethodInAHighLevelLanguage()” ?
One possibility seems to be Synthetic Symbols if you write your own debug extension
http://msdn.microsoft.com/en-us/library/ff537943(v=vs.85).aspx
I tried getting these working with mono in the past, but did not have much luck. I could not get the IDebugSymbols3 interface from the debug engine, but that may have been an error on my part. Assuming you could actually retrieve that interface from a debug extension, the idea is to then register jitted methods via AddSyntheticSymbol.
Another option may be generating .dbg files from within mono and loading those symbols into the debugger (similar to xdebug for gdb):
http://www.microsoft.com/msj/0399/hood/hood0399.aspx
Update
The following macro will output the mixed callstack of both native and managed symbols from mono to the command windows: