Boost logo

Boost :

Subject: Re: [boost] [Thread] Win32 exception handling
From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-11-25 15:45:56


On Tue, Nov 25, 2008 at 12:23 PM, vicente.botet
<vicente.botet_at_[hidden]> wrote:
> Emil,
>
> Can the Boost.Exception library be useful to recover the stackframe from the time it was thrown ?

The problem is that the debugging information we're talking about is
gone once you catch the exception.

It might be possible to capture stack information and store it in the
exception object before it is passed to throw, but that would A)
require platform-specific (even ABI-specific) hacks, and B) in my
opinion it would have unreasonable overhead (consider that usually
throwing an exception isn't a bug, while such information is only
useful for debugging purposes.)

OTOH, it is relatively easy for the implementation to display this
information if catch(...) is not used. I don't see what's the problem
with this and I don't understand why boost::thread has a catch(...) --
after all, if I wanted a catch(...) I'd write one, right?

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