Francisco G

I need to attach different debuggers (each one is a different process) to a different target thread in the same process. I have built a prototipe that attaches to a thread after that I try to attach mcordbg to the same process and failed to do that. That's the meaning of the sentence: "I'm interested on developing a independent debugger per thread solution".

Does the module mdbgeng support this Must I use raw ICorXX interfaces

Re: Building Development and Diagnostic Tools for .Net Attaching multiple debuggers to a target ( Multithread stepping)

Mike Stall - MSFT

Both IcorDebug and Win32's native debugging only allow 1 debugger to be attached to a single debuggee.

MDbg builds on top of ICorDebug, and so has the same restrictions.

If you want to allow multiple debuggers to attach, what you'd need to do is have a "Mux" process that's the real debugger that's actually attached to the debuggee. Other debuggers then attach to the mux, and the mux multiplexes out debug events, etc, to each of the connected debuggers.

However, a further challenge is that ICorDebug inspection only is valid while the target is stopped. Thus if the debuggee region assocaited with debugger A is running, then the debuggee process as a while must be running (since ICorDebug debugging is process-wide). That means that debugger B can't do inspection since most inspection operations will fail (with CORDBG_E_PROCESS_NOT_SYNCHRONIZED),

It's not clear if what you're trying to do is actually possible in practice. We've theorized some ideas, but have never actually prototyped it.