[Bug debug/86687] Wrong debug information for string types passed as parameters
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 27 19:19:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86687
--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
The foo::foo function starts at label .LFB1520, which brings us to:
...
.uleb128 0x8b # (DIE (0x5a99) DW_TAG_subprogram)
.long 0x5a75 # DW_AT_abstract_origin
.long .LASF897 # DW_AT_linkage_name:
"foo::foo(std::__cxx11::basic_string<char, st\
d::char_traits<char>, std::allocator<char> >)"
...
with second parameter:
...
.uleb128 0x59 # (DIE (0x5ac5) DW_TAG_formal_parameter)
.long 0x5a8c # DW_AT_abstract_origin
.uleb128 0x2 # DW_AT_location
.byte 0x91 # DW_OP_fbreg
.sleb128 -32
...
The location expression is the generated for:
...
(gdb) call debug_generic_expr (decl)
dir_hint
(gdb) call debug_generic_expr (decl.typed.type)
struct string & restrict
(gdb) p decl_by_reference_p (decl)
$1 = false
...
In contrast, the abstract origin has:
...
(gdb) call debug_generic_expr (decl.decl_common.abstract_origin)
dir_hint
(gdb) call debug_generic_expr (decl.decl_common.abstract_origin.typed.type)
struct string & restrict
(gdb) p decl_by_reference_p (decl.decl_common.abstract_origin)
$3 = true
...
More information about the Gcc-bugs
mailing list