| Summary: | gdb cannot debug local variables inside c++ lambdas | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jacob Hunt <jhunt> | |
| Component: | gdb | Assignee: | Jan Kratochvil <jan.kratochvil> | |
| Status: | CLOSED ERRATA | QA Contact: | Martin Cermak <mcermak> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 7.2 | CC: | gdb-bugs, jan.kratochvil, mcermak, ohudlick, sergiodj | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | gdb-7.6.1-92.el7 | Doc Type: | Bug Fix | |
| Doc Text: |
Cause:
With a code produced by RHEL-7.3 GCC being debugged by GDB the debugger does not see local variables in C++ lambda functions. This happens even for code compiled without optimizations (gcc -O0 -g).
Consequence:
User cannot display content of such variables.
Fix:
GDB now properly recognizes debug information (DWARF (debugging data format) DIE (Debug Information Entry) DW_TAG_lexical_block with no attributes) as produced by RHEL-7.3 GCC.
Result:
User can now display (or even modify) local variables in C++ lambda functions.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1357079 (view as bug list) | Environment: | ||
| Last Closed: | 2016-11-04 03:50:54 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 1357079 | |||
|
Description
Jacob Hunt
2016-04-08 17:12:25 UTC
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 |