From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16926 invoked by alias); 19 Nov 2012 22:47:49 -0000 Received: (qmail 16850 invoked by uid 48); 19 Nov 2012 22:47:47 -0000 From: "chihinko at yahoo dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/14850] unable to print local variable when stopped at function closing brace '}' Date: Mon, 19 Nov 2012 22:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chihinko at yahoo dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2012-q4/txt/msg00284.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14850 chihinko at yahoo dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | Ever Confirmed|1 |0 --- Comment #2 from chihinko at yahoo dot com 2012-11-19 22:47:44 UTC --- (In reply to comment #1) > I think this is not a gdb bug -- it is just doing what the > compiler tells it to. > > First, dump the line table: > > barimba. readelf --debug-dump=decodedline ./pr > Decoded dump of debug contents of section .debug_line: > > CU: pr.cc: > File name Line number Starting address > pr.cc 2 0x4004d4 > pr.cc 4 0x4004d8 > pr.cc 5 0x4004e4 > > > line 5 == 0x4004e4 > > > Now look at the DWARF: > > barimba. readelf -wi ./pr > Contents of the .debug_info section: > [...] > <1><2d>: Abbrev Number: 2 (DW_TAG_subprogram) > <2e> DW_AT_external : 1 > <2e> DW_AT_name : (indirect string, offset: 0x67): main > <32> DW_AT_decl_file : 1 > <33> DW_AT_decl_line : 2 > <34> DW_AT_type : <0x6d> > <38> DW_AT_low_pc : 0x4004d4 > <40> DW_AT_high_pc : 0x4004e6 > <48> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) > <4a> DW_AT_GNU_all_call_sites: 1 > <4a> DW_AT_sibling : <0x6d> > <2><4e>: Abbrev Number: 3 (DW_TAG_lexical_block) > <4f> DW_AT_low_pc : 0x4004d8 > <57> DW_AT_high_pc : 0x4004df > <3><5f>: Abbrev Number: 4 (DW_TAG_variable) > <60> DW_AT_name : i > <62> DW_AT_decl_file : 1 > > This says that 'i' is defined in the inner lexical block which > stops at 0x4004df -- it isn't defined at 0x4004e4. But from user's point of view, this is a tool issue, debugging is not working, although the cause is compiler, compiler shouldn't generate this extra W_TAG_lexical_block that prevent user to see value of local variables, you should file an IZ against gcc. Older compiler/gdb worked regarding this functionality. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.