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: [PATCHv2 00/10] Improve GDB/gdbserver experience when using a local gdbserver
Date: Fri, 25 Aug 2023 16:34:33 +0100	[thread overview]
Message-ID: <cover.1692977354.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1692200989.git.aburgess@redhat.com>

The goal of this series is to improve the user experience when using a
local (running on the same machine as GDB) gdbserver.

Outside of testing, there are still plenty of occasions when a user
can end up running gdbserver on the same machine as GDB, tools like
valgrind communicate via the remote protocol, as do many simulators
(other than those built into GDB).

This series includes the following improvements:

  1. Better handling of gdbserver's default executable and arguments.
  This applies to remote gdbservers and local gdbservers,

  2. Allow sysroot 'target:' prefix to be ignored when gdbserver is
  running locally to GDB, and

  3. Allow the user to skip setting 'remote exec-file' if gdbserver is
  running locally to GDB.

Changes since V1:

  - I've added a new 'namespaces' key to the qMachineId reply (in
    patch #7), this will catch the case where the remote debug server
    is running inside a container.  At least, that's my hope.  For my
    limited testing it does seem to do what I want.

  - However, I don't think this is the full solution.  The current
    linux_nat_target::filesystem_is_local implementation is more
    dynamic, checking on each request if the inferior is in the same
    namespace, which I guess allows for some inferiors being within a
    different namespace, while others are not.  When all accesses are
    through gdbserver this is all handled correctly, but with the new
    "local" access strategy we're going to loose this.  I plan to come
    back and address this in a V3 of this series, but this isn't going
    to happen until some time in September now, so I wanted to share
    what I currently have.

---

Andrew Burgess (10):
  gdb: have remote_target::extended_remote_run take the exec filename
  gdb: improve how 'remote exec-file' is stored and accessed
  gdb: improve show text and help text for 'remote exec-file'
  gdb/gdbserver: add new qDefaultExecAndArgs packet
  gdb: detect when gdbserver has no default executable set
  gdb: make use of is_target_filename
  gdb: add qMachineId packet
  gdb: remote filesystem can be local to GDB in some cases
  gdb: use exec_file with remote targets when possible
  gdb: remove the get_remote_exec_file function

 gdb/Makefile.in                               |   3 +
 gdb/NEWS                                      |  45 ++
 gdb/build-id.c                                |   2 +-
 gdb/configure.nat                             |   2 +-
 gdb/doc/gdb.texinfo                           | 186 +++++
 gdb/gdb_bfd.h                                 |   8 +
 gdb/linux-nat.c                               |  42 ++
 gdb/nat/linux-machine-id.c                    |  85 +++
 gdb/nat/linux-machine-id.h                    |  75 ++
 gdb/nat/linux-namespaces.c                    |  13 +
 gdb/nat/linux-namespaces.h                    |  14 +
 gdb/remote-machine-id.c                       |  69 ++
 gdb/remote-machine-id.h                       | 108 +++
 gdb/remote.c                                  | 683 +++++++++++++++---
 gdb/testsuite/gdb.base/remote-exec-file.exp   |   7 +-
 gdb/testsuite/gdb.multi/gdb-settings.exp      |  13 +
 gdb/testsuite/gdb.server/ext-run.exp          | 131 +++-
 .../gdb.server/fetch-exec-and-args.c          |  34 +
 .../gdb.server/fetch-exec-and-args.exp        | 253 +++++++
 gdb/testsuite/gdb.server/server-local-fs.c    |  22 +
 gdb/testsuite/gdb.server/server-local-fs.exp  | 138 ++++
 gdb/testsuite/gdb.server/sysroot.exp          |  90 +--
 gdbserver/Makefile.in                         |   1 +
 gdbserver/configure.srv                       |   2 +-
 gdbserver/linux-low.cc                        |  24 +
 gdbserver/linux-low.h                         |   2 +
 gdbserver/server.cc                           |  45 ++
 gdbserver/target.cc                           |   8 +
 gdbserver/target.h                            |   9 +
 29 files changed, 1954 insertions(+), 160 deletions(-)
 create mode 100644 gdb/nat/linux-machine-id.c
 create mode 100644 gdb/nat/linux-machine-id.h
 create mode 100644 gdb/remote-machine-id.c
 create mode 100644 gdb/remote-machine-id.h
 create mode 100644 gdb/testsuite/gdb.server/fetch-exec-and-args.c
 create mode 100644 gdb/testsuite/gdb.server/fetch-exec-and-args.exp
 create mode 100644 gdb/testsuite/gdb.server/server-local-fs.c
 create mode 100644 gdb/testsuite/gdb.server/server-local-fs.exp


