public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/27910] New: support for host console output in non-stop mode
@ 2021-05-25 18:02 danielprilik at gmail dot com
  2022-01-07 21:16 ` [Bug remote/27910] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: danielprilik at gmail dot com @ 2021-05-25 18:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27910

            Bug ID: 27910
           Summary: support for host console output in non-stop mode
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: remote
          Assignee: unassigned at sourceware dot org
          Reporter: danielprilik at gmail dot com
  Target Milestone: ---

Hello, 

I'm the maintainer of gdbstub [1], a generic implementation of the server-side
GDB remote serial protocol written in Rust. I'm considering adding support for
non-stop mode, and as part of my preliminary research, I belive I've found a
small functional gap in the current remote protocol.

Based on my understanding of the GDB remote protocol, there are currently 3
ways for a target to send data back to the host's console:

- As a response to a qRcmd packet
- Using the `O xx` stop reason
- Using console File I/O (i.e: via write(1, ...))

Please let me know if I've missed any.

Assuming I haven't, that means that when a target is running in non-stop mode,
there is only a single way to send data back to the host console: as a response
to a qRcmd packet.

I understand the rationale behind forbidding File I/O in non stop mode, but I'm
not entirely sure why `O xx` isn't supported...

In any case, leaving qRcmd as the only mechanism by which a target can send
output to the host console is somewhat unfortunate, as it requires the host to
"pull" data from the target, as opposed to having the target "push" data to the
target.

It would be nice if there was a way to add some kind of "push" interface to
write data to a host's console in non-stop mode.

One idea that springs to mind is to re-use the existing notification packets
[2] infrastructure. e.g: the target could asynchronously send back a packet
along the lines of `% O data # checksum`, which the client would then output to
the console.

Alternatively, if there's some bug / issue stopping `O xx` packets from working
in non-stop mode, maybe it could be resolved?

Please let me know if this is something that could be supported. While I've
never contributed to GDB directly, I wouldn't mind helping out testing any
patches and/or contributing to one myself.

Cheers

[1] https://github.com/daniel5151/gdbstub
[2] https://sourceware.org/gdb/current/onlinedocs/gdb/Notification-Packets.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug remote/27910] support for host console output in non-stop mode
  2021-05-25 18:02 [Bug remote/27910] New: support for host console output in non-stop mode danielprilik at gmail dot com
@ 2022-01-07 21:16 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2022-01-07 21:16 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27910

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-01-07
                 CC|                            |tromey at sourceware dot org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Hi.  Sorry about the long delay.
This is a longstanding problem with the remote protocol.
It's mentioned here:
https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity
though I see there isn't a link to a bug or discussion.

I think the best thing to do is design how it should work --
the notification packet idea seems fine to me, though I
no longer recall the details -- and then try to implement
it in gdb and (ideally) gdbserver.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-01-07 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 18:02 [Bug remote/27910] New: support for host console output in non-stop mode danielprilik at gmail dot com
2022-01-07 21:16 ` [Bug remote/27910] " tromey at sourceware dot org

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