Regression: incorrect line numbers in debug info since 4.5+
Peter A. Felvegi
petschy@praire-chicken.com
Mon Jun 25 18:13:00 GMT 2012
Hello,
> Which version of GDB?
>
> As documented at http://gcc.gnu.org/gcc-4.5/changes.html
>
> GCC now generates unwind info also for epilogues. DWARF debuginfo
> generated by GCC now uses more features of DWARF3 than before, and
> also some DWARF4 features. GDB older than 7.0 is not able to handle
> either of these, so to debug GCC 4.5 generated binaries or libraries
> GDB 7.0 or later is needed. You can disable use of DWARF4 features
> with the -gdwarf-3 -gstrict-dwarf options, or use -gdwarf-2
> -gstrict-dwarf to restrict GCC to just DWARF2, but epilogue unwind
> info is emitted unconditionally whenever unwind info is emitted.
I was using 7.4.1, under Debian Wheezy, amd64. Tried the dwarf 2
options, but then I wasn't even able to step into the template function
from foo(): when hitting step on the function name, the next line was
the fn closing brace, in asm it jumped from preparing the reg args to
the leaveq after the call. When stepped inside the fn via si, the first
'next' attempt failed gdb saying that the fn contained no line number
info, and stopped at the outer leaveq as before.
With dwarf-3 and 4, the already reported buggy behaviour occured when
single stepping the function.
Regards, Peter
More information about the Gcc
mailing list