|
Boost : |
Subject: Re: [boost] Interest check: Boost.Debug
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-06-02 18:08:16
On Tue, Jun 2, 2009 at 2:47 PM, Christian Holmquist
<c.holmquist_at_[hidden]> wrote:
> 2009/6/2 Zachary Turner <divisortheory_at_[hidden]>
>> - Printing human readable stack traces from a running program
>
> IMO getting a stack-trace really quick, and defer the print-out (using the
> dbghelp on windows for instance) until the user requests it would be more
> useful than printout only. Like:
>
> boost::debug::stack_trace foo()
> {
> return stack_trace();
> ]
>
> boost::debug::stack_trace bar()
> {
> return foo();
> };
>
> main()
> {
> std::cout << bar();
> }
>
> It could then also be bundled together with boost::exception without a huge
> performance impact at throw site, and without having the exception object
> grow unhealthy big.
Adding stack trace support to Boost Exception was also discussed at
BoostCon, it would definitely be a nice addition to the rest of the
information recorded in Boost exceptions automatically by
BOOST_THROW_EXCEPTION.
I'm guessing that the stack trace information could be stored in
boost::exception as a little more than just a list of pointers to
functions, and converted to string at the catch site. Of course this
support should be kept separate from Boost Exception, IMO a simple
interface like this would be ideal:
namespace boost
{
namespace debug
{
class stack_trace;
shared_ptr<stack_trace> get_stack_trace();
std::string to_string( stack_trace const & );
}
}
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk