public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/14049] New: [regression tree-ssa] bad debug block info, dwarf-2, c++
@ 2004-02-06 16:39 mec dot gnu at mindspring dot com
  2004-02-06 16:53 ` [Bug debug/14049] " mec dot gnu at mindspring dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: mec dot gnu at mindspring dot com @ 2004-02-06 16:39 UTC (permalink / raw)
  To: gcc-bugs

Here is a small C++ function.

  int foobar (int x_1)
  {
    static int i_1;
    char c_1;

    marker1 ();
    c_1 = x_1;
    i_1++;

    return 0;
  }

I compile with gcc -S -gdwarf-2.

With gcc HEAD2 2004-02-01 15:37:18 UTC, the block info is fine:

  .LBB2:
  .LBB3:
    .loc 1 10 0
    call _Z7marker1v
    .loc 1 11 0
    movl 8(%ebp), %eax
    movb %al, -1(%ebp)
    .loc 1 12 0
    incl _ZZ6foobariE3i_1
    .loc 1 14 0
     movl $0, %eax
  .LBE3:
  .LBE2:
    .loc 1 15 0
    leave
    ret

With gcc tree-ssa-200206190-branch 2004-02-05 12:45:13 UTC, the call to marker1
is outside the block for the function:

    .loc 1 10 0
    call _Z7marker1v
  .LBB2:
  .LBB3:
    .loc 1 11 0
    movl 8(%ebp), %eax
    movb %al, -1(%ebp)
    .loc 1 12 0
    movl __ZZ6foobariE3i_1, %eax
    incl %eax
    movl %eax, __ZZ6foobariE3i_1
    .loc 1 14 0
    movl $0, %eax
  .LBE3:
  .LBE2:
    .loc 1 15 0
    leave
    ret

Later on, gcc emits a DW_TAG_lexical_block for LBB3/LBE3.  With gcc
tree-ssa-branch, this does not cover the call to marker1.  Here is what "readelf
-w" says:

  # gcc HEAD
  DW_TAG_subprogram foobar
  DW_TAG_formal_parameter x_1
  DW_TAG_lexical_block 0x8048340 0x8048356
  DW_TAG_variable i_1
  DW_TAG_variable c_1

  # gcc tree-ssa
  DW_TAG_subprogram foobar
  DW_TAG_formal_paramater x_1
  DW_TAG_lexical_block 0x8048345 0x804835b
  DW_TAG_variable i_1
  DW_TAG_variable c_1

So the local variables i_1 and c_1 are inside the lexical block, and the lexical
block does not cover the first statement of foobar.

So if I do this:

  (gdb) break foobar
  (gdb) run
  (gdb) info locals

Or this:

  (gdb) break marker1
  (gdb) run
  (gdb) up
  (gdb) info locals

... then gdb cannot find the locals.

-- 
           Summary: [regression tree-ssa] bad debug block info, dwarf-2, c++
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mec dot gnu at mindspring dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2004-08-28  0:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-06 16:39 [Bug debug/14049] New: [regression tree-ssa] bad debug block info, dwarf-2, c++ mec dot gnu at mindspring dot com
2004-02-06 16:53 ` [Bug debug/14049] " mec dot gnu at mindspring dot com
2004-02-06 16:53 ` mec dot gnu at mindspring dot com
2004-02-06 16:53 ` mec dot gnu at mindspring dot com
2004-02-06 17:08 ` pinskia at gcc dot gnu dot org
2004-02-06 17:49 ` mec dot gnu at mindspring dot com
2004-02-06 17:50 ` mec dot gnu at mindspring dot com
2004-02-06 17:50 ` mec dot gnu at mindspring dot com
2004-04-18 13:46 ` pinskia at gcc dot gnu dot org
2004-04-18 13:53 ` pinskia at gcc dot gnu dot org
2004-04-18 13:58 ` pinskia at gcc dot gnu dot org
2004-04-18 14:06 ` pinskia at gcc dot gnu dot org
2004-04-18 14:08 ` pinskia at gcc dot gnu dot org
2004-07-14  4:55 ` [Bug tree-optimization/14049] [3.5 regression] " mec dot gnu at mindspring dot com
2004-07-14  4:59 ` pinskia at gcc dot gnu dot org
2004-07-14  5:14 ` mec dot gnu at mindspring dot com
2004-08-27 14:48 ` [Bug middle-end/14049] " giovannibajo at libero dot it
2004-08-28  0:20 ` mec dot gnu at mindspring dot com
2004-08-28  0:23 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).