public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Suppress printing of superfluous BFD error messages
@ 2022-09-07 17:30 Kevin Buettner
  2022-09-07 17:30 ` [PATCH v2 1/2] " Kevin Buettner
  2022-09-07 17:30 ` [PATCH v2 2/2] BFD error message suppression test case Kevin Buettner
  0 siblings, 2 replies; 5+ messages in thread
From: Kevin Buettner @ 2022-09-07 17:30 UTC (permalink / raw)
  To: gdb-patches; +Cc: lsix, Kevin Buettner

Tools which use the BFD library will output error messages of the
form "BFD: some messsage" when a problem with the file upon which it
operating is found.  E.g. an actual message (modulo some shortening
of the pathname) from the test case in this series is:

BFD: bfd-errors-lib.so: invalid string offset 1154 >= 154 for section `.dynstr'

For some problems with executable files or libraries, BFD will
attempt to output many identical messages.  The first patch in this
series adds code to GDB to suppress messages which are identical to
earlier messages that have already been printed.

(The above blurb was adapted from a comment in the test case.)

This V2 patch addresses concerns noted by Lancelot SIX.

For part 1, I've used one of Lancelot's suggestions for simplifying
the implementation of increment_bfd_error_count() in gdb_bfd.c.

Regarding the test case, Lancelot found that it failed when tested on
Ubuntu.  It turned out that attempting to run to a catchpoint whilst
using a mangled shared library was fragile.  I rewrote parts of the
test to instead use 'add-symbol-file -readnow' to load symbols from
the mangled shared object into GDB.  Also, since the main program is
no longer needed, I removed it and all references to in in the .exp
file.  Lancelot suggested several other improvements which I also put
into place.

Kevin Buettner (2):
  Suppress printing of superfluous BFD error messages
  BFD error message suppression test case

 gdb/gdb_bfd.c                           |  67 +++++++++
 gdb/testsuite/gdb.base/bfd-errors-lib.c |  44 ++++++
 gdb/testsuite/gdb.base/bfd-errors.exp   | 187 ++++++++++++++++++++++++
 3 files changed, 298 insertions(+)
 create mode 100644 gdb/testsuite/gdb.base/bfd-errors-lib.c
 create mode 100644 gdb/testsuite/gdb.base/bfd-errors.exp

-- 
2.37.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-07 19:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 17:30 [PATCH v2 0/2] Suppress printing of superfluous BFD error messages Kevin Buettner
2022-09-07 17:30 ` [PATCH v2 1/2] " Kevin Buettner
2022-09-07 18:53   ` Simon Marchi
2022-09-07 17:30 ` [PATCH v2 2/2] BFD error message suppression test case Kevin Buettner
2022-09-07 19:05   ` Simon Marchi

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).