aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-10 16:23:54 -0600
committerTom Tromey <tom@tromey.com>2019-01-10 07:08:14 -0700
commit5af70966484d6b26fa7824c0cda110140cd4959b (patch)
tree894f2d09747dc0ece87a8c9006cc75e0380ce814
parent5923a04c0c489054d275e3b0441626ce1ae7344a (diff)
downloadgdb-5af70966484d6b26fa7824c0cda110140cd4959b.zip
gdb-5af70966484d6b26fa7824c0cda110140cd4959b.tar.gz
gdb-5af70966484d6b26fa7824c0cda110140cd4959b.tar.bz2
Move more allocations to psymtab obstack
This moves a couple more psymtab-related allocations to the psymtab obstack. gdb/ChangeLog 2019-01-10 Tom Tromey <tom@tromey.com> * psymtab.c (add_psymbol_to_bcache): Pass psymtab obstack to PSYMBOL_SET_LANGUAGE. (allocate_psymtab): Allocate psymtab on the psymtab obstack.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/psymtab.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 81f07f7..84797bb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2019-01-10 Tom Tromey <tom@tromey.com>
+ * psymtab.c (add_psymbol_to_bcache): Pass psymtab obstack to
+ PSYMBOL_SET_LANGUAGE.
+ (allocate_psymtab): Allocate psymtab on the psymtab obstack.
+
+2019-01-10 Tom Tromey <tom@tromey.com>
+
* psymtab.h (psymtab_storage::obstack): New method.
<m_obstack>: Rename from obstack; now private.
* psymtab.c (psymtab_storage): Update.
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index e185441..4119e83 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1637,7 +1637,8 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
memset (&psymbol.language_specific, 0, sizeof (psymbol.language_specific));
psymbol.ada_mangled = 0;
- symbol_set_language (&psymbol, language, &objfile->objfile_obstack);
+ symbol_set_language (&psymbol, language,
+ objfile->partial_symtabs->obstack ());
symbol_set_names (&psymbol, name, namelength, copy_name, objfile->per_bfd);
/* Stash the partial symbol away in the cache. */
@@ -1722,7 +1723,7 @@ allocate_psymtab (const char *filename, struct objfile *objfile)
objfile->partial_symtabs->free_psymtabs = psymtab->next;
}
else
- psymtab = XOBNEW (&objfile->objfile_obstack, partial_symtab);
+ psymtab = XOBNEW (objfile->partial_symtabs->obstack (), partial_symtab);
memset (psymtab, 0, sizeof (struct partial_symtab));
psymtab->filename