Boost logo

Boost :

From: Martin Fuchs (martin-fuchs_at_[hidden])
Date: 2002-06-13 15:37:51


> a) automatically trace back the stack with as much symbolic information as
> possible, requiring use code only at the catch point.
> b) manually collect context information while exceptions are unwinding the
> stack, requiring a lot of user intervention.

a) seems to me very valuable, if one wants to build bug reports.
b) can be used to display information for the program user in case of
an exception, which will be displayed on the screen.

If you want to see a really portable solution for accessing the stack
contents,
you can look at the gdb implementation.
(files frame.h, tm-<ARCHITECTURE>.h, ...)
There is used a set of platform dependend macros to look at the stack
of the debugged process. Of course the code is pure C, no C++.

If we want to include stack trace support to boost, we could create a
platform dependend library, which can be encapsulated in a portable
shell. The interface of the helper library would not be very big, since
the basic functionality is clear: Take the current program counter,
walk back the stack, and output information such as addresses,
and function names. May be some one also wants to see the local
variables on the stack?

Furthermore, I would like to see another feature, which could be used
in case of an unexpected program termination following a failed assert
or unhandled exceptions:
Tracing any of the stacks of the currently running threads.

Martin


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk