$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] Vault access for Boost.Debug
From: Edd Dawson (lists_at_[hidden])
Date: 2009-06-15 13:28:25
Zachary Turner wrote:
> I'd like to request access to the vault.  I'm going to upload a
> proof-of-concept of some of the things I mentioned earlier in my
> thread about Boost.Debug.  This early version gives simple stack
> traces in limited scenarios, only supports Windows, and isn't designed
> very well.  Here's an example of a program using it in its current
> form:
> 
> void test_func(int argc, int argc2, char* argv[])
> {
>     stack_trace trace(10);   //Maximum depth of 10 levels
>     std::cout << trace.string() << std::endl;
> }
> 
> int main(int argc, char* argv[])
> {
>     test_func(argc, argc, argv);
>     return 0;
> }
> 
> and an example of the stack trace printed as a result of this program:
> 
> void test_func(int, int, char**)   [f:/dev/stack_trace/main.cpp:10]
> int main(int, char**)   [f:/dev/stack_trace/main.cpp:23]
> int __tmainCRTStartup()   [f:/dd/vctools/crt_bld/self_x86/crt/src/crtexe.c:406]
> int mainCRTStartup()   [f:/dd/vctools/crt_bld/self_x86/crt/src/crtexe.c:389]
I have some very similar code that works with MSVC (32 bit targets, anyway), 
MinGW and Mac OS X. Please feel free to take anything you might want:
http://bitbucket.org/edd/stack_trace/wiki/Home
Also, someone has written some modifications to get the MinGW version to use a 
dll from Wine in order to loosen some of the licensing restrictions (the MinGW 
code needs to link against libbfd, which is GPL). More on that here:
http://realazthat.blogspot.com/2008/12/stack-trace-from-within-program.html
> It also currently supports printing the names of all the arguments,
> but it was hackish and I left it out until it undergoes some redesign.
I didn't go this far!
Kind regards,
Edd