Hide Forgot
Description of problem: Stock g++ and gdb from RHEL 7. The example program from the upstream bug report linked below demonstrates the issue succinctly. The local "x" variable is not visible in any of the stack frames from within gdb. Version-Release number of selected component (if applicable): gcc-c++-4.8.5-4.el7.x86_64 gdb-7.6.1-80.el7.x86_64 How reproducible: 100 % Steps to Reproduce: 1. See https://sourceware.org/bugzilla/show_bug.cgi?id=15231 for reproducer Additional info: upstream bug https://sourceware.org/bugzilla/show_bug.cgi?id=15231
PASS: gcc-6.0.0-0.20.fc24.x86_64 FAIL: gcc-5.3.1-6.fc23.x86_64 Tested with gdb-7.10.1-31.fc23.x86_64 and even more recent GDBs. gcc-5.3.1 did generate dummy DW_TAG_lexical_block: <2><92>: Abbrev Number: 11 (DW_TAG_lexical_block) <3><93>: Abbrev Number: 12 (DW_TAG_variable) GDB stops at that die <92> and it does not inherit DIE <93>. read_lexical_block_scope() /* Ignore blocks with missing or invalid low and high pc attributes. */ [...] if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL)) return; GDB probably could just ignore empty DW_TAG_lexical_block and just recursively process its DIEs. Asking GCC whether it should be fixed on GCC or GDB side. More info in the upstream GDB PR.
This changed with http://gcc.gnu.org/r224161, which is not backportable.
OK, thanks for the evaluation. Therefore going to make GDB interpreting bare DW_TAG_lexical_block's children as if there was no DW_TAG_lexical_block there.
[patch] PR 15231: import bare DW_TAG_lexical_block https://sourceware.org/ml/gdb-patches/2016-05/msg00236.html
QA: New testfile: gdb.dwarf2/dw2-lexical-block-bare.exp
QA: additionally it does: XFAIL->PASS: gdb.ada/out_of_line_in_inlined.exp (as it would XFAIL->XPASS without removing that setup_xfail by this patch)
I do not see why this Bug should be private for RH employees only.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2328.html