addr2line ends up off by 1 line numbers when -O0 is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not sure whether to blame libc (backtrace() function) or gcc or
addr2line, but
if I dump the pointers from backtrace() to address_file then use

addr2line -e my_exe -f -i <address_file >call_locations

to recover the line numbers, the line numbers are off by 1 statement
for some stack frames when -O0 has been used, but not if -O2 has been
used at compile time.

The documentation for backtrace() suggests that things should work
better with -O0 but I seem
to get the opposite.

I'm on gcc 4.8.1, addr2lines binutils 2.26 and libc 2.11.3-4 debian package:
$ ldd --version
ldd (Debian EGLIBC 2.11.3-4) 2.11.3



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux