Discussion:
thread safety?
(too old to reply)
eduard schreder
2013-09-12 16:30:29 UTC
Permalink
I need a quick user mode debugger for some specific task.

I do the debugging in a separate thread, thread B, not the main thread A, as it is needed for the actual (gui) program.


msdn just states that the the WaitForDebugEvent() method must be called by the thread that initiated the debugging session, and that's ok.


it all worked fine, until i decided that some stats about the debugging process would be nice.


However, when i ask thread B to query a IDebugRegisters or a IDebugDataSpaces and use that in thread A, then thread A never returns from the first call to a method of the received interface.



How can i work around this? Or is the debugger supposed to run in the main thread?
eduard schreder
2013-09-12 16:57:18 UTC
Permalink
Even if i create a new client for my main thread using Idebugclient::CreateClient, it doesnt work.


The main thread just freezes when trying to execute eg IDebugRegisters->GetIndexByName()
eduard schreder
2013-09-12 17:53:36 UTC
Permalink
last reply from me. :)


It looks like the main thread was FROZEN somehow. After the debugee terminates, i get this:


---------------------------
Microsoft Visual Studio
---------------------------
The process appears to be deadlocked (or is not running any user-mode code). All threads have been stopped.
---------------------------
OK
---------------------------
eduard schreder
2013-09-13 09:34:40 UTC
Permalink
alright, i resolved it.

An exception occured within a status handler. Apparently, the exception is then caught by the engine, which subsequently locks itself up.
Loading...