aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-10-22 21:13:10 -0600
committerTom Tromey <tom@tromey.com>2020-01-26 16:40:21 -0700
commit077cbab270376098e90c841690f9e4439b63d3d4 (patch)
tree0cd6ed8c27c8a723472193a87aee65fd136cb049 /gdb/dwarf2read.c
parent891813beaab0029c88c9eeec9c1847d68a4d6050 (diff)
downloadgdb-077cbab270376098e90c841690f9e4439b63d3d4.zip
gdb-077cbab270376098e90c841690f9e4439b63d3d4.tar.gz
gdb-077cbab270376098e90c841690f9e4439b63d3d4.tar.bz2
Consolidate psymtab "Reading" messages
Each symbol reader implemented its own "Reading..." messages, and most of them double-checked that a previously-expanded psymtab could not be re-read. This patch consolidates the message-printing, and changes these checks into asserts. gdb/ChangeLog 2020-01-26 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_read_symtab): Remove prints. Add assert. * psymtab.c (psymtab_to_symtab): Print verbose "Reading" messages. * mdebugread.c (mdebug_read_symtab): Remove prints. * dwarf2read.c (dwarf2_psymtab::read_symtab): Remove prints. Add assert. * dbxread.c (dbx_read_symtab): Remove prints. Add assert. Change-Id: I795be9710d42708299bb7b44972cffd27aec9413
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c44
1 files changed, 13 insertions, 31 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8bde265..9942270 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -9494,41 +9494,23 @@ dwarf2_psymtab::read_symtab (struct objfile *objfile)
struct dwarf2_per_objfile *dwarf2_per_objfile
= get_dwarf2_per_objfile (objfile);
- if (readin)
- {
- warning (_("bug: psymtab for %s is already read in."),
- filename);
- }
- else
+ gdb_assert (!readin);
+ /* If this psymtab is constructed from a debug-only objfile, the
+ has_section_at_zero flag will not necessarily be correct. We
+ can get the correct value for this flag by looking at the data
+ associated with the (presumably stripped) associated objfile. */
+ if (objfile->separate_debug_objfile_backlink)
{
- if (info_verbose)
- {
- printf_filtered (_("Reading in symbols for %s..."),
- filename);
- gdb_flush (gdb_stdout);
- }
+ struct dwarf2_per_objfile *dpo_backlink
+ = get_dwarf2_per_objfile (objfile->separate_debug_objfile_backlink);
- /* If this psymtab is constructed from a debug-only objfile, the
- has_section_at_zero flag will not necessarily be correct. We
- can get the correct value for this flag by looking at the data
- associated with the (presumably stripped) associated objfile. */
- if (objfile->separate_debug_objfile_backlink)
- {
- struct dwarf2_per_objfile *dpo_backlink
- = get_dwarf2_per_objfile (objfile->separate_debug_objfile_backlink);
-
- dwarf2_per_objfile->has_section_at_zero
- = dpo_backlink->has_section_at_zero;
- }
-
- dwarf2_per_objfile->reading_partial_symbols = 0;
+ dwarf2_per_objfile->has_section_at_zero
+ = dpo_backlink->has_section_at_zero;
+ }
- psymtab_to_symtab_1 (this);
+ dwarf2_per_objfile->reading_partial_symbols = 0;
- /* Finish up the debug error message. */
- if (info_verbose)
- printf_filtered (_("done.\n"));
- }
+ psymtab_to_symtab_1 (this);
process_cu_includes (dwarf2_per_objfile);
}