aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-01-25 17:36:01 +0000
committerTom Tromey <tromey@redhat.com>2013-01-25 17:36:01 +0000
commit12aaed36e3f39b4dadf6bc8f74d254d4d8a3909f (patch)
treef61366b0050baf69e9284321710e3d1725e1a713 /gdb/dwarf2read.c
parent7fc75ca750afe059352f475d7511330506e835ef (diff)
downloadgdb-12aaed36e3f39b4dadf6bc8f74d254d4d8a3909f.zip
gdb-12aaed36e3f39b4dadf6bc8f74d254d4d8a3909f.tar.gz
gdb-12aaed36e3f39b4dadf6bc8f74d254d4d8a3909f.tar.bz2
* cp-namespace.c (cp_scan_for_anonymous_namespaces): Update.
(cp_add_using_directive): Add 'copy_names' argument. * cp-support.h (cp_add_using_directive): Update. (struct using_direct) <import_src, import_dest, alias, declaration>: Now const. * dwarf2read.c (read_import_statement): Use obconcat. Don't copy names passed to cp_add_using_directive.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8ac062a..6395eca 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7713,8 +7713,6 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
VEC (const_char_ptr) *excludes = NULL;
struct cleanup *cleanups;
- char *temp;
-
import_attr = dwarf2_attr (die, DW_AT_import, cu);
if (import_attr == NULL)
{
@@ -7780,14 +7778,9 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
canonical_name = imported_name_prefix;
}
else if (strlen (imported_name_prefix) > 0)
- {
- temp = alloca (strlen (imported_name_prefix)
- + 2 + strlen (imported_name) + 1);
- strcpy (temp, imported_name_prefix);
- strcat (temp, "::");
- strcat (temp, imported_name);
- canonical_name = temp;
- }
+ canonical_name = obconcat (&objfile->objfile_obstack,
+ imported_name_prefix, "::", imported_name,
+ (char *) NULL);
else
canonical_name = imported_name;
@@ -7842,6 +7835,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
import_alias,
imported_declaration,
excludes,
+ 0,
&objfile->objfile_obstack);
do_cleanups (cleanups);
@@ -12108,7 +12102,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
const char *previous_prefix = determine_prefix (die, cu);
cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL,
- NULL, NULL, &objfile->objfile_obstack);
+ NULL, NULL, 0, &objfile->objfile_obstack);
}
}