.NET provides an API to debug programs: http://msdn.microsoft.com/en-us/library/bb397953.aspx Is it possible to debug a thread in the same process? In other words, is it possible to have the debugger and debugee in different threads in the same process?
+2
A:
I'm fairly certain that when you debug a process, it debugs all threads.. thus when you stopped execution of one thread, so too would your debugger stop.
The reason for this seems clear, because threads have to interact with each other, and if you don't break all threads, then your debugging becomes very difficult.
Mystere Man
2009-08-13 01:05:43
This is correct. However, when you continue from the breakpoint in the debugger, all threads continue, except if you froze them, so it could be theoretically possible to debug another thread from within the same process. However, this isn't how it's done in Windows, and all the debug APIs I know of are for attaching to and debugging a separate process.
codekaizen
2009-08-13 01:29:13
+1
A:
No, this isn't possible. If you want to do this in a strange piecewise fashion, use userdump.exe to write an image of your process to disk, then poke through it using the native debug APIs and SOS
Paul Betts
2009-08-13 01:41:11