[RFA 12/15] Move more allocations to psymtab obstack

Tom Tromey
2018-05-10T22:45:37Z

This moves a couple more psymtab-related allocations to the psymtab
obstack.

2018-05-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.
---
gdb/ChangeLog | 6 ++++++
gdb/psymtab.c | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index a7bec436e0..d121eace54 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1695,7 +1695,8 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name,

SET_PSYMBOL_VALUE_ADDRESS (&psymbol, coreaddr);
PSYMBOL_SECTION (&psymbol) = section;
- PSYMBOL_SET_LANGUAGE (&psymbol, language, &objfile->objfile_obstack);
+ PSYMBOL_SET_LANGUAGE (&psymbol, language,
+ objfile->partial_symtabs->obstack ());
PSYMBOL_DOMAIN (&psymbol) = domain;
PSYMBOL_CLASS (&psymbol) = theclass;

@@ -1783,7 +1784,7 @@ allocate_psymtab (const char *filename, struct objfile *objfile)
}
else
psymtab = (struct partial_symtab *)
- obstack_alloc (&objfile->objfile_obstack,
+ obstack_alloc (objfile->partial_symtabs->obstack (),
sizeof (struct partial_symtab));

memset (psymtab, 0, sizeof (struct partial_symtab));
--
2.13.6