freebsd-dev/sys/gdb
Conrad Meyer 6310546dba gdb(4): Implement support for NoAckMode
When the underlying debugport transport is reliable, GDB's additional
checksums and acknowledgements are redundant.  NoAckMode eliminates the
the acks and allows us to skip checking RX checksums.  The GDB packet
framing does not change, so unfortunately (valid) checksums are still
included as message trailers.

The gdb(4) stub in FreeBSD advertises support for the feature in response to
the client's 'qSupported' request IFF the current debugport has the
gdb_dbfeatures flag GDB_DBGP_FEAT_RELIABLE set.  Currently, only netgdb(4)
supports this feature.

If the remote GDB client supports the feature and does not have it disabled
via a GDB configuration knob, it may instruct our gdb(4) stub to enter
NoAckMode.  Unless and until it issues that command, we must continue to
transmit acks as usual (and for now, we continue to wait until we receive
them as well, even if we know the debugport is on a reliable transport).

In the kernel sources, the sense of the flag representing the state of the
feature is reversed from that of the GDB command.  (I.e., it is
'gdb_ackmode', not 'gdb_noackmode.')  This is to avoid confusing double-
negative conditions.

For reference, see:
  * https://sourceware.org/gdb/onlinedocs/gdb/Packet-Acknowledgment.html
  * https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#QStartNoAckMode

Reviewed by:	jhb, markj (both earlier version)
Differential Revision:	https://reviews.freebsd.org/D21761
2019-10-17 22:37:25 +00:00
..
gdb_cons.c gdb(4): Root a sysctl tree at 'debug.gdb.' 2019-09-08 22:52:47 +00:00
gdb_int.h gdb(4): Implement support for NoAckMode 2019-10-17 22:37:25 +00:00
gdb_main.c gdb(4): Implement support for NoAckMode 2019-10-17 22:37:25 +00:00
gdb_packet.c gdb(4): Implement support for NoAckMode 2019-10-17 22:37:25 +00:00
gdb.h gdb(4): Implement support for NoAckMode 2019-10-17 22:37:25 +00:00
netgdb.c gdb(4): Implement support for NoAckMode 2019-10-17 22:37:25 +00:00
netgdb.h Implement NetGDB(4) 2019-10-17 21:33:01 +00:00