This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 12/15] Move more allocations to psymtab obstack
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Thu, 10 May 2018 16:23:54 -0600
- Subject: [RFA 12/15] Move more allocations to psymtab obstack
- References: <20180510222357.27332-1-tom@tromey.com>
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