diff options
author | Tom Tromey <tom@tromey.com> | 2019-10-22 17:08:16 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-01-26 16:40:21 -0700 |
commit | c3693a1d9466bc9d3abe004e66f1b56fed22ba61 (patch) | |
tree | 8e9f5a9fda035595e06d889abd595b4e173af616 /gdb/psymtab.c | |
parent | 32caafd02b069c36908f41f53ae0cbca1911aaca (diff) | |
download | gdb-c3693a1d9466bc9d3abe004e66f1b56fed22ba61.zip gdb-c3693a1d9466bc9d3abe004e66f1b56fed22ba61.tar.gz gdb-c3693a1d9466bc9d3abe004e66f1b56fed22ba61.tar.bz2 |
Turn start_psymtab_common into a constructor
This turns start_psymtab_common into a constructor, and then changes
the callers to use "new" directly. This completes the psymtab
allocation transition -- now it is possible for symbol readers to
subclass struct partial_symtab.
gdb/ChangeLog
2020-01-26 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_start_psymtab): Use new.
* psymtab.c (partial_symtab::partial_symtab): New constructor,
renamed from start_psymtab_common.
* psympriv.h (struct partial_symtab): Add new constructor.
(start_psymtab_common): Don't declare.
* mdebugread.c (parse_partial_symbols): Use new.
* dwarf2read.c (create_partial_symtab): Use new.
* dbxread.c (start_psymtab): Use new.
* ctfread.c (create_partial_symtab): Use new.
Change-Id: I5a0217bcb52bcfa442559771954bb66bd9ccbf02
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 844e718..b31461c 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1475,24 +1475,18 @@ sort_pst_symbols (struct objfile *objfile, struct partial_symtab *pst) }); } -/* Allocate and partially fill a partial symtab. It will be - completely filled at the end of the symbol list. +/* Partially fill a partial symtab. It will be completely filled at + the end of the symbol list. */ - FILENAME is the name of the symbol-file we are reading from. */ - -struct partial_symtab * -start_psymtab_common (struct objfile *objfile, - const char *filename, - CORE_ADDR textlow) +partial_symtab::partial_symtab (const char *filename, + struct objfile *objfile, + CORE_ADDR textlow) + : partial_symtab (filename, objfile) { - struct partial_symtab *psymtab; - - psymtab = new partial_symtab (filename, objfile); - psymtab->set_text_low (textlow); - psymtab->set_text_high (psymtab->raw_text_low ()); /* default */ - psymtab->globals_offset = objfile->partial_symtabs->global_psymbols.size (); - psymtab->statics_offset = objfile->partial_symtabs->static_psymbols.size (); - return psymtab; + set_text_low (textlow); + set_text_high (raw_text_low ()); /* default */ + globals_offset = objfile->partial_symtabs->global_psymbols.size (); + statics_offset = objfile->partial_symtabs->static_psymbols.size (); } /* Perform "finishing up" operations of a partial symtab. */ |