From: Andrew Burgess <aburgess@redhat.com>
To: William Tambe <tambewilliam@gmail.com>, gdb-patches@sourceware.org
Subject: Re: Can gdbserver tunnel stdout/stdin to/from gdb ?
Date: Tue, 08 Feb 2022 09:20:09 +0000 [thread overview]
Message-ID: <871r0daf5i.fsf@redhat.com> (raw)
In-Reply-To: <CAF8i9mP0SEWK=YysVhBbe9-k7=Fani575WWd=vxzoFX+xZ12OA@mail.gmail.com>
William Tambe via Gdb-patches <gdb-patches@sourceware.org> writes:
> Can gdbserver tunnel stdout/stdin to/from gdb so as to debug an
> application as if it was executing on the machine running gdb ?
I don't believe gdbserver itself supports this feature.
The remote protocol doe have limited support for this using the File I/O
extensions:
https://sourceware.org/gdb/onlinedocs/gdb/File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension
as far as I understand it though, this is mostly used when debugging
devices that don't have their own console, so we have some support for
allowing the target to print to gdb's console. Though I don't see why a
bigger target couldn't make use of that extension - you'd just need a
mechanism to intercept the syscalls at the remote end and have gdbserver
forward them to gdb.
The final thing that might be relevant to this topic, though clearly not
what you're actually asking about, is the 'O' packet, which allows
gdbserver to write messages to gdb's console. As I understand it, this
is often used to allow things like monitor commands to print diagnostic
output, but in general I think this is more for gdbserver itself (not
the thing running under gdbserver) to communicate with the gdb user.
Thanks,
Andrew
next prev parent reply other threads:[~2022-02-08 9:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 4:04 William Tambe
2022-02-08 9:20 ` Andrew Burgess [this message]
2022-02-10 20:58 ` Tom Tromey
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=871r0daf5i.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tambewilliam@gmail.com \
/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).