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