base-commit: cdb090c88b4ebf6f728a000d1ee73d9bdee9ebb3
-- 
2.25.4


  parent reply	other threads:[~2023-08-25 15:34 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 15:54 [PATCH " Andrew Burgess
2023-08-16 15:54 ` [PATCH 01/10] gdb: have remote_target::extended_remote_run take the exec filename Andrew Burgess
2023-08-23  9:30   ` Alexandra Petlanova Hajkova
2023-08-16 15:54 ` [PATCH 02/10] gdb: improve how 'remote exec-file' is stored and accessed Andrew Burgess
2023-08-23  8:44   ` Alexandra Petlanova Hajkova
2023-08-16 15:54 ` [PATCH 03/10] gdb: improve show text and help text for 'remote exec-file' Andrew Burgess
2023-08-23 11:36   ` Mark Wielaard
2023-08-24  8:56   ` Alexandra Petlanova Hajkova
2023-08-16 15:55 ` [PATCH 04/10] gdb/gdbserver: add new qDefaultExecAndArgs packet Andrew Burgess
2023-08-16 16:36   ` Eli Zaretskii
2023-08-28 15:35   ` Tom Tromey
2023-08-16 15:55 ` [PATCH 05/10] gdb: detect when gdbserver has no default executable set Andrew Burgess
2023-08-16 15:55 ` [PATCH 06/10] gdb: make use of is_target_filename Andrew Burgess
2023-08-23 13:35   ` Mark Wielaard
2023-08-16 15:55 ` [PATCH 07/10] gdb: add qMachineId packet Andrew Burgess
2023-08-16 16:34   ` Eli Zaretskii
2023-08-25 14:49     ` Andrew Burgess
2023-08-25 15:01       ` Eli Zaretskii
2023-09-26 14:42         ` Andrew Burgess
2023-09-29  7:45           ` Eli Zaretskii
2023-08-22  2:39   ` Thiago Jung Bauermann
2023-08-23  9:24   ` Mark Wielaard
2023-08-23 11:36     ` Andrew Burgess
2023-08-28 16:06   ` Tom Tromey
2023-08-16 15:55 ` [PATCH 08/10] gdb: remote filesystem can be local to GDB in some cases Andrew Burgess
2023-08-16 16:40   ` Eli Zaretskii
2023-08-16 15:55 ` [PATCH 09/10] gdb: use exec_file with remote targets when possible Andrew Burgess
2023-08-16 15:55 ` [PATCH 10/10] gdb: remote the get_remote_exec_file function Andrew Burgess
2023-08-23 13:42   ` Mark Wielaard
2023-08-22 10:41 ` [PATCH 00/10] Improve GDB/gdbserver experience when using a local gdbserver Alexandra Petlanova Hajkova
2023-08-23 14:32 ` Mark Wielaard
2023-08-23 15:26   ` Andrew Burgess
2023-08-25 15:34 ` Andrew Burgess [this message]
2023-08-25 15:34   ` [PATCHv2 01/10] gdb: have remote_target::extended_remote_run take the exec filename Andrew Burgess
2023-08-25 15:34   ` [PATCHv2 02/10] gdb: improve how 'remote exec-file' is stored and accessed Andrew Burgess
2023-08-25 15:34   ` [PATCHv2 03/10] gdb: improve show text and help text for 'remote exec-file' Andrew Burgess
2023-08-25 15:34   ` [PATCHv2 04/10] gdb/gdbserver: add new qDefaultExecAndArgs packet Andrew Burgess
2023-08-26  6:46     ` Eli Zaretskii
2023-08-25 15:34   ` [PATCHv2 05/10] gdb: detect when gdbserver has no default executable set Andrew Burgess
2023-08-25 15:34   ` [PATCHv2 06/10] gdb: make use of is_target_filename Andrew Burgess
2023-08-25 15:34   ` [PATCHv2 07/10] gdb: add qMachineId packet Andrew Burgess
2023-08-26  6:54     ` Eli Zaretskii
2023-08-25 15:34   ` [PATCHv2 08/10] gdb: remote filesystem can be local to GDB in some cases Andrew Burgess
2023-08-26  6:49     ` Eli Zaretskii
2023-08-25 15:34   ` [PATCHv2 09/10] gdb: use exec_file with remote targets when possible Andrew Burgess
2023-08-25 15:34   ` [PATCHv2 10/10] gdb: remove the get_remote_exec_file function 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.1692977354.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).