« Yahoo! Mail Offering Unlimited Storage | Main | Live Earth - 24 Hours Global Concerts for a Climate in Crisis »

Use Visual Studio to Quickly Locate Where the Exceptions are Thrown

When there are a deep chain of function calls, especially when the managed and unmanaged code are intermingled together, it's getting more trickier to debug.  One situation is that an exception is thrown deep at the bottom of the chain and caught at some level after it's relaid/re-thrown by a couple of levels and the message logged by the exception handler code is too generic to help locating the root cause of the exception.  In this case Visual Studio could help locate where the exception is actually thrown at the beginning.  This helps a lot in narrowing down the problem when debugging in a large code base.

After loading the project into Visual Studio, bring up the exception dialog by menu "Debug" => "Exceptions..." and check the types of the exceptions that you want to investigate.  After this attach to the process in question.  Whenever the statement will cause exceptions to be thrown, it will prompt and let you choose whether to break at that trouble statement and do further investigation.

TrackBack

TrackBack URL for this entry:
http://stanblog.jojoyao.com/cgi-bin/mt/mt-tb.cgi/51

Post a comment


About

This page contains a single entry from the blog posted on July 5, 2007 12:05 AM.

The previous post in this blog was Yahoo! Mail Offering Unlimited Storage.

The next post in this blog is Live Earth - 24 Hours Global Concerts for a Climate in Crisis.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33