On 21/06/2016 21:07, Ernest Zaslavsky wrote:
Not sure I got you right. Do you mean catching exception somewhere top level and then showing stack of the original throw point? Isnt it stored (sorry, it was a long time ago) in EXCEPTION_POINTERS' member ContextRecord? AFAIR, if you use __try and __except and pass expression to __except with GetExceptionInformation() you are good to extract the original location of the exception (apparently unhandled) be it C++ or structured exception.
Yes, that's true. I had another look and the esoteric part that I was remembering was extracting the exception message from within the same SEH handler. Getting the stack trace is relatively trivial.
Again, AFAIR, the only compiler option you have to set is /SEH
I assume you mean /EHa. That's not actually required IIRC (and using it sometimes sparks religious debates) but it does let you catch and unwind more exception types than /EHs does, which is sometimes handy, albeit with a performance cost. Also /Oy- helps with getting stack traces in general (GCC equivalent is -fno-omit-frame-pointer).