This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/14850] unable to print local variable when stopped atfunction closing brace '}'
- From: "chihinko at yahoo dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 19 Nov 2012 22:47:44 +0000
- Subject: [Bug c++/14850] unable to print local variable when stopped atfunction closing brace '}'
- Auto-submitted: auto-generated
- References: <bug-14850-4717@http.sourceware.org/bugzilla/>
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.