This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: traceback feature for gfortran


> I'd be interested in knowing the amount of work required to get that
> working for gfortran, and if someone is willing to take time to
> implement it. By the way, could someone give an example of the
> tracebacks that are provided for example in gcj?

I can give you one for GNAT:

eric@linux:~> cat p.adb
procedure P is
begin
  raise Constraint_Error;
end P;

eric@linux:~> gnatmake p -g -bargs -E
gcc -c -g p.adb
gnatbind -aO./ -E -I- -x p.ali
gnatlink p.ali -g
eric@linux:~> ./p

Execution terminated by unhandled exception
Exception name: CONSTRAINT_ERROR
Message: p.adb:3 explicit raise
Call stack traceback locations:
0x40398b 0x4039c4 0x403b3b 0x403ca9 0x403d27 0x402169 0x402142 0x2a9579400b 
0x401fa8
eric@linux:~> addr2line -e p 0x40398b 0x4039c4 0x403b3b 0x403ca9 0x403d27 
0x402169 0x402142 0x2a9579400b 0x401fa8
/home/eric/build/gcc/native/gcc/ada/rts/a-except.adb:776
/home/eric/build/gcc/native/gcc/ada/rts/a-except.adb:829
/home/eric/build/gcc/native/gcc/ada/rts/a-except.adb:943
/home/eric/build/gcc/native/gcc/ada/rts/a-except.adb:802
/home/eric/build/gcc/native/gcc/ada/rts/a-except.adb:991
/home/eric/p.adb:3
/home/eric/b~p.adb:106
??:0
../sysdeps/x86_64/elf/start.S:113


The implementation is in ada/tracebak.c and ada/tb-gcc.c.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]