diff options
author | 2018-05-10 16:23:55 -0600 | |
---|---|---|
committer | 2019-01-10 07:08:14 -0700 | |
commit | a9342b62885d5119593fa4330924e031e14c6406 (patch) | |
tree | c118820ae9c1187d770d85c1a44fca80dcccb60a /gdb/psymtab.h | |
parent | Move more allocations to psymtab obstack (diff) | |
download | binutils-gdb-a9342b62885d5119593fa4330924e031e14c6406.tar.gz binutils-gdb-a9342b62885d5119593fa4330924e031e14c6406.tar.bz2 binutils-gdb-a9342b62885d5119593fa4330924e031e14c6406.zip |
Add psymtab_storage::allocate_dependencies
This adds a new method to psymtab_storage to allocate storage for
psymtab dependencies, then changes the symbol readers to use it. This
has the effect of moving the storage to the psymtab storage obstack.
gdb/ChangeLog
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_end_psymtab): Use allocate_dependencies.
* psymtab.h (psymtab_storage::allocate_dependencies): New method.
* mdebugread.c (parse_partial_symbols): Use
allocate_dependencies.
* dwarf2read.c (dwarf2_create_include_psymtab): Use
allocate_dependencies.
(process_psymtab_comp_unit_reader)
(build_type_psymtab_dependencies): Likewise.
* dbxread.c (dbx_end_psymtab): Use allocate_dependencies.
Diffstat (limited to 'gdb/psymtab.h')
-rw-r--r-- | gdb/psymtab.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/psymtab.h b/gdb/psymtab.h index d0e596980d1..57570e3d2f4 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -20,6 +20,7 @@ #ifndef PSYMTAB_H #define PSYMTAB_H +#include "gdb_obstack.h" #include "symfile.h" #include "common/next-iterator.h" @@ -62,6 +63,14 @@ public: return m_obstack; } + /* Allocate storage for the "dependencies" field of a psymtab. + NUMBER says how many dependencies there are. */ + + struct partial_symtab **allocate_dependencies (int number) + { + return OBSTACK_CALLOC (obstack (), number, struct partial_symtab *); + } + /* Each objfile points to a linked list of partial symtabs derived from this file, one partial symtab structure for each compilation unit |