[C++ PATCH] RFC: implement P0386R2 - C++17 inline variables

Yao Qi qiyaoltc@gmail.com
Fri Oct 21 14:57:00 GMT 2016


Hi Jakub,

On Thu, Oct 20, 2016 at 5:21 PM, Andre Vieira (lists)
<Andre.SimoesDiasVieira@arm.com> wrote:
>  <2><8f5>: Abbrev Number: 38 (DW_TAG_member)
>     <8f6>   DW_AT_specification: <0x8be>
>     <8fa>   DW_AT_linkage_name: (indirect string, offset: 0x4a0):
> _ZN6BANANA1sE
>     <8fe>   DW_AT_location    : 5 byte block: 3 64 bf 1 0
> (DW_OP_addr: 1bf64)
>
> I haven't tested it on other targets.

I can reproduce it on x86_64 as well.

 <1><328>: Abbrev Number: 20 (DW_TAG_class_type)
    <329>   DW_AT_name        : A
    <32b>   DW_AT_byte_size   : 24
    <32c>   DW_AT_decl_file   : 1
    <32d>   DW_AT_decl_line   : 23
    <32e>   DW_AT_containing_type: <0x328>
    <332>   DW_AT_sibling     : <0x458>

 <2><336>: Abbrev Number: 19 (DW_TAG_member)
    <337>   DW_AT_name        : s
    <339>   DW_AT_decl_file   : 1
    <33a>   DW_AT_decl_line   : 40
    <33b>   DW_AT_type        : <0x5e>
    <33f>   DW_AT_external    : 1
    <33f>   DW_AT_accessibility: 1      (public)
    <340>   DW_AT_declaration : 1
 <2><36d>: Abbrev Number: 23 (DW_TAG_member)
    <36e>   DW_AT_specification: <0x336>
    <372>   DW_AT_linkage_name: (indirect string, offset: 0x447): _ZN1A1sE
    <376>   DW_AT_location    : 9 byte block: 3 10 15 60 0 0 0 0 0
 (DW_OP_addr: 601510)

We have two DIEs for member 's'.  GDB adds both of them as two fields,
the first one as static member (because of DW_AT_declaration), and the
second one as a non-static member.  GDB doesn't understand the
relationship between these two DIEs by DW_AT_specification.

Is attribute DW_AT_specification applicable to DW_TAG_member?
This is not documented in DWARF5 Appendix A "Attribute by Tage Value",
Page 258.

-- 
Yao (齐尧)



More information about the Gcc-patches mailing list