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: Project Archer <archer at sourceware dot org>, Dodji Seketeli <dseketel at redhat dot com>
- Date: Tue, 16 Jun 2009 11:12:39 -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>
Jan Kratochvil wrote:
On Sun, 07 Sep 2008 20:36:12 +0200, Jan Kratochvil wrote:
+/* Read the import statement specified by the given die and record it. */
+
+static void
+read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
+{
...
+ import_attr = dwarf2_attr (die, DW_AT_import, cu);
...
+ imported_die = follow_die_ref (die, import_attr, &cu);
+ imported_name = dwarf2_name (imported_die, cu);
+ if (imported_name == NULL)
+ {
+ /* C++ imports from std:: DW_TAG_base_type with no DW_AT_name - why? */
+ return;
+ }
(2) DW_TAG_imported_declaration -> DW_TAG_base_type with no DW_AT_name:
<1><46>: Abbrev Number: 4 (DW_TAG_namespace)
<47> DW_AT_name : std
<2><51>: Abbrev Number: 5 (DW_TAG_imported_declaration)
<54> DW_AT_import : <0x50e> [Abbrev Number: 24 (DW_TAG_base_type)]
<1><50e>: Abbrev Number: 24 (DW_TAG_base_type)
<50f> DW_AT_byte_size : 8
<510> DW_AT_encoding : 5 (signed)
I do not see a meaning of such import - if it has no name. But this bug
may be already covered by PR debug/14168 or possibly by PR debug/14169.
Is this a bug though. This imports the type specified by 0x50e keeping its
name in the current context.
like here:
namespace A{
class B{
public:
int x;
};
}
int main(){
using A::B;
B b;
return 0;
}
...
<2><7b>: Abbrev Number: 8 (DW_TAG_imported_declaration)
<7c> DW_AT_decl_file : 1
<7d> DW_AT_decl_line : 9
<7e> DW_AT_import : <0x3b> [Abbrev Number: 4 (DW_TAG_class_type)]
...