public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 0/3] Improve debug output support in gdbserver
Date: Tue,  7 Nov 2023 18:03:20 +0000	[thread overview]
Message-ID: <cover.1699379375.git.aburgess@redhat.com> (raw)

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


             reply	other threads:[~2023-11-07 18:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 18:03 Andrew Burgess [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1699379375.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).