From 12aaed36e3f39b4dadf6bc8f74d254d4d8a3909f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 25 Jan 2013 17:36:01 +0000 Subject: * 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) : Now const. * dwarf2read.c (read_import_statement): Use obconcat. Don't copy names passed to cp_add_using_directive. --- gdb/dwarf2read.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'gdb/dwarf2read.c') 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); } } -- cgit v1.1