I'm making an application that will send step-over key-presses to Visual Studio to enable it to take screenshots of part of its own code being executed line-by-line.
But it seems when you hit a break-point in your code, ALL threads stop, even ones that haven't hit a break-point. Is there any way around this? Is there some way to get Visual Studio to keep other threads running when I hit a break-point? Or do I have to resort to starting a separate process?
EDIT: To clarify, when the breakpoint is hit, I need to have execution stop only on the thread that hit the breakpoint. I am not looking to have the breakpoint only activate when hit by a certain thread. In other words, I need to have part of my program keep executing while one thread is stopped at a breakpoint in the debugger.
In most languages supported by Visual Studio, you can edit your code in the middle of a debugging session and continue debugging. To use this feature, click into your code with your cursor while paused in the debugger, make edits, and press F5, F10, or F11 to continue debugging.
Parallel processing using many threads can greatly improve program performance, but it may also make debugging more difficult because you're tracking many threads. Multithreading can introduce new types of potential bugs.
Okay, it seems that whenever you hit a break-point in a process, all threads in that process halt, and there doesn't seem to be any way of overriding that behavior.
The only way to do what I'm trying to do is to create a second Process
, and have that Process
be responsible for sending the virtual key-presses to Visual Studio, via an external API call.
Obviously you'll have to have some way of communicating between the main process and the key-pressing process. I looked around and I found that Anonymous Pipes are probably the best method for communicating between two processes running on the same machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With