This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15231] Local variables in lambdas are not accessible


https://sourceware.org/bugzilla/show_bug.cgi?id=15231

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Kratochvil <jkratoch@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e385593eef98ac92be57159e141f4b805dadbbb3

commit e385593eef98ac92be57159e141f4b805dadbbb3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon May 30 14:14:43 2016 +0200

    PR 15231: import bare DW_TAG_lexical_block

    Local variables in lambdas are not accessible
    https://sourceware.org/bugzilla/show_bug.cgi?id=15231

    GDB: 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;

    But sometimes there is:

    FAIL: gcc-5.3.1-6.fc23.x86_64
     <2><92>: Abbrev Number: 11 (DW_TAG_lexical_block)
     <3><9c>: Abbrev Number: 13 (DW_TAG_structure_type)
        <9d>   DW_AT_name        : (indirect string, offset: 0x3c): <lambda()>
        [...]

    Where DW_TAG_lexical_block has no attributes.  Such whole subtree is
currently
    dropped by GDB while I think it should just import all its children DIEs.

    It even XFAIL->XPASSes gdb.ada/out_of_line_in_inlined.exp:
        commit 0fa7fe506c242b459c4c05d331e7c7d66fb52390
        Author: Joel Brobecker <brobecker@adacore.com>
            out of line functions nested inside inline functions.
    So I have removed that xfail.

    gdb/ChangeLog
    2016-05-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

        PR c++/15231
        * dwarf2read.c (enum pc_bounds_kind): Add PC_BOUNDS_INVALID.
        (process_psymtab_comp_unit_reader, read_func_scope): Adjust callers.
        (read_lexical_block_scope): Import DIEs from bare DW_TAG_lexical_block.
        (read_call_site_scope): Adjust callers.
        (dwarf2_get_pc_bounds): Implement pc_bounds_invalid.
        (dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.

    gdb/testsuite/ChangeLog
    2016-05-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

        PR c++/15231
        * gdb.ada/out_of_line_in_inlined.exp: Remove xfails.
        * gdb.dwarf2/dw2-lexical-block-bare.exp: New file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]