diff options
author | Tom Tromey <tom@tromey.com> | 2019-10-22 16:57:35 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-01-26 16:40:21 -0700 |
commit | 32caafd02b069c36908f41f53ae0cbca1911aaca (patch) | |
tree | 100fcb2c3ac32456eb3fdc8d452f0bf1766afd17 /gdb/psympriv.h | |
parent | abaa2f2340a400fd19aea2973f705fe813d620d4 (diff) | |
download | gdb-32caafd02b069c36908f41f53ae0cbca1911aaca.zip gdb-32caafd02b069c36908f41f53ae0cbca1911aaca.tar.gz gdb-32caafd02b069c36908f41f53ae0cbca1911aaca.tar.bz2 |
Change allocate_psymtab to be a constructor
This is the next step in getting the symbol readers to allocate
psymtabs themselves: change allocate_psymtab to be an ordinary
constructor, and then use "new" at the previous call sites. Note that
this doesn't get us all the way -- start_psymtab_common is still
allocating a partial symtab.
gdb/ChangeLog
2020-01-26 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_end_psymtab): Use new.
* psymtab.c (start_psymtab_common): Use new.
(partial_symtab::partial_symtab): Rename from allocate_psymtab.
Update.
* psympriv.h (struct partial_symtab): Add parameters to
constructor. Don't inline.
(allocate_psymtab): Don't declare.
* mdebugread.c (new_psymtab): Use new.
* dwarf2read.c (dwarf2_create_include_psymtab): Use new.
* dbxread.c (dbx_end_psymtab): Use new.
Change-Id: Iffeae64c925050b90b9916cbc36e15b26ff42226
Diffstat (limited to 'gdb/psympriv.h')
-rw-r--r-- | gdb/psympriv.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h index ce28112..74ff10e 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -104,12 +104,14 @@ enum psymtab_search_status struct partial_symtab { - partial_symtab () - : searched_flag (PST_NOT_SEARCHED), - text_low_valid (0), - text_high_valid (0) - { - } + /* Allocate a new partial symbol table associated with OBJFILE. + FILENAME (which must be non-NULL) is the filename of this partial + symbol table; it is copied into the appropriate storage. The + partial symtab will also be installed using + psymtab_storage::install. */ + + partial_symtab (const char *filename, struct objfile *objfile) + ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3); /* Return the raw low text address of this partial_symtab. */ CORE_ADDR raw_text_low () const @@ -329,16 +331,6 @@ extern struct partial_symtab *start_psymtab_common (struct objfile *, extern void end_psymtab_common (struct objfile *, struct partial_symtab *); -/* Allocate a new partial symbol table associated with OBJFILE. - FILENAME (which must be non-NULL) is the filename of this partial - symbol table; it is copied into the appropriate storage. A new - partial symbol table is returned; aside from "next" and "filename", - its fields are initialized to zero. */ - -extern struct partial_symtab *allocate_psymtab (const char *filename, - struct objfile *objfile) - ATTRIBUTE_NONNULL (1); - static inline void discard_psymtab (struct objfile *objfile, struct partial_symtab *pst) { |