digitalmars.D - source of exception
- Frank Benoit (8/8) May 06 2006 On linux with gdb:
- John Demme (10/20) May 06 2006 That's a non-trivial function to add to GDB.
- BCS (4/12) May 06 2006 I haven't tried it but you might be able to set a break point the except...
- Thomas Kuehne (17/32) May 07 2006 -----BEGIN PGP SIGNED MESSAGE-----
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?
May 06 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
May 06 2006
In article <e3jg4m$1jj0$1 digitaldaemon.com>, Frank Benoit says...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?I haven't tried it but you might be able to set a break point the exception's constructor. If they don't have one, thay should (at least in the debug version).
May 06 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 BCS schrieb am 2006-05-07:In article <e3jg4m$1jj0$1 digitaldaemon.com>, Frank Benoit says...the interresting breakpoint is: _d_throw 4 the problem: gdb interpretes "break _d_throw 4" as "break _d_throw" :( workaround: Compile and link your programm. Use the output of the following shell command to set a breakpoint: objdump -t yourProgramm | grep "_d_throw 4" | head -n 1 | sed "s: .*::;s:^:break *0x:" Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEXjy03w+/yD4P9tIRAjDEAKCqXdt5v9FWsD9wInOI2kZdIp8cZACdEMaa VXcYRZd56NThgATUPVgLa0E= =u0+P -----END PGP SIGNATURE-----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?I haven't tried it but you might be able to set a break point the exception's constructor. If they don't have one, thay should (at least in the debug version).
May 07 2006