I am writing simple post-mortem interop debugger that will save dumps and get the mixed stack of crashed process. The only valid way to do I see to do this is to use ICorDebug. Well, I wrote (unmanaged) app that gets ICorDebug interface, attaches intelf to running process, registered the application under AeDebug key... and I get only unmanaged events via ICorDebugUnmanagedCallback::DebugEvent. I do properly respond to inband events via the separate thread; the last event I see is out-of-band THREAD_EXIT_DEBUG_EVENT, and ICorDebugManagedCallback events were not called. In the same time, when I attach to the live process, I get the full sequence of events. My questions are: - are there any hints :), samples ? - where am I wrong in development the debugger? Do I miss some vital steps? - I suspect that thread that exited was a .net helper thread... if so, how can I get this thread out of exiting?
ICorDebug is for debugging managed code, if your target is an unmanaged app, we can just creates a native app that does a native attach and call MiniDumpWriteDump (http://msdn.microsoft.com/en-us/library/ms680360(VS.85).aspx ), MSWD is a standard way to collect a dump.
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.
dmitry pervushin
Dmitry,
Do you have a requirement to builda new tool for post-mortem analysis of crashes from native and/or managed code, or are you okay reusing existing tools? Understanding this will help us scope our answers to this question.