At 5:48 +0200 27/7/05, Frank Heckenbach wrote:
However, the main thing that gpc-run is to run the program with the option --gpc-rts=-E... (you might also consider --gpc-rts=-F...; run a GPC compiled program with --gpc-rts=-h for details). This gives more information, in particular a backtrace. Afterwards, it uses addr2line to translate the error and backtrace locations into routine names and source code positions.
Hmm, it looks like addr2line is part of binutils, and my feeble attempt to compile binutils on Mac OS X comes up short when ./configure says:
*** This configuration is not supported in the following subdirectories: bfd binutils ld gas opcodes gprof (Any other directories should still work fine.)
Unfortunately binutils is mentioned a lot so I haven't been able to track down if it is possible to get addr2line working under Mac OS X.
I don't support there are any suggestions on how to get the line based on the address other than addr2line?
gdb and trap on _p_RuntimeError works, and then a backtrace shows the stack with line numbers, but that means recreating the error a second time under gdb so it's not as quick for simple errors.
Thanks, Peter.