Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-11-04 12:06:07


On Mon, 4 Nov 2002 09:35:55 -0600 (CST), "Kevin S. Van Horn"
<Kevin.VanHorn_at_[hidden]> wrote:

>No, my debugger (gdb) does not have a general facility
>for breakpointing every single place an exception is thrown. Even if it
>did, this would be unsatisfactory, because I only want to halt and examine
>the program state when an exception indicating a logical error is thrown;
>I don't want to breakpoint on runtime errors.

That's in fact the main point. I don't know how much this adds to the
discussion but one can imagine a policy to handle this problem. It is
intrusive, in the sense that requires the author of the code to
'separate' throws for runtime errors from throws for logical errors
but, well, he already separates asserts from throws, no?

   template <typename ExceptionT>
     void do_throw_logical(ExceptionT const & ex) { throw ex; }

   template <typename ExceptionT>
     void do_throw_runtime(ExceptionT const & ex) { throw ex; }

   void do_rethrow() { throw; }

Now you can set a breakpoint in the opportune function template
definition (roughly speaking...). I don't like this but maybe it is an
inspiration for something more useful (which is the only reason why I
made a fool of myself by mentioning something like that)

Genny.


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