aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-01-21 18:10:33 +0000
committerTom Tromey <tromey@redhat.com>2013-01-21 18:10:33 +0000
commit86f62fd71f25a7f64ff0f7747df29c3488269116 (patch)
tree706ad975a39e26b6d56a7395b5f17650a0debb5f /gdb/dwarf2read.c
parent15d034d05c30a3d27eeeadfa8aba045cb772bbf6 (diff)
downloadgdb-86f62fd71f25a7f64ff0f7747df29c3488269116.zip
gdb-86f62fd71f25a7f64ff0f7747df29c3488269116.tar.gz
gdb-86f62fd71f25a7f64ff0f7747df29c3488269116.tar.bz2
* dwarf2read.c (fixup_go_packaging): Save package name
on objfile obstack. * gdbtypes.c (init_type): Don't copy name.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 81d3cf9..76d469c 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6803,15 +6803,19 @@ fixup_go_packaging (struct dwarf2_cu *cu)
if (package_name != NULL)
{
struct objfile *objfile = cu->objfile;
+ const char *saved_package_name = obsavestring (package_name,
+ strlen (package_name),
+ &objfile->objfile_obstack);
struct type *type = init_type (TYPE_CODE_MODULE, 0, 0,
- package_name, objfile);
+ saved_package_name, objfile);
struct symbol *sym;
TYPE_TAG_NAME (type) = TYPE_NAME (type);
sym = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symbol);
SYMBOL_SET_LANGUAGE (sym, language_go);
- SYMBOL_SET_NAMES (sym, package_name, strlen (package_name), 1, objfile);
+ SYMBOL_SET_NAMES (sym, saved_package_name,
+ strlen (saved_package_name), 0, objfile);
/* This is not VAR_DOMAIN because we want a way to ensure a lookup of,
e.g., "main" finds the "main" module and not C's main(). */
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;