Peter N Lewis wrote:
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, Apple still has its own hacked cctools for Mac OS X (and I didn't find a binutils package). We will have to ask on a Darwin mailing list.
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.
The atos works tool works also, see http://developer.apple.com/technotes/tn2004/tn2123.html. e.g.
G5:~/Desktop/pp] adriaan% atos -o ./SillyBalls 0xba0b __p__M0_S0_Initialize (MainProgram.p:162)
Regards,
Adriaan van Os