Addr2Line doesn't work

4 posts / 0 new
Last post
ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Addr2Line doesn't work

I remember that with an old SDK I could get Addr2Line to work, but since some SDK (or OS4?) update I've never had any success. All it outputs is:

??
??:0

I am compiling my C++ program with the -ggdb option. When it crashes, I am taking the offset from the Grim Reaper, and passing it to Addr2Line along the lines of:
ppc-amigaos-addr2line -e program_name -f offset2

Or just:
addr2line -e program_name -f offset2

For example:
addr2line -e FooBar -f 0xc9b70r

Does anyone have any suggestions?

Rigo
Rigo's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2011-01-24 21:55
I see you've been answered

I see you've been answered elsewhere, but for the sak of completeness, I'll answer here too.

Later SDKs changed slightly, and addr2line needs to be told which section to use, rather than just guessing. The command to use is:

addr2line -e --section=.text

That works just fine. Don't forget to compile with the -g or -gstabs option. -ggdb adds extra debug info that is specific to gdb, and will take longer to compile. This extra debug is not used by addr2line.

Simon

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
@Rigo Thanks for the

@Rigo
Thanks for the clarification. I will only use -g in the future.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

Rigo
Rigo's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2011-01-24 21:55
That should, of course,

That should, of course, be:

addr2line -e <bin> --section=.text <addr>

(The htmlparser filtered the bin and addr as tags)

Simon

Log in or register to post comments