Catching SEH and c++ exception 
Author Message
 Catching SEH and c++ exception

Is there a way of getting the exact location of the thrown exception,
down the file and line. I know of the preprocessor direcives __LINE__
and __FILE__ but i dont think they can be used in this case.

-ddn



Sun, 23 Mar 2003 03:00:00 GMT  
 Catching SEH and c++ exception
Step 1: Create  an SEH to C++ translator using _set_se_translator.
Step 2: In your SEH translator function, use the DBGHELP.DLL functions
to determine the exact line and file in which the error occurred.

There are great articles on just how to do this in the MSDN by John
Robbins (see his Bugslayer colum).  He also has a great book about
about how to do this.  If yu want, you can dump out the entire call
stack up to the point where the exception occurred.  I mean with file
names and line names, not just binary offsets.

Check out the DBGHELP functions.  They're pretty powerful.

This technique requires that you build and distribute debug
information for your executables -- even release builds.  Don't worry,
it doesn't add overhead to the code.

Joe O'


om...

Quote:
> Is there a way of getting the exact location of the thrown
exception,
> down the file and line. I know of the preprocessor direcives
__LINE__
> and __FILE__ but i dont think they can be used in this case.

> -ddn



Sun, 23 Mar 2003 03:00:00 GMT  
 Catching SEH and c++ exception
You wouldn't happen to know the name of the book off hand, would you?

--
Reginald Blue                   | Opinions expressed here do not
Natural Language Understanding  | necessarily represent those of
Unisys Corporation              | my employer.
--------------------------------+-------------------------------

NL technology,speech application| My email address is wrong, you
development training, see:      | need to remove the obvious.
http://www.speechdepot.com/     +-------------------------------


Quote:
> Step 2: In your SEH translator function, use the DBGHELP.DLL functions
> to determine the exact line and file in which the error occurred.

> There are great articles on just how to do this in the MSDN by John
> Robbins (see his Bugslayer colum).  He also has a great book about
> about how to do this.



Mon, 24 Mar 2003 03:00:00 GMT  
 Catching SEH and c++ exception
"Debugging Applications" by John Robbins, Microsoft Press

Joe O'


Quote:
> You wouldn't happen to know the name of the book off hand, would
you?

> --
> Reginald Blue                   | Opinions expressed here do not
> Natural Language Understanding  | necessarily represent those of
> Unisys Corporation              | my employer.
> --------------------------------+-------------------------------

> NL technology,speech application| My email address is wrong, you
> development training, see:      | need to remove the obvious.
> http://www.speechdepot.com/     +-------------------------------



> > Step 2: In your SEH translator function, use the DBGHELP.DLL
functions
> > to determine the exact line and file in which the error occurred.

> > There are great articles on just how to do this in the MSDN by
John
> > Robbins (see his Bugslayer colum).  He also has a great book about
> > about how to do this.



Mon, 24 Mar 2003 03:00:00 GMT  
 Catching SEH and c++ exception

A qucik search on msdn turns up

Debugging Applications by John Robbins

the amazon link on his page :

http://www.amazon.com/exec/obidos/ASIN/0735608865/qid%3D948813117/sr%3D1
-1/102-3820253-7438502

Hope this helps, im definetly going to get it, as well.

-ddn



Mon, 24 Mar 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Catch SEH and C++ exception in one sentence, possible or not?

2. How to catch a SEH with C++ catch?

3. Translate a SEH exception into a C++ exception

4. Catching Win32 exceptions with a C++ catch-block

5. TRanslating SEH to C++ exceptions

6. C++ Exception Handling And SEH

7. SEH and C++ exception

8. SEH vs C++ Exception handling for an ATL project

9. SEH Raised exception in C++ ?

10. mixing C++ and SEH exceptions

11. Catching hardware exceptions using C++ exceptions

12. Catching SEC Exceptions as C++ Exceptions

 

 
Powered by phpBB® Forum Software