This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: DW_TAG_imported_declaration DW_TAG_base_type w/o DW_AT_name [Re:using directive patch]
- From: Sami Wagiaalla <swagiaal at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, Project Archer <archer at sourceware dot org>, Dodji Seketeli <dseketel at redhat dot com>
- Date: Wed, 17 Jun 2009 11:01:23 -0400
- Subject: Re: DW_TAG_imported_declaration DW_TAG_base_type w/o DW_AT_name [Re:using directive patch]
- References: <48BED230.1070209@redhat.com> <20080907183612.GA7304@host0.dyn.jankratochvil.net> <20080918211335.GA24936@host0.dyn.jankratochvil.net> <4A37B667.10307@redhat.com> <m34oug2gen.fsf@fleche.redhat.com> <48BED230.1070209@redhat.com> <20080907183612.GA7304@host0.dyn.jankratochvil.net> <20080918211335.GA24936@host0.dyn.jankratochvil.net> <4A37B667.10307@redhat.com> <20090616203743.GA12904@host0.dyn.jankratochvil.net>
Results in:
die = <8c>
imported_die = <3b>
imported_name = "B"
so the import gets processed, doesn't it?
Yes agreed... bad code example.
Do you have a reproducer of incorrect GDB behavior?
Yes. Upon further digging I found the gcc bug.
Here is a much better example:
namespace A{
typedef int B;
}
int main(){
using A::B;
B b;
return b;
}
...
<2><51>: Abbrev Number: 3 (DW_TAG_imported_declaration)
<52> DW_AT_decl_file : 1
<53> DW_AT_decl_line : 6
<54> DW_AT_import : <0x75>
<2><58>: Abbrev Number: 4 (DW_TAG_typedef)
<59> DW_AT_name : B
<5b> DW_AT_decl_file : 1
<5c> DW_AT_decl_line : 2
<5d> DW_AT_type : <0x6e>
...
<1><75>: Abbrev Number: 7 (DW_TAG_base_type)
<76> DW_AT_byte_size : 4
<77> DW_AT_encoding : 5 (signed)
Import from line 6 is not importing 0x75 as gcc reports. It is importing
0x58. In which case the imported_name would be B.
Will open a gcc bug :)
Sami