This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: Patch to remote.c - Fix to recovery from lost ACK


This patch was posted 3 weeks ago.  It was written at 4 hands with the maintainer
so I guess it was implicitly approved.  And no one else objected, so I will check
it in.

Fernando


Fernando Nasser wrote:
> 
> Andrew and me were looking at this code and we saw something that did not looked
> right.  I created this patch that I think straights things up.
> 
> 2000-09-15  Fernando Nasser  <fnasser@totem.to.cygnus.com>
> 
>         * remote.c (putpkt_binary): Call read_frame, not getpkt. Log message.
>         (read_frame): Do not call error() on communication error when
>         reading checksum, but return failure instead and log message.
> 
> --
> Fernando Nasser
> Red Hat - Toronto                       E-Mail:  fnasser@cygnus.com
> 
> Index: remote.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/remote.c,v
> retrieving revision 1.23
> diff -c -p -r1.23 remote.c
> *** remote.c    2000/09/01 00:12:10     1.23
> --- remote.c    2000/09/15 20:48:13
> *************** putpkt_binary (char *buf, int cnt)
> *** 3796,3804 ****
>               break;            /* Retransmit buffer */
>             case '$':
>               {
>                 /* It's probably an old response, and we're out of sync.
>                    Just gobble up the packet and ignore it.  */
> !               getpkt (junkbuf, sizeof_junkbuf, 0);
>                 continue;       /* Now, go look for + */
>               }
>             default:
> --- 3796,3806 ----
>               break;            /* Retransmit buffer */
>             case '$':
>               {
> +               if (remote_debug)
> +                 fprintf_unfiltered (gdb_stdlog, "Packet instead of Ack, ignoring it\n");
>                 /* It's probably an old response, and we're out of sync.
>                    Just gobble up the packet and ignore it.  */
> !               read_frame (junkbuf, sizeof_junkbuf);
>                 continue;       /* Now, go look for + */
>               }
>             default:
> *************** read_frame (char *buf,
> *** 3887,3893 ****
>                 return -1;
>               }
>             else if (check_0 < 0 || check_1 < 0)
> !             error ("Communication error in checksum");
> 
>             pktcsum = (fromhex (check_0) << 4) | fromhex (check_1);
>             if (csum == pktcsum)
> --- 3889,3899 ----
>                 return -1;
>               }
>             else if (check_0 < 0 || check_1 < 0)
> !             {
> !               if (remote_debug)
> !                 fputs_filtered ("Communication error in checksum\n", gdb_stdlog);
> !               return -1;
> !             }
> 
>             pktcsum = (fromhex (check_0) << 4) | fromhex (check_1);
>             if (csum == pktcsum)

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]