diff options
author | Tom Tromey <tromey@redhat.com> | 2009-11-05 19:53:04 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-11-05 19:53:04 +0000 |
commit | 1c9e835890dbd86ed06acc2820fd80fc586a3e5d (patch) | |
tree | 99557f0fa749f2a3f8d15dbc315642254c6c50b7 | |
parent | ddbb8a31d5f6d13c91a416e13f6ad11ac6604102 (diff) | |
download | gdb-1c9e835890dbd86ed06acc2820fd80fc586a3e5d.zip gdb-1c9e835890dbd86ed06acc2820fd80fc586a3e5d.tar.gz gdb-1c9e835890dbd86ed06acc2820fd80fc586a3e5d.tar.bz2 |
* symtab.h (SYMBOL_SET_LINKAGE_NAME): Update comment.
* symfile.c (allocate_symtab): Don't use obsavestring on a
constant string.
* stabsread.c (define_symbol): Don't use obsavestring on a
constant string.
* mdebugread.c (parse_type): Don't use obsavestring on a constant
string.
(new_symtab): Likewise.
* elfread.c (elf_symtab_read): Don't use obsavestring on a
constant string.
-rw-r--r-- | gdb/ChangeLog | 13 | ||||
-rw-r--r-- | gdb/elfread.c | 5 | ||||
-rw-r--r-- | gdb/mdebugread.c | 9 | ||||
-rw-r--r-- | gdb/stabsread.c | 8 | ||||
-rw-r--r-- | gdb/symfile.c | 3 | ||||
-rw-r--r-- | gdb/symtab.h | 3 |
6 files changed, 24 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ff7fa70..bc6f911 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2009-11-05 Tom Tromey <tromey@redhat.com> + + * symtab.h (SYMBOL_SET_LINKAGE_NAME): Update comment. + * symfile.c (allocate_symtab): Don't use obsavestring on a + constant string. + * stabsread.c (define_symbol): Don't use obsavestring on a + constant string. + * mdebugread.c (parse_type): Don't use obsavestring on a constant + string. + (new_symtab): Likewise. + * elfread.c (elf_symtab_read): Don't use obsavestring on a + constant string. + 2009-11-04 Tom Tromey <tromey@redhat.com> * symfile.c (add_psymbol_to_bcache): Don't copy name. Make diff --git a/gdb/elfread.c b/gdb/elfread.c index 131d7d2..29b7c0c 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -231,8 +231,9 @@ elf_symtab_read (struct objfile *objfile, int type, /* If filesym is nonzero, it points to a file symbol, but we haven't seen any section info for it yet. */ asymbol *filesym = 0; - /* Name of filesym, as saved on the objfile_obstack. */ - char *filesymname = obsavestring ("", 0, &objfile->objfile_obstack); + /* Name of filesym. This is either a constant string or is saved on + the objfile's obstack. */ + char *filesymname = ""; struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info; int stripped = (bfd_get_symcount (objfile->obfd) == 0); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index aac82e9..7d29b97 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1746,12 +1746,10 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, TYPE_NFIELDS (tp) = 2; TYPE_FIELDS (tp) = ((struct field *) TYPE_ALLOC (tp, 2 * sizeof (struct field))); - TYPE_FIELD_NAME (tp, 0) = obsavestring ("Low", strlen ("Low"), - ¤t_objfile->objfile_obstack); + TYPE_FIELD_NAME (tp, 0) = "Low"; TYPE_LOW_BOUND (tp) = AUX_GET_DNLOW (bigend, ax); ax++; - TYPE_FIELD_NAME (tp, 1) = obsavestring ("High", strlen ("High"), - ¤t_objfile->objfile_obstack); + TYPE_FIELD_NAME (tp, 1) = "High"; TYPE_HIGH_BOUND (tp) = AUX_GET_DNHIGH (bigend, ax); ax++; } @@ -4680,8 +4678,7 @@ new_symtab (char *name, int maxlines, struct objfile *objfile) BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); s->free_code = free_linetable; - s->debugformat = obsavestring ("ECOFF", 5, - &objfile->objfile_obstack); + s->debugformat = "ECOFF"; return (s); } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index e62bb15..274fe1a 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -673,18 +673,14 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, switch (string[1]) { case 't': - SYMBOL_SET_LINKAGE_NAME - (sym, obsavestring ("this", strlen ("this"), - &objfile->objfile_obstack)); + SYMBOL_SET_LINKAGE_NAME (sym, "this"); break; case 'v': /* $vtbl_ptr_type */ goto normal; case 'e': - SYMBOL_SET_LINKAGE_NAME - (sym, obsavestring ("eh_throw", strlen ("eh_throw"), - &objfile->objfile_obstack)); + SYMBOL_SET_LINKAGE_NAME (sym, "eh_throw"); break; case '_': diff --git a/gdb/symfile.c b/gdb/symfile.c index c55cb03..7461ed6 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2750,8 +2750,7 @@ allocate_symtab (char *filename, struct objfile *objfile) &objfile->objfile_obstack); symtab->fullname = NULL; symtab->language = deduce_language_from_filename (filename); - symtab->debugformat = obsavestring ("unknown", 7, - &objfile->objfile_obstack); + symtab->debugformat = "unknown"; /* Hook it to the objfile it comes from */ diff --git a/gdb/symtab.h b/gdb/symtab.h index acb8510..2bc3dd5 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -185,7 +185,8 @@ extern void symbol_init_language_specific (struct general_symbol_info *symbol, /* Set just the linkage name of a symbol; do not try to demangle it. Used for constructs which do not have a mangled name, e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must - be terminated and already on the objfile's obstack. */ + be terminated and either already on the objfile's obstack or + permanently allocated. */ #define SYMBOL_SET_LINKAGE_NAME(symbol,linkage_name) \ (symbol)->ginfo.name = (linkage_name) |