aboutsummaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-10-23 09:46:25 -0600
committerTom Tromey <tom@tromey.com>2020-01-26 16:40:21 -0700
commit0494dbecdfa0b0b9065393755a1ac64431997da1 (patch)
tree62a9775a68571e89257e1ac2b0d1a88ac55526c0 /gdb/xcoffread.c
parent8566b89b737eef50f67bf23329b4606cf7973de1 (diff)
downloadgdb-0494dbecdfa0b0b9065393755a1ac64431997da1.zip
gdb-0494dbecdfa0b0b9065393755a1ac64431997da1.tar.gz
gdb-0494dbecdfa0b0b9065393755a1ac64431997da1.tar.bz2
Consolidate partial symtab dependency reading
Most of the symbol readers have code to iterate over a partial symtabs dependencies, expanding each one and optionally printing a message. Now that the "second-stage" psymtab expansion is available as a method, these implementations can all be merged. This patch also changes a couple more warnings into assertions. gdb/ChangeLog 2020-01-26 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_psymtab_to_symtab_1): Call read_dependencies. Add assert. * psymtab.c (partial_symtab::read_dependencies): New method. * psympriv.h (struct partial_symtab) <read_dependencies>: New method. * mdebugread.c (psymtab_to_symtab_1): Call read_dependencies. * dwarf2read.c (dwarf2_psymtab::expand_psymtab): Call read_dependencies. * dbxread.c (dbx_psymtab_to_symtab_1): Call read_dependencies. Add assert. Change-Id: I8151e05677794e90223edc1a4cb70f7f69137d46
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 1c0db67..b7da3f9 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1819,36 +1819,10 @@ find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
static void
xcoff_psymtab_to_symtab_1 (legacy_psymtab *pst, struct objfile *objfile)
{
- int i;
-
- if (!pst)
- return;
-
- if (pst->readin)
- {
- fprintf_unfiltered
- (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
- return;
- }
+ gdb_assert (!pst->readin);
/* Read in all partial symtabs on which this one is dependent. */
- for (i = 0; i < pst->number_of_dependencies; i++)
- if (!pst->dependencies[i]->readin)
- {
- /* Inform about additional files that need to be read in. */
- if (info_verbose)
- {
- fputs_filtered (" ", gdb_stdout);
- wrap_here ("");
- fputs_filtered ("and ", gdb_stdout);
- wrap_here ("");
- printf_filtered ("%s...", pst->dependencies[i]->filename);
- wrap_here (""); /* Flush output */
- gdb_flush (gdb_stdout);
- }
- pst->dependencies[i]->expand_psymtab (objfile);
- }
+ pst->read_dependencies (objfile);
if (((struct symloc *) pst->read_symtab_private)->numsyms != 0)
{