aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2008-08-12 15:18:31 +0000
committerSandra Loosemore <sandra@codesourcery.com>2008-08-12 15:18:31 +0000
commita6f3e723d387ad5292f1a7519e5204d53510d081 (patch)
tree990e72f8cdb78dab49f48a6c5e8eb0f4382a96f9 /gdb/gdbserver/server.c
parentb099ab9fcd00257ccf077d30a327a719edd940e6 (diff)
downloadgdb-a6f3e723d387ad5292f1a7519e5204d53510d081.zip
gdb-a6f3e723d387ad5292f1a7519e5204d53510d081.tar.gz
gdb-a6f3e723d387ad5292f1a7519e5204d53510d081.tar.bz2
gdb/doc/
2008-08-12 Sandra Loosemore <sandra@codesourcery.com> * gdb.texinfo (Remote Configuration): Document set remote noack-packet. (Remote Protocol): Add Packet Acknowledgment to menu. (Overview): Mention +/- can be disabled, and point to new section where this is discussed in detail. (General Query Packets): Document QStartNoAckMode packet, and corresponding qSupported reply. (Packet Acknowledgment): New section. gdb/ 2008-08-12 Pedro Alves <pedro@codesourcery.com> Add no-ack mode to the remote protocol --- optionally stop ACKing packets and responses when we have a reliable communication medium. Based on Apple's GDB, by Jason Molenda <jmolenda@apple.com> * remote.c (struct remote_state): Add noack_mode field. (PACKET_QStartNoAckMode): New. (remote_start_remote): Don't any outstanding packet here. (remote_open_1): Clear noack_mode. Ack any outstanding packet here. Activate noack mode if requested. (remote_protocol_features): Add QStartNoAckMode. (remote_open_1): (putpkt_binary): Don't send ack in noack mode. (read_frame): Don't recompute the checksum in noack mode. (getpkt_sane): Skip sending ack if in noack mode. (_initialize_remote): Add set/show remote noack mode. * NEWS: Note the new features. gdb/gdbserver/ 2008-08-12 Pedro Alves <pedro@codesourcery.com> * remote-utils.c (noack_mode, transport_is_reliable): New globals. (remote_open): Set or clear transport_is_reliable. (putpkt_binary): Don't expect acks in noack mode. (getpkt): Don't send ack/nac in noack mode. * server.c (handle_general_set): Handle QStartNoAckMode. (handle_query): If connected by tcp pass QStartNoAckMode+ in qSupported. (main): Reset noack_mode on every connection. * server.h (noack_mode): Declare.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 1fa1694..60df3d8 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -270,6 +270,19 @@ handle_general_set (char *own_buf)
return;
}
+ if (strcmp (own_buf, "QStartNoAckMode") == 0)
+ {
+ if (remote_debug)
+ {
+ fprintf (stderr, "[noack mode enabled]\n");
+ fflush (stderr);
+ }
+
+ noack_mode = 1;
+ write_ok (own_buf);
+ return;
+ }
+
/* Otherwise we didn't know what packet it was. Say we didn't
understand it. */
own_buf[0] = 0;
@@ -777,6 +790,8 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
qXfer:feature:read at all, we will never be re-queried. */
strcat (own_buf, ";qXfer:features:read+");
+ if (transport_is_reliable)
+ strcat (own_buf, ";QStartNoAckMode+");
return;
}
@@ -1447,6 +1462,7 @@ main (int argc, char *argv[])
while (1)
{
+ noack_mode = 0;
remote_open (port);
restart: