source of exception

John Demme me at teqdruid.com
Sat May 6 18:52:43 PDT 2006


Frank Benoit wrote:

> On linux with gdb:
> If i have an exception I cannot get the source of the exception. A msg
> like "std.format formatArg" lets me grep through my program and search
> for all lines calling format and analyse them as potential sources. And
> this is a good one. Try to find a ArrayBoundsException.
> 
> Is there a chance to get the "catch throw" command (breaks on a c++
> throw) in gdb working?
> 
> Or is there any better way to find the source?

That's a non-trivial function to add to GDB.

As a hack, I have two different versions of libphobos.a-- the regular one,
plus one that I compiled wherein I insert the following code in the
Exception constructor:
Object o;
o.toString();
GDB catches the segfault, and I can do a backtrace to see what caused the
exception.

~John Demme



More information about the Digitalmars-d mailing list