SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Justin Dearing

Improved unhandled exception reporting in SharpDevelop3

One of the areas the SharpDevelop debugger has been weak in is dealing with unhandled exceptions. Ths has been improved in SharpDevelop 3 in two areas. These are the Local Variable pad, and the form that displays unhandled exceptions thrown from a debugged application to the user.

To illustrate these changes I have made a simple C# solution that contain a simple program that throws an exception when run. You can download it via the svn url https://nightelves.svn.sourceforge.net/svnroot/nightelves/DebuggerExceptionHandlingTest/. I suggest familarizing yourself with the new features by running this solution inside of SharpDevelop 3. You can of course write your own simple application that throws an exception.

In the past, when an uncaught exception is thrown by an application being debugged by SharpDevelop, a simple form with a text are is displayed. The textarea contained information about the exception including the message and stacktrace. You then had the option to break, ignore or terminate. If you selected break, the debugger would pause at the point the exception was thrown. If the local stack frame happened to have an exception object referencing the exception being thrown, you could explore the exception. However, this was not always the case. Therefore one had to stick a redundant "catch (Exception ex) { throw; }" in their code to explore an exception. This is no longer the case thanks to several improvements in the debugger.

The first thing you will notice is that the TextArea in the unhandled exception form displays more data and displays the exceptions InnerException property recursively.  The second thing you will notice is that you can now maxamize the form. Wha tis not immediatly apparent is that when you resize this form, its size and position is stored in your SharpDevelop settings. Therefore, next time you get an unhandled exception, the form will be the same size.

Finally, you will notice a hyperlink labeled "Show Exception Details". When you click on that a TreeViewAdv widget displays the exception details exactly as it would be displayed in the local variable pad. This gives you access to all the exception properties.

If you select "Break" on the debugger window, and look at the local variable pad, you will notice that in addition to all the other variables, one called $exception exists. This is the exception that was thrown at this point in the application. This is illustrated below.

LocalVarPad Unhandled Exception

To illustrate the differences between the unhandled exception dialog in the SharpDevelop 2 and SharpDevelop 3 debuggers, below is a screenshow of them both displaying an unhandled exception.

Debugger Exception Dialogs

I hope this small improvement will make debugging an application with SharpDevelop easier.

Comments

 

User links about "debuggers" on iLinkShare said:

Pingback from  User links about "debuggers" on iLinkShare

February 18, 2009 3:10 AM
 

ajdv said:

WWW.AsiaHandbag.com offers fashion replica Louis Vuitton handbags, replica Bally hanbags, Balenciaga handbags, Chanel handbags, Chloe handbags, Christian Dior handbags, Fashion Dolce & Gabbana handbags, Fashion Fendi handbags, Fashion Gucci handbags, Fashion Hermes handbags, Fashion Coach handbags ,Fashion Versace handbags, Fashion Prada handbags, Fashion Yves Saint Laurent handbags, Fashion Marc Jacobs handbags, Fashion Jimmy Choo handbags, Fashion Loewe handbags, Fashion Miu Miu handbags, Fashion Mulberry handbags, Fashion Thomas Wylde handbags.

March 16, 2009 10:11 AM
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.