Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug exception on other thread?

I have a lot of shortlived threads that updates my program, by events fired from a socket connection. My problem is I don't know how to debug this, like how to get the proper information on where in the code the exceptions occur. Because I get for example an exception like below, and this will just be the print in the Immidiate Window. There is no pop-up window, and it does not highlight any line in the code or show even what method it was in.

What am I missing? What I can do to see these things? And what improvements does VS2010 give on this situation, if any?

A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Krs.Ats.IBNet.dll
like image 279
bretddog Avatar asked Jan 06 '11 08:01

bretddog


People also ask

What happens to thread on exception?

If there is an exception handler installed for the ThreadGroup, the JVM passes the exception to it. If it's an AWT thread, you can install an event handler for otherwise unhandled exceptions. Otherwise the JVM handles it.

What happens to thread on exception in Java?

An uncaught exception will cause the thread to exit. When it bubbles to the top of Thread. run() it will be handled by the Thread's UncaughtExceptionHandler. By default, this will merely print the stack trace to the console.


1 Answers

Go to "Debug -> Exceptions...", locate the "Common Language Runtime Exceptions" and check the "Thrown" mark. Now start debugging your application. Once any of CLR exception occurs the execution will stop on that line.

like image 110
volpav Avatar answered Nov 01 '22 11:11

volpav