473,378 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

intercepting a handled exception in the debugger

Is it possible to do this ? i cant see any likly options.
I have an exception handler but I want to examine the exception before
it gets to the handler, Is there a way to do this ?

At the moment i have to comment out the exception handler
to examine whats going on at the time of the exception in more detail.

but if its not the first exception that ocurs that I want to debug
then im stuck, is there a way to deal with this ?

I have different types of exception handler wich I comment out wich helps.

Colin =^.^=
Nov 19 '07 #1
6 1626
Your post is somewhat unclear because it doesn't specify how the exception
handler works. If you have a try / catch block, you should be able to set a
breakpoint on the line where your "exception handler" (Whatever it is) gets
called, and examine the exception via Intellisense and visualizers.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"colin" wrote:
Is it possible to do this ? i cant see any likly options.
I have an exception handler but I want to examine the exception before
it gets to the handler, Is there a way to do this ?

At the moment i have to comment out the exception handler
to examine whats going on at the time of the exception in more detail.

but if its not the first exception that ocurs that I want to debug
then im stuck, is there a way to deal with this ?

I have different types of exception handler wich I comment out wich helps.

Colin =^.^=
Nov 19 '07 #2

"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:D8**********************************@microsof t.com...
Your post is somewhat unclear because it doesn't specify how the exception
handler works. If you have a try / catch block, you should be able to set
a
breakpoint on the line where your "exception handler" (Whatever it is)
gets
called, and examine the exception via Intellisense and visualizers.
sorry yes its just a try catch block, i didnt know of any other type.
but if I set a breakpoint in the catch
block then I havnt got access to any variables that were on the stack
at the time the exception happened.

for example say an index is out of range I want to know what the index was,
and what other variables were that led to that index value.
Colin =^.^=
Nov 19 '07 #3
Well, this is kind of a Catch-22. If an index was out of range, that would be
why you are in the catch block, and the exception message and stacktrace
would reflect that, no?
--
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"colin" wrote:
>
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:D8**********************************@microsof t.com...
Your post is somewhat unclear because it doesn't specify how the exception
handler works. If you have a try / catch block, you should be able to set
a
breakpoint on the line where your "exception handler" (Whatever it is)
gets
called, and examine the exception via Intellisense and visualizers.

sorry yes its just a try catch block, i didnt know of any other type.
but if I set a breakpoint in the catch
block then I havnt got access to any variables that were on the stack
at the time the exception happened.

for example say an index is out of range I want to know what the index was,
and what other variables were that led to that index value.
Colin =^.^=
Nov 20 '07 #4
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:BD**********************************@microsof t.com...
Well, this is kind of a Catch-22. If an index was out of range, that would
be
why you are in the catch block, and the exception message and stacktrace
would reflect that, no?
I dont know about catch22, I just want the debuger to intercept the
exception before
it gets to my catch block (so i can see all the variables as if there was no
catch block)
but then to allow me to let the catch block handle the exception and carry
on.

im sure ive seen similar option in other ide.

the exception message displays quite a bit of usefull information,
but just knowing an index was out of range is not sufficient on its own,
the code im debugging is a serialisation routine,
and the index is extracted from the file,
if it goes negative for example it usually means it has got out of step
reading the previous fields.

when the stack unwinds and gets back to the catch block the information
about the previous fields is lost.

I have put traps and checks in various places, the best way so far is to
have a function wich wraps
the try-catch around the serilisation routine,
if it gets to the catch then to optionaly call the function again with the
same parameters with no try-catch.

Colin =^.^=
Nov 20 '07 #5
In VS 2005,

Debug --Exceptions
(Or Ctrl + d, e)

You can choose which exceptions (individual or by group) you want the IDE to
break on, before passing them to a catch block.

Hope that helps

--
Ged Moretta
www.appsense.com

-----------------------------------------------------------------------
This signature isn't automatic. I have to type it manually every time.
"colin" <co*********@ntworld.NOSPAM.comwrote in message
news:EG*******************@newsfe1-gui.ntli.net...
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in
message news:BD**********************************@microsof t.com...
>Well, this is kind of a Catch-22. If an index was out of range, that
would be
why you are in the catch block, and the exception message and stacktrace
would reflect that, no?

I dont know about catch22, I just want the debuger to intercept the
exception before
it gets to my catch block (so i can see all the variables as if there was
no catch block)
but then to allow me to let the catch block handle the exception and carry
on.

im sure ive seen similar option in other ide.

the exception message displays quite a bit of usefull information,
but just knowing an index was out of range is not sufficient on its own,
the code im debugging is a serialisation routine,
and the index is extracted from the file,
if it goes negative for example it usually means it has got out of step
reading the previous fields.

when the stack unwinds and gets back to the catch block the information
about the previous fields is lost.

I have put traps and checks in various places, the best way so far is to
have a function wich wraps
the try-catch around the serilisation routine,
if it gets to the catch then to optionaly call the function again with the
same parameters with no try-catch.

Colin =^.^=
Nov 20 '07 #6
<Gedwrote in message news:eV**************@TK2MSFTNGP04.phx.gbl...
In VS 2005,

Debug --Exceptions
(Or Ctrl + d, e)

You can choose which exceptions (individual or by group) you want the IDE
to break on, before passing them to a catch block.

Hope that helps
cool yes thanks that does exactly what I want :D

I was looking in the wrong place, I hadnt even come accros that window
before.

I checked on break on throw and it stoped at the problem then allowed me to
continue
and handle it in the catch block.

Colin =^.^=
Nov 20 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MikeZ | last post by:
I have a 3rd party ActiveX Control in windows Form. It sometimes generates error which not come from my source code. How can I handle this? Thanks. See the end of this message for details on...
9
by: Claudio Di Flumeri | last post by:
Hello all, I've added a global exception handler to my application in this way: Sub Main() AddHandler Application.ThreadException, AddressOf ThreadException AddHandler...
5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
6
by: lgbjr | last post by:
Hi All, I've posted this question on the ComponentOne news group, but I thought it couldn't hurt to post it here as well, since, I’m assuming, some others out there are using the C1 controls for...
2
by: Murthy | last post by:
Hi, After genarating the exe when i run the exe the following error is comming. Common Language Runtime Debugging Services Application has generated an exception that could not be handled....
3
by: Nick | last post by:
Hi there, This probably wont make much sense but I'm getting an unhandled exception being thrown in the following line... Try While True Redraw control as necessary End While Catch ex as...
2
by: Abubakar | last post by:
Hi all, I'm writing an app in vc++ 2k5 (all native/unmanaged). This application does a lot of multithreading and socket programming. Its been months since I'm developing this application, at...
0
by: ticean | last post by:
I'm using the Enterprise Exception Handling Blocks. I'm catching exceptions by ExceptionType and Policy, wrapping them and sending them up the chain. My problem is that I'm finding it very...
1
by: Ami | last post by:
We have an application where in SOAP is used as a middle layer to communication between Java Front layer and DCE( Distributed Computing Env) backend layer. We are using Systinet Server for C++ to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.