aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1994-08-05 00:14:05 +0000
committerSteve Chamberlain <sac@cygnus>1994-08-05 00:14:05 +0000
commit284f4ee95b2397193863711d631d0bed18ffa101 (patch)
treeb7f9c37465662b07df6cf00b0529cd6b1fed4442 /gdb/remote.c
parent7f4b5f94dd2327919ff79bf5d81db9132d63ecf7 (diff)
downloadfsf-binutils-gdb-284f4ee95b2397193863711d631d0bed18ffa101.zip
fsf-binutils-gdb-284f4ee95b2397193863711d631d0bed18ffa101.tar.gz
fsf-binutils-gdb-284f4ee95b2397193863711d631d0bed18ffa101.tar.bz2
* remote.c (read_frame): Calculate run length encoded checksum correctly.
* config/sh/stub.c: New file.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index a6ea424..8debf22 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -126,10 +126,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
remote target.
Responses can be run-length encoded to save space. A '*' means that
- the next two characters are hex digits giving a repeat count which
+ the next character is an ASCII encoding giving a repeat count which
stands for that many repititions of the character preceding the '*'.
- Note that this means that responses cannot contain '*'. Example:
- "0*03" means the same as "0000". */
+ The encoding is n+29, yielding a printable character where n >=3
+ (which is where rle starts to win). Don't use an n > 126.
+
+ So
+ "0* " means the same as "0000". */
#include "defs.h"
#include <string.h>
@@ -1254,6 +1257,7 @@ read_frame (buf)
return 0;
}
case '*': /* Run length encoding */
+ csum += c;
c = readchar (remote_timeout);
csum += c;
c = c - ' ' + 3; /* Compute repeat count */
@@ -1269,8 +1273,8 @@ read_frame (buf)
printf_filtered ("Repeat count %d too large for buffer: ", c);
puts_filtered (buf);
puts_filtered ("\n");
-
return 0;
+
default:
if (bp < buf + PBUFSIZ - 1)
{