http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47471

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 
2011-03-29 17:35:43 UTC ---
(In reply to comment #2)

The patch has regressions, even against: GNU C 4.6.1 20110329 (prerelease)      
One of many:
-PASS: gdb.base/break.exp: run until quoted breakpoint
+FAIL: gdb.base/break.exp: run until quoted breakpoint

0000000000400783 <marker2>:
int marker2 (a) int a; { return (1); }  /* set breakpoint 9 here */
  400783:       55                      push   %rbp
  400784:       48 89 e5                mov    %rsp,%rbp
  400787:       89 7d fc                mov    %edi,-0x4(%rbp)
  40078a:       b8 01 00 00 00          mov    $0x1,%eax
  40078f:       5d                      pop    %rbp
  400790:       c3                      retq

FSF GCC correctly sets the prologue line boundary:
-  Special opcode 104: advance Address by 7 to 0x400783 and Line by 1 to 47
-  Special opcode 103: advance Address by 7 to 0x40078a and Line by 0 to 47
-  Special opcode 104: advance Address by 7 to 0x400791 and Line by 1 to 48

but the patched FSF GCC does not:
+  Special opcode 160: advance Address by 11 to 0x400783 and Line by 1 to 47
+  Special opcode 202: advance Address by 14 to 0x400791 and Line by 1 to 48

GCC could also start emitting DW_LNS_set_prologue_end (GDB cannot parse it yet,
though) instead of these line number magics.  Unfortunately the prologue end is
still needed for GDB as during -O0 -g the VTA is not in effect and
    <50a>   DW_AT_location    : 2 byte block: 91 6c     (DW_OP_fbreg: -20)
is in such case invalid at the entry PC (0x400783).

Reply via email to