aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-10-22 16:51:55 -0600
committerTom Tromey <tom@tromey.com>2020-01-26 16:40:21 -0700
commitabaa2f2340a400fd19aea2973f705fe813d620d4 (patch)
treef780f6ee634c37effc7a41a087e497387d6f8bf9 /gdb/psymtab.h
parent6d94535fc68e1fd06816c5685166ebcec56119ce (diff)
downloadgdb-abaa2f2340a400fd19aea2973f705fe813d620d4.zip
gdb-abaa2f2340a400fd19aea2973f705fe813d620d4.tar.gz
gdb-abaa2f2340a400fd19aea2973f705fe813d620d4.tar.bz2
Do not allocate psymtabs via psymtab_storage
Currently, partial symbol tables are allocated by a method in psymtab_storage. However, eventually we want to subclass partial symtabs in the symbol readers, so the calls to "new" will have to happen there. This patch is a first step, moving the allocation from psymtab_storage and into allocate_psymtab. gdb/ChangeLog 2020-01-26 Tom Tromey <tom@tromey.com> * psymtab.h (class psymtab_storage) <install_psymtab>: Rename from allocate_psymtab. Update documentation. * psymtab.c (psymtab_storage::install_psymtab): Rename from allocate_psymtab. Do not use new. (allocate_psymtab): Use new. Update. Change-Id: Iba6a9bf3ee1e78062fdb9f007c3010f826f64bc8
Diffstat (limited to 'gdb/psymtab.h')
-rw-r--r--gdb/psymtab.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index c0f0a97..d665474 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -83,11 +83,10 @@ public:
return OBSTACK_CALLOC (obstack (), number, struct partial_symtab *);
}
- /* Allocate a new psymtab on the psymtab obstack. The new psymtab
- will be linked in to the "psymtabs" list, but otherwise all other
- fields will be zero. */
+ /* Install a psymtab on the psymtab list. This transfers ownership
+ of PST to this object. */
- struct partial_symtab *allocate_psymtab ();
+ void install_psymtab (partial_symtab *pst);
typedef next_adapter<struct partial_symtab> partial_symtab_range;