[Bug debug/86687] Wrong debug information for string types passed as parameters
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 30 07:09:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86687
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #5)
> 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
> ...
I think this is the issue - why do we have a mismatch between the origins
decl_by_reference_p and decls decl_by_reference_p? Is that the in-charge
vs. not-in-charge constructor clones the C++ FE generates?
I think we shouldn't have abstract origins pointing to different
calling-convention things.
More information about the Gcc-bugs
mailing list