Bug 12725 - Ouput issue with addr2line on Mac OS X 10.6
Summary: Ouput issue with addr2line on Mac OS X 10.6
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 08:05 UTC by abo.pignard
Modified: 2011-05-03 10:29 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description abo.pignard 2011-05-03 08:05:55 UTC
Hello.
I've used addr2line with GNAT Ada compiler on Mac OS X 10.4 PPC for years.
When I swiched to Mac OS X 10.6 Intel, I got no more correct output but some "??:0".
See how to reproduce it:
$ cat stb.adb
procedure STB is
   procedure P1 is
   begin
      raise Constraint_Error;
   end P1;
   procedure P2 is
   begin
      P1;
   end P2;
begin
   P2;
end STB;
$ gnatmake -f -g stb -bargs -E
gcc -c -g stb.adb
gnatbind -E -x stb.ali
gnatlink stb.ali -g
$ ./stb

Execution terminated by unhandled exception
Exception name: CONSTRAINT_ERROR
Message: stb.adb:4 explicit raise
Call stack traceback locations:
0x10000121b 0x1000011fb 0x1000011e2 0x1000011c0
$ addr2line --exe=stb --functions --demangle=gnat 0x10000121b 0x1000011fb 0x1000011e2 0x1000011c0
??
??:0
??
??:0
??
??:0
??
??:0

How to display correct output?

Thanks, Pascal.
Comment 1 Alan Modra 2011-05-03 10:23:19 UTC
Works for me on linux, both powerpc and x86.  Please attach the executable for your testcase to this bug
Comment 2 gingold@adacore.com 2011-05-03 10:29:24 UTC
addr2line doesn't work on darwin with dwarf debug.  This is due to the fact that debug infos are not
present in executable (but stay in object files).  This darwin particularity isn't handled by binutils.

As a workaround you can use gdb to display locations.