source of exception

Thomas Kuehne thomas-dloop at kuehne.cn
Sun May 7 10:29:37 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

BCS schrieb am 2006-05-07:
> In article <e3jg4m$1jj0$1 at 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).

the interresting breakpoint is:
_d_throw at 4

the problem:
gdb interpretes "break _d_throw at 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 b  | grep "_d_throw at 4" | head -n 1 | sed "s: .*::;s:^:break *0x:"

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFEXjwd3w+/yD4P9tIRAk2SAJ9x190uM+Its+14lM+pdykbUiaD/ACgtPjT
jpcJhPOup9pgQtAD+0GxJA8=
=tbD8
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list