Boost logo

Boost :

Subject: [boost] Interest check: Boost.Debug
From: Zachary Turner (divisortheory_at_[hidden])
Date: 2009-06-02 16:34:57


In my spare time I have been working on a library to analyze debug
information from a running program. It either already does, or I would like
to have it before I'm done, support all of the following (I'm sure there are
plenty of other neat additions that I haven't thought of):

- Loading debug info either for the currently running executable or from an
offline executable
- Printing human readable stack traces from a running program
- Dumping stack traces to a file in release mode. In this case it's usually
just a dump of the entire stack in binary.
- Matching dumped stacks from step 3 to debug information offline to get
post-mortem information.
- Assuming symbol information is loaded either for the running program or an
offline program, format a block of memory in a human readable format to
print the structure of the memory (for example, display member values of a
class with field names, given a block of memory representing an instance of
the class)
- Iteration of loaded modules
- Check whether debugger is attached
- output stream that goes to the debugger console, and is not visible in the
debugged process. I'm not sure about the feasibility under non-windows
platforms (it's very easy in windows), but I would think that if it's
possible to figure out the PID of the process debugging you, that it should
be possible to send output to their stderr which should achieve the same
effect.
- launch process under a debugger and receive basic types of debugging
notifications.

There's some obvious portability concerns, and some of these things are
(considerably) more difficult than others, so I can't say I'd be able to
support everything. However I already have rudimentary support for about
half the items on the list although it is definitely in its infancy since
before now I had not considered extending this to any other platforms /
architectures.

Main problem is that I can't say that I know enough about OSes other than
Windows, and architectures other than x86/x64 to know if it would be not
worth the hassle to prepare something like this for introduction into
boost. Also everything I've done so far is only on Windows, and I don't
suppose I'd have the know-how to make it work on any other OS, so in that
sense I'd need some assistance.

That being said, is it worth it to tackle something like this or should I
just not worry about the generality and keep working on it for personal use
only?


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