]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
patch ../102425096.patch
authorDoug Evans <dje@google.com>
Thu, 10 Dec 2015 20:00:29 +0000 (12:00 -0800)
committerDoug Evans <dje@google.com>
Thu, 10 Dec 2015 20:00:29 +0000 (12:00 -0800)
README.google
gdb/remote.c

index 0561e3529120fdb12964863c454d4e3a219f2a56..05adf7aa5269ff9929a2b8bf1bcc33da5ae840df 100644 (file)
@@ -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.
index 610da1eb320b4b1c071604da67de245f0363c948..1a1b2263c6d257bb2ddf4351c214d3f52b9491c0 100644 (file)
@@ -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)