public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add vDefaultInferiorFd feature
@ 2024-01-19 11:56 Alexandra Hájková
  2024-01-19 11:56 ` [PATCH v2 1/6] gdb.server/non-existing-program.exp: Use gdbserver_start Alexandra Hájková
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Alexandra Hájková @ 2024-01-19 11:56 UTC (permalink / raw)
  To: gdb-patches

Currently, when GDBserver is run locally using stdio, the inferior
is unable to read from STDIN so we can't give it any input.
The main motivation to address this issue is to use GDB together
with Valgrind, using vgdb --multi feature which allows to run
Valgrind from inside GDB. Valgrind then acts as a locally run
GDBserver that uses stdio.

Add a new DefaultInferiorFd feature and the corresponding packet.
This feature allows GDB to send, to GDBserver, the file descriptor
numbers of the terminal to which GDB is connected. The inferior is
then started connected to the same terminal as GDB. This allows the
inferior run by local GDBserver to read from GDB's STDIN and write
its output to GDB's STOUT/ERR the same way as native target.

v2: - [2/6]:- add an error handling in a case dup would fail
            - hoist the calls to mark_fd_no_cloexec near the dup()s
      [3/6] - improve documentation formatting
            - rephrase and extend the documentation
            - cosmetics
            - add a new target method so that gdbserver doesn't advertise
              this new feauture on platforms it does not work at
      [4/3] - cosmetics

Alexandra Hájková (6):
  gdb.server/non-existing-program.exp: Use gdbserver_start.
  gdb/ser-pipe.c: Duplicate the file descriptors
  Add new vDefaultInferiorFd packet
  gdbserver/linux-low.cc: Connect the inferior to the terminal
  remote.c: Add terminal handling functions
  Add defaultinf.exp test to the testsuite

 gdb/doc/gdb.texinfo                           |  42 ++++++
 gdb/remote.c                                  |  83 +++++++++++
 gdb/ser-pipe.c                                |  40 ++++++
 gdb/serial.c                                  |   4 +
 gdb/serial.h                                  |   4 +
 gdb/testsuite/gdb.server/defaultinf.c         |  39 +++++
 gdb/testsuite/gdb.server/defaultinf.exp       |  59 ++++++++
 .../gdb.server/non-existing-program.exp       |  54 ++-----
 gdb/testsuite/lib/gdbserver-support.exp       |  62 +++++---
 gdbserver/linux-low.cc                        |  38 ++++-
 gdbserver/linux-low.h                         |   2 +
 gdbserver/server.cc                           | 135 +++++++++++++++++-
 gdbserver/server.h                            |  12 ++
 gdbserver/target.cc                           |   6 +
 gdbserver/target.h                            |   6 +
 15 files changed, 524 insertions(+), 62 deletions(-)
 create mode 100644 gdb/testsuite/gdb.server/defaultinf.c
 create mode 100644 gdb/testsuite/gdb.server/defaultinf.exp

-- 
2.43.0


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

end of thread, other threads:[~2024-02-23 16:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19 11:56 [PATCH v2 0/6] Add vDefaultInferiorFd feature Alexandra Hájková
2024-01-19 11:56 ` [PATCH v2 1/6] gdb.server/non-existing-program.exp: Use gdbserver_start Alexandra Hájková
2024-01-19 11:56 ` [PATCH v2] remote.c: Make packet_check_result return a structure Alexandra Hájková
2024-02-22 14:37   ` Alexandra Petlanova Hajkova
2024-02-23 16:19     ` Tom Tromey
2024-01-19 11:56 ` [PATCH v2 2/6] gdb/ser-pipe.c: Duplicate the file descriptors Alexandra Hájková
2024-01-19 11:56 ` [PATCH v2 3/6] Add new vDefaultInferiorFd packet Alexandra Hájková
2024-01-19 12:04   ` Eli Zaretskii
2024-01-19 11:56 ` [PATCH v2 4/6] gdbserver/linux-low.cc: Connect the inferior to the terminal Alexandra Hájková
2024-01-19 11:56 ` [PATCH v2 5/6] remote.c: Add terminal handling functions Alexandra Hájková
2024-01-19 11:56 ` [PATCH v2 6/6] Add defaultinf.exp test to the testsuite Alexandra Hájková
2024-02-22 14:38 ` [PATCH v2 0/6] Add vDefaultInferiorFd feature Alexandra Petlanova Hajkova

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