Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] Checking interest in stacktrace library
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2016-06-22 03:06:15


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).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net