This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: exceptions and gdb
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: exceptions and gdb
- From: Daniel Berlin <dberlin at redhat dot com>
- Date: 15 Mar 2001 22:04:22 -0500
- Cc: nbecker at fred dot net, gcc at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10103151511400.21126-100000@mars>
Jeff Sturm <jsturm@one-point.com> writes:
> On 15 Mar 2001 nbecker@fred.net wrote:
> > I noticed that if there are uncaught C++ exceptions, gdb is unable to
> > provide any useful info as to the source of the exception. Tracing
> > through stack frames doesn't provide any useful information AFAIK. I
> > wonder if it would be possible to improve this.
>
> >From except.c:
>
> Future directions:
>
> Currently __throw makes no differentiation between cleanups and
> user-defined exception regions. While this makes the implementation
> simple, it also implies that it is impossible to determine if a
> user-defined exception handler exists for a given exception without
> completely unwinding the stack in the process. This is undesirable
> from the standpoint of debugging, as ideally it would be possible
> to trap unhandled exceptions in the debugger before the process of
> unwinding has even started.
>
> Meanwhile setting a breakpoint on __throw is perhaps the best
workaround.
Yup. My patches breakpoint the catch/throw routines, and look up the
stack until we are out of the support routine files, and assume that's
where we threw/caught.
>
> Jeff