This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: exceptions and gdb


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]