From 5ca8c39f059b30991b7090e7a662e4eb35d11133 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 27 May 2018 21:31:14 -0600 Subject: Simplify complaints even more This removes the SHORT_FIRST_MESSAGE case from complaints, leaving only a single case. This allows for the removal of the last argument to clear_complaints, and also simplifies complaint_internal, removing an extra allocation in the process. After this, the "./gdb -iex 'set complaint 1' -nx ./gdb" example will show: Reading symbols from ./gdb... During symbol reading: .debug_ranges entry has start address of zero [in module /home/tromey/gdb/build/gdb/gdb] During symbol reading: DW_AT_low_pc 0x0 is zero for DIE at 0x17116c1 [in module /home/tromey/gdb/build/gdb/gdb] During symbol reading: .debug_line address at offset 0xa22f5 is 0 [in module /home/tromey/gdb/build/gdb/gdb] During symbol reading: unsupported tag: 'DW_TAG_unspecified_type' During symbol reading: const value length mismatch for 'std::ratio<1, 1000000000>::num', got 8, expected 0 This is a bit wordier but, I think, a bit more clear, as the form of the message no longer depends on precisely when it was emitted. In particular if you compare to the output from the 'Clean up "Reading symbols" output' patch, you can see that earlier gdb would switch from the prefix-less form to the "During symbol reading" form at a point that is meaningless to the user (specifically, after psymtab reading is done and gdb tries to expand a CU). 2018-10-04 Tom Tromey * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * complaints.h (clear_complaints): Remove argument. * complaints.c (enum complaint_series): Remove. (series): Remove global. (complaint_internal): Update. (clear_complaints): Remove argument. gdb/testsuite/ChangeLog 2018-10-04 Tom Tromey * gdb.cp/maint.exp (test_invalid_name): Update expected output. * gdb.gdb/complaints.exp (test_short_complaints): Remove. (test_initial_complaints, test_empty_complaints): Update. * gdb.dwarf2/dw2-stack-boundary.exp: Update. --- gdb/symfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/symfile.c') diff --git a/gdb/symfile.c b/gdb/symfile.c index 981bf33..6a1140e 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -989,7 +989,7 @@ syms_from_objfile_1 (struct objfile *objfile, initial symbol reading for this file. */ (*objfile->sf->sym_init) (objfile); - clear_complaints (1); + clear_complaints (); (*objfile->sf->sym_offsets) (objfile, *addrs); @@ -1036,7 +1036,7 @@ finish_new_objfile (struct objfile *objfile, symfile_add_flags add_flags) } /* We're done reading the symbol file; finish off complaints. */ - clear_complaints (0); + clear_complaints (); } /* Process a symbol file, as either the main file or as a dynamically @@ -2540,7 +2540,7 @@ reread_symbols (void) } (*objfile->sf->sym_init) (objfile); - clear_complaints (1); + clear_complaints (); objfile->flags &= ~OBJF_PSYMTABS_READ; @@ -2570,7 +2570,7 @@ reread_symbols (void) } /* We're done reading the symbol file; finish off complaints. */ - clear_complaints (0); + clear_complaints (); /* Getting new symbols may change our opinion about what is frameless. */ -- cgit v1.1