aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorSami Wagiaalla <swagiaal@redhat.com>2010-02-05 19:03:42 +0000
committerSami Wagiaalla <swagiaal@redhat.com>2010-02-05 19:03:42 +0000
commit82856980164673e7d71180ff67f14d96190b2b3c (patch)
tree5ad5cd6466108a37cc206930dd6b35dd657cc15a /gdb/dwarf2read.c
parent1beeb6866d4f102b1a205391056e7ba4aa59fdd8 (diff)
downloadgdb-82856980164673e7d71180ff67f14d96190b2b3c.zip
gdb-82856980164673e7d71180ff67f14d96190b2b3c.tar.gz
gdb-82856980164673e7d71180ff67f14d96190b2b3c.tar.bz2
2010-02-05 Sami Wagiaalla <swagiaal@redhat.com>
PR c++/7935: * gdb.cp/namespace-using.exp: Removed kfail; bug has been fixed. 2010-02-05 Sami Wagiaalla <swagiaal@redhat.com> PR c++/7935: * cp-support.h: Added char* alias element to using_direct data struct. (cp_add_using): Added char* alias argument. (cp_add_using_directive): Ditto. * cp-namespace.c: Updated with the above changes. (cp_lookup_symbol_imports): Check for aliases. * dwarf2read.c (read_import_statement): Figure out local alias for the import and pass it on to cp_add_using. (read_namespace): Pass alias argument to cp_add_using.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0dc1b11..43017a4 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3385,6 +3385,8 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
struct dwarf2_cu *imported_cu;
const char *imported_name;
const char *imported_name_prefix;
+ char *import_alias;
+
const char *import_prefix;
char *canonical_name;
@@ -3436,7 +3438,8 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
return;
}
- /* FIXME: dwarf2_name (die); for the local name after import. */
+ /* Figure out the local name after import. */
+ import_alias = dwarf2_name (die, cu);
/* Figure out where the statement is being imported to. */
import_prefix = determine_prefix (die, cu);
@@ -3447,7 +3450,8 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
if (strlen (imported_name_prefix) > 0)
{
- canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1);
+ canonical_name = alloca (strlen (imported_name_prefix)
+ + 2 + strlen (imported_name) + 1);
strcpy (canonical_name, imported_name_prefix);
strcat (canonical_name, "::");
strcat (canonical_name, imported_name);
@@ -3458,7 +3462,10 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
strcpy (canonical_name, imported_name);
}
- using_directives = cp_add_using (import_prefix,canonical_name, using_directives);
+ using_directives = cp_add_using (import_prefix,
+ canonical_name,
+ import_alias,
+ using_directives);
}
static void
@@ -5617,7 +5624,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
if (is_anonymous)
{
const char *previous_prefix = determine_prefix (die, cu);
- cp_add_using_directive (previous_prefix, TYPE_NAME (type));
+ cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL);
}
}