public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55541] New: unable to see local variables due extra lexical block was generated
@ 2012-11-30  2:55 chihin.ko at oracle dot com
  2012-11-30  9:05 ` [Bug debug/55541] " paolo.carlini at oracle dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: chihin.ko at oracle dot com @ 2012-11-30  2:55 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55541
           Summary: unable to see local variables due extra lexical block
                    was generated
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: chihin.ko@oracle.com


There is a regression present gcc4.4.4: the compiler 
generates a bogus lexical block marker in the debug info, more precisely 
between the parameters and the local variables of functions.  This is related 
to http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02111.html

This affect gdb/dbx behavior, that debugger users are not able to inspect local
variable value when stop at "}" line of a function, for detail, please refer to
gdb bugzilla

http://sourceware.org/bugzilla/show_bug.cgi?id=14850

for following test cast

int
main() {
    int i;
    i = 10;
}

if I stop at  } of main and print i, gdb gave error:
tarting program: /home/chko/core/g++/g45/a.out

Breakpoint 1, main () at t.cc:4
4           i = 10;
(gdb) p i
$1 = 0
(gdb) n
5       }
(gdb) p i
No symbol "i" in current context.
(gdb)

This is due to "i" was within DW_TAG_lexical_block:

< 1><0x00000025>    DW_TAG_subprogram
                      DW_AT_external              yes(1)
                      DW_AT_name                  "main"
                      DW_AT_decl_file             0x00000001 /tmp/t.cc
                      DW_AT_decl_line             0x00000003
                      DW_AT_type                  <0x00000059>
                      DW_AT_low_pc                0x08050990
                      DW_AT_high_pc               0x080509a4
                      DW_AT_frame_base            <loclist with 4 entries
follows>
                        [ 0]<lowpc=0x00000000><highpc=0x00000001>DW_OP_breg4+4
                        [ 1]<lowpc=0x00000001><highpc=0x00000003>DW_OP_breg4+8
                        [ 2]<lowpc=0x00000003><highpc=0x00000013>DW_OP_breg5+8
                        [ 3]<lowpc=0x00000013><highpc=0x00000014>DW_OP_breg4+4
                      DW_AT_GNU_all_call_sites    yes(1)
                      DW_AT_sibling               <0x00000059>
< 2><0x00000042>      DW_TAG_lexical_block
                        DW_AT_low_pc                0x08050996
                        DW_AT_high_pc               0x0805099d
< 3><0x0000004b>        DW_TAG_variable
                          DW_AT_name                  "i"
                          DW_AT_decl_file             0x00000001 /tmp/t.cc
                          DW_AT_decl_line             0x00000004
                          DW_AT_type                  <0x00000059>
                          DW_AT_location              DW_OP_fbreg -12
< 1><0x00000059>    DW_TAG_base_type
                      DW_AT_byte_size             0x00000004
                      DW_AT_encoding              DW_ATE_signed
                      DW_AT_name                  "int"


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

end of thread, other threads:[~2015-06-26 20:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30  2:55 [Bug c++/55541] New: unable to see local variables due extra lexical block was generated chihin.ko at oracle dot com
2012-11-30  9:05 ` [Bug debug/55541] " paolo.carlini at oracle dot com
2012-11-30  9:22 ` [Bug debug/55541] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
2012-11-30 10:35 ` jakub at gcc dot gnu.org
2012-11-30 13:04 ` jakub at gcc dot gnu.org
2012-11-30 19:15 ` jason at gcc dot gnu.org
2012-12-05 16:24 ` jason at gcc dot gnu.org
2012-12-06 15:07 ` jakub at gcc dot gnu.org
2012-12-06 16:18 ` rguenth at gcc dot gnu.org
2013-04-12 15:15 ` [Bug debug/55541] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
2014-06-12 13:42 ` [Bug debug/55541] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:35 ` [Bug debug/55541] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-02-05 14:52 ` jakub at gcc dot gnu.org
2015-02-05 16:26 ` jakub at gcc dot gnu.org
2015-02-05 17:56 ` jakub at gcc dot gnu.org
2015-02-12 18:27 ` [Bug debug/55541] [4.8/4.9 " jakub at gcc dot gnu.org
2015-06-23  8:16 ` rguenth at gcc dot gnu.org
2015-06-26 20:04 ` [Bug debug/55541] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:34 ` jakub at gcc dot gnu.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).