Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to break all threads but one in Visual Studio 2010?

Is it possible to break all threads but one in Visual Studio 2010 Ultimate?

One of the threads in my application is running a TCP proxy. The server that it connects to disconnects when the client (that connects to my proxy) doesn't send a keep-alive packet every few seconds.

So I would need to break all other threads (like packet processing) so that I can edit that part without getting disconnected.

Is this achievable without add-ons?

like image 637
lesderid Avatar asked Mar 23 '11 14:03

lesderid


People also ask

Do breakpoints stop all threads?

By default only the thread that hits the breakpoint stops. However, you can modify the behavior by changing the breakpopint properties. Save this answer.

Is Visual Studio multithreaded?

Visual Studio provides different tools for use in debugging multithreaded apps. For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, the Parallel Stacks window, the Parallel Watch window, and the Debug Location toolbar.

How do I stop a thread in Visual Studio?

Select a thread. Right-click the thread. Select "Kill thread" from the context menu.


1 Answers

One solution that might possibly work, is to write a macro that you call when you stop at a BP that function evaluates some function that sends some stay alive packets.

E.g. your macro goes like

DTE.Windows.Item("{ECB7191A-597B-41F5-9843-03A4CF275DDE}").Activate() 'Immediate Window DTE.ExecuteCommand("Debug.Print", "KeepAliveFunc()")

It's obviously not ideal, but if nothing else helps...

like image 195
Luke Kim Avatar answered Oct 07 '22 03:10

Luke Kim