diff options
author | Doug Evans <dje@google.com> | 2015-12-10 12:00:29 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2015-12-10 12:00:29 -0800 |
commit | 2e77bb89f155d642a9ad4b09f4c77c38a17dbd77 (patch) | |
tree | 2cf570c58dd68ea57b1dce5fcd3696c4b1654aa3 | |
parent | b62f48720bc5255667cf2f5c5aca34af78fb657e (diff) | |
download | fsf-binutils-gdb-2e77bb89f155d642a9ad4b09f4c77c38a17dbd77.zip fsf-binutils-gdb-2e77bb89f155d642a9ad4b09f4c77c38a17dbd77.tar.gz fsf-binutils-gdb-2e77bb89f155d642a9ad4b09f4c77c38a17dbd77.tar.bz2 |
patch ../102425096.patch
-rw-r--r-- | README.google | 11 | ||||
-rw-r--r-- | gdb/remote.c | 27 |
2 files changed, 37 insertions, 1 deletions
diff --git a/README.google b/README.google index 0561e35..05adf7a 100644 --- a/README.google +++ b/README.google @@ -34,3 +34,14 @@ they are an ongoing maintenance burden. loading new symbol table. * testsuite/gdb.base/sepdebug.exp: Update expected output to match "no debugging symbols found" warning change for 1155829. +--- README.google 2015-09-05 14:53:18.000000000 -0700 ++++ README.google 2015-09-05 15:01:01.000000000 -0700 ++ ++2015-09-05 Doug Evans <dje@google.com> ++ ++ Fix for http://b/2630476 ++ * remote.c (readchar): Use minimum timeout of 10 minutes in noack mode. ++ (putpkt_binary): Don't resend QStartNoAckMode command packets. ++ ++ * remote.c (readchar): Don't lengthen timeout value of 0, ++ return immediately means return immediately. diff --git a/gdb/remote.c b/gdb/remote.c index 610da1e..1a1b226 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -7551,6 +7551,14 @@ readchar (int timeout) int ch; struct remote_state *rs = get_remote_state (); + /* GOOGLE LOCAL + Timeouts in noack mode are problematic. The protocol, as currently + implemented, basically can't handle them. As a temp hack until a + better fix is found, use a large minimum. */ +#define MIN_NOACK_TIMEOUT (10 * 60) /* seconds */ + if (rs->noack_mode && timeout > 0 && timeout < MIN_NOACK_TIMEOUT) + timeout = MIN_NOACK_TIMEOUT; + ch = serial_readchar (rs->remote_desc, timeout); if (ch >= 0) @@ -7654,7 +7662,8 @@ putpkt_binary (const char *buf, int cnt) int i; unsigned char csum = 0; char *buf2 = alloca (cnt + 6); - + int is_noack_switch = strncmp (buf, "QStartNoAckMode", + sizeof ("QStartNoAckMode")) == 0; int ch; int tcount = 0; char *p; @@ -7699,6 +7708,20 @@ putpkt_binary (const char *buf, int cnt) { int started_error_output = 0; + /* GOOGLE LOCAL + If we're making the transition to noack mode, don't keep + resending, just wait for the ack. + The problem is the remote protocol can't handle two commands + timing out in a row, which can happen when the system is under load. + Ref# 2630476. + Special case the transition to noack mode because once there we + use a much better timeout, regardless of what the default is or + what the user sets. + This is implemented this way in order to minimize differences + with the FSF tree until a better fix is checked in. */ + if (is_noack_switch && tcount > 0) + goto GetAck; + if (remote_debug) { struct cleanup *old_chain; @@ -7718,6 +7741,8 @@ putpkt_binary (const char *buf, int cnt) if (rs->noack_mode) break; + GetAck: /* Ref# 2630476 */ + /* Read until either a timeout occurs (-2) or '+' is read. Handle any notification that arrives in the mean time. */ while (1) |