views:

36

answers:

2

My Visual C++ application is compiled with /EHA option, letting me catch structured exceptions (division by zero, access violation, etc). I then translate those exceptions to my own exception class using _set_se_translator(). My goal is to improve our logging of those types of exceptions.

I can get the type of exception from the EXCEPTION_RECORD structure, and the exception address. I would like to be able to gather more information, like the source file/location where the exception is thrown, the call stack, etc. Is that possible?

I do create an exception minidump on structured exceptions - is there a tool to automatically get the call stack from that?

+1  A: 

Call stack and all other exception information is available using minidump post-mortem debugging:

http://www.codeproject.com/KB/debug/postmortemdebug_standalone1.aspx

AFAIK, generating stack information in the place for logging is impossible without .pdb files. Usually .pdb files are not installed on a client computer.

Alex Farber
A: 

One idea I had is to use different translator functions in some of the different threads (there is one translator function per thread) so I can know from which thread the structured exception was thrown.

It's not so practical because you can't pass any argument to the translator function, so you need a bunch of different translator functions.

Martin