DbgEng - get output of command not through callbacks

329 Views Asked by At

I make a standalone deubugger app using Microsoft's DbgEng. I want to open a 2nd thread that sends commands to an additional IDebugControl instance, and I want to get the specific output for this IDebugControl Execute method call (and send it through a tcp connection).

I have a problem since the IDebugControl from main thread also sends commands to Execute() and the outputs might be mixed. I need a second thread because once it execute a command like "g" (go) it will call WaitForEvent() and I won't be able to get any further information about the target until an event occurs.

I need a solution for that.

The second IDebugControl is used for operations that send requests for only data, like disassembly lines, memory dump... I wonder if I can make a 2nd IDebugClient and attach it to the already opened debugged process, and then the problem is solved because I can put other callbacks to it.

Is there a solution for me?

1

There are 1 best solutions below

0
pykd team On

I think you should not call any command to debug engine while it is waiting for events except IDebugControl::SetInterrupt.

If you want use two thread anyway you can register IDebugOutputCallbacks callback interface and handle output with any sort of mutex.