public inbox for gdb-testers@sourceware.org help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Subject: [binutils-gdb] Turn start_psymtab_common into a constructor Date: Mon, 27 Jan 2020 09:16:00 -0000 [thread overview] Message-ID: <c3693a1d9466bc9d3abe004e66f1b56fed22ba61@gdb-build> (raw) *** TEST RESULTS FOR COMMIT c3693a1d9466bc9d3abe004e66f1b56fed22ba61 *** commit c3693a1d9466bc9d3abe004e66f1b56fed22ba61 Author: Tom Tromey <tom@tromey.com> AuthorDate: Tue Oct 22 17:08:16 2019 -0600 Commit: Tom Tromey <tom@tromey.com> CommitDate: Sun Jan 26 16:40:21 2020 -0700 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 diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 854ac3144c..6353a00c15 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +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. + 2020-01-26 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_end_psymtab): Use new. diff --git a/gdb/ctfread.c b/gdb/ctfread.c index c41d96f3e5..e3931fbd3e 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -1299,7 +1299,7 @@ create_partial_symtab (const char *name, struct partial_symtab *pst; struct ctf_context *ccx; - pst = start_psymtab_common (objfile, name, 0); + pst = new partial_symtab (name, objfile, 0); ccx = XOBNEW (&objfile->objfile_obstack, struct ctf_context); ccx->fp = cfp; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 95270856a0..4e388fae50 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1903,8 +1903,8 @@ static struct partial_symtab * start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow, int ldsymoff) { - struct partial_symtab *result = - start_psymtab_common (objfile, filename, textlow); + struct partial_symtab *result = new partial_symtab (filename, objfile, + textlow); result->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct symloc); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 2cac286435..f865fa4848 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8027,7 +8027,7 @@ create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile; struct partial_symtab *pst; - pst = start_psymtab_common (objfile, name, 0); + pst = new partial_symtab (name, objfile, 0); pst->psymtabs_addrmap_supported = true; diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 2ec30ec1de..dafc7f4c9c 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2609,9 +2609,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, textlow = fh->adr; else textlow = 0; - pst = start_psymtab_common (objfile, - fdr_name (fh), - textlow); + pst = new partial_symtab (fdr_name (fh), objfile, textlow); pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, symloc); memset (pst->read_symtab_private, 0, sizeof (struct symloc)); diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 74ff10ef6a..82ae1b5d25 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -113,6 +113,14 @@ struct partial_symtab partial_symtab (const char *filename, struct objfile *objfile) ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3); + /* Like the above, but also sets the initial text low and text high + from the ADDR argument, and sets the global- and + static-offsets. */ + + partial_symtab (const char *filename, struct objfile *objfile, + CORE_ADDR addr) + ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3); + /* Return the raw low text address of this partial_symtab. */ CORE_ADDR raw_text_low () const { @@ -326,9 +334,6 @@ extern void add_psymbol_to_list (gdb::string_view name, extern void init_psymbol_list (struct objfile *objfile, int total_symbols); -extern struct partial_symtab *start_psymtab_common (struct objfile *, - const char *, CORE_ADDR); - extern void end_psymtab_common (struct objfile *, struct partial_symtab *); static inline void diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 844e718614..b31461c331 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. */ diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index be10c4f3d5..901c13469f 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2007,11 +2007,8 @@ static struct partial_symtab * xcoff_start_psymtab (struct objfile *objfile, const char *filename, int first_symnum) { - struct partial_symtab *result = - start_psymtab_common (objfile, - filename, - /* We fill in textlow later. */ - 0); + /* We fill in textlow later. */ + struct partial_symtab *result = new partial_symtab (filename, objfile, 0); result->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct symloc);
next reply other threads:[~2020-01-27 8:54 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-01-27 9:16 gdb-buildbot [this message] 2020-01-27 9:13 ` Failures on Fedora-i686, branch master gdb-buildbot 2020-01-27 9:46 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot 2020-01-27 10:01 ` Failures on Fedora-x86_64-m32, " gdb-buildbot 2020-01-27 10:40 ` Failures on Fedora-x86_64-m64, " gdb-buildbot 2020-01-27 10:55 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot 2020-01-27 11:13 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot 2020-01-27 13:31 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot 2020-01-27 13:31 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot 2020-01-27 15:03 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=c3693a1d9466bc9d3abe004e66f1b56fed22ba61@gdb-build \ --to=gdb-buildbot@sergiodj.net \ --cc=gdb-testers@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).