public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Improve debug output support in gdbserver
@ 2023-11-07 18:03 Andrew Burgess
  2023-11-07 18:03 ` [PATCH 1/3] gdbserver: cleanup monitor_show_help Andrew Burgess
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Andrew Burgess @ 2023-11-07 18:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

For another patch I'm working on I wanted to add some additional debug
output to gdbserver.

Right now there appears to be two broad approaches I could take, these are:

  1. Just use threads_debug_printf.  The comments in debug.h even
  claim that this is really the "general" gdbserver debug output and
  that the "threads" here is just historic, but that feels like a bit
  of a cop out, we do have separate remote and event-loop debug
  control.  I think what really happened is folk just started reusing
  the threads_debug_printf rather than adding a new debug category,
  and over time we just resigned ourselves to threads actually being
  general output...  I think we can do better than that, so

  2. We can add a whole new debug category, with a new *_debug_printf
  function.  That I think would be better, but to control this new
  debug flag we then need to add a new command line flag (we already
  have --debug, --remote-debug, and --event-loop-debug), and then we
  need to add new monitor commands to control this new debug
  setting... this begins to feel not very scalable.

So, in this series I try to reimagine debug control in gdbserver, but
(hopefully) retain backwards compatibility.

The gdbserver command line flag now takes an optional list of
components, so we can do:

  gdbserver --debug=remote,threads

to enable 'remote' and 'threads' debug.  The default if no components
are listed is 'threads', which retains the backwards compatibility.
I've also retained the two additional flags '--remote-debug' and
'--event-loop-debug'.

QUESTION: How would folk feel if I was super aggressive and removed
these older flags?  In theory these flags are only used for debugging
gdbserver itself, but who knows, right?

And on the monitor command side, we now support:

  (gdb) monitor set debug COMPONENT 1
  (gdb) monitor set debug COMPONENT 0

to enable and disable debug for COMPONENT.  Where COMPONENT is again,
'threads', 'remote', and 'event-loop'.  Again, I've retained:

  (gdb) set debug 1
  (gdb) set debug 0

which is equivalent to 'set debug threads 1' or 'set debug threads 0'.
And I've also retained the legacy:

  (gdb) set remote-debug 1
  (gdb) set remote-debug 0
  (gdb) set event-loop-debug 1
  (gdb) set event-loop-debug 0
  
QUESTION: As with the command line, how would people feel if I ripped
out all of the legacy support and required folks to move to the newer
command set?

---

Andrew Burgess (3):
  gdbserver: cleanup monitor_show_help
  gdbserver: allow the --debug command line option to take a value
  gdbserver: allow for general 'monitor set debug COMPONENT VALUE' use

 gdb/NEWS                                |   7 +
 gdb/doc/gdb.texinfo                     |  78 ++++++++--
 gdb/testsuite/gdb.server/server-mon.exp |   6 +
 gdbserver/server.cc                     | 183 ++++++++++++++++++++++--
 4 files changed, 252 insertions(+), 22 deletions(-)


base-commit: 2029e13917d53d2289d3ebb390c4f40bd2112d21
-- 
2.25.4


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

end of thread, other threads:[~2023-12-08 18:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07 18:03 [PATCH 0/3] Improve debug output support in gdbserver Andrew Burgess
2023-11-07 18:03 ` [PATCH 1/3] gdbserver: cleanup monitor_show_help Andrew Burgess
2023-11-22 15:21   ` Andrew Burgess
2023-11-07 18:03 ` [PATCH 2/3] gdbserver: allow the --debug command line option to take a value Andrew Burgess
2023-11-07 19:41   ` Eli Zaretskii
2023-11-30 18:31     ` Andrew Burgess
2023-11-30 19:20       ` Eli Zaretskii
2023-12-04 15:57         ` Andrew Burgess
2023-12-04 16:21           ` Eli Zaretskii
2023-12-05 10:17             ` Andrew Burgess
2023-12-05 13:06               ` Eli Zaretskii
2023-11-07 18:03 ` [PATCH 3/3] gdbserver: allow for general 'monitor set debug COMPONENT VALUE' use Andrew Burgess
2023-11-17 14:43 ` [PATCH 0/3] Improve debug output support in gdbserver Tom Tromey
2023-11-17 14:55 ` Tom Tromey
2023-11-30 18:44 ` [PATCHv2 " Andrew Burgess
2023-11-30 18:44   ` [PATCHv2 1/3] gdb: fix GDB_DEBUG and GDBSERVER_DEBUG Makefile variables Andrew Burgess
2023-11-30 18:44   ` [PATCHv2 2/3] gdbserver: allow the --debug command line option to take a value Andrew Burgess
2023-11-30 18:44   ` [PATCHv2 3/3] gdbserver: allow for general 'monitor set debug COMPONENT VALUE' use Andrew Burgess
2023-11-30 19:30     ` Eli Zaretskii
2023-12-01 18:02   ` [PATCHv2 0/3] Improve debug output support in gdbserver Tom Tromey
2023-12-08 18:03     ` Andrew Burgess

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