Friday, September 11, 2009

[VC++] Catching exception with debugger

You may some times feel crazy about some exceptions in your application. You have no idea where it is happening in the code and what you can do now is debugging the suspicious location in the issue happening scenario. Let me welcome you to a better approach with your VC++ debugger, so that you will get a better context of the issue causing exception. Follow the steps,

1. Debug your application (Either start with debugger or attach your process with the debugger).
2. In the VC 6 debugger choose Debug->Exceptions then you can see a dialog with various exception types.
3. Click and select all the Exceptions, now press OK.
4. Run your scenario.
5. When an exception happen a message box will be shown in the debugger and execution will break.
6. Now you can get the call stack where exception happens. For this check the Context combo box in the debugger IDE.
7. Now select each location in the call stack and interpret the cause (you can get the value of the variables).

4 comments:

Anonymous said...

hello... hapi blogging... have a nice day! just visiting here....

Review Jen said...

This post actually is good one, event many people have turned to .net.

Thanks
Jen
www.reviewinfobase.com

Anonymous said...

Gro the fuuck- up jerkoff. The real truthseeker222@gmail.com here, I am scared shitless of you Mason's STOP FOLLOWING ME.

Shahana Shafiuddin said...

Good idea.