https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15369
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |msebor at gcc dot gnu.org Known to work| |5.3.0, 6.0 Resolution|--- |FIXED --- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> --- This problem seems to have cleared up. GDB prints the correct file name and line number, and I don't see any obvious problems in the line number program emitted by GCC. I'm resolving this as fixed. Please reopen it if I missed something and the problem still persists in some form. $ g++ -g tx_linenumber.cxx && gdb -batch -q -ex 'b tx_linenumber.cxx:10' -ex 'r' a.out Breakpoint 1 at 0x40079a: file tx_linenumber.cxx, line 10. Breakpoint 1, test::break_point (this=0x7fffffffde50) at tx_linenumber.cxx:10 10 void break_point() { int b=_b; } $ readelf -wl a.out | grep 'Set File Name' [0x000002fc] Set File Name to entry 2 in the File Name Table [0x00000302] Set File Name to entry 1 in the File Name Table and $ readelf -wl a.out | sed -n '/ The File Name Table/,/^ 2[[:blank:]]/p' The File Name Table (offset 0x193): Entry Dir Time Size Name 1 0 0 0 tx_linenumber.cxx 2 1 0 0 iostream