From e91b87a36830d061ef87d67be5f309e4d4ed918f Mon Sep 17 00:00:00 2001 From: "gdb-3.1" Date: Tue, 31 Jan 1989 17:56:40 +0000 Subject: gdb-3.1 --- gdb/remote.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'gdb/remote.c') diff --git a/gdb/remote.c b/gdb/remote.c index 27a7322..6abd8e2 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -62,18 +62,21 @@ anyone else from sharing it farther. Help stamp out software hoarding! kill req k */ -#include -#include - #include "defs.h" -#include "initialize.h" #include "param.h" #include "frame.h" #include "inferior.h" #include "wait.h" + +#ifdef USG +#include +#include +#endif + +#include +#include #include -#include #include #ifdef HAVE_TERMIO @@ -97,14 +100,13 @@ int icache; /* Descriptor for I/O to remote machine. */ int remote_desc; -#define PBUFSIZ 300 +#define PBUFSIZ 400 static void remote_send (); static void putpkt (); static void getpkt (); static void dcache_flush (); -START_FILE /* Open a connection to a remote debugger. NAME is the filename used for communication. */ @@ -239,8 +241,8 @@ remote_store_registers (regs) p = buf + 1; for (i = 0; i < REGISTER_BYTES; i++) { - *p++ = (regs[i] > 4) & 0xf; - *p++ = regs[i] & 0xf; + *p++ = tohex ((regs[i] >> 4) & 0xf); + *p++ = tohex (regs[i] & 0xf); } remote_send (buf); @@ -305,8 +307,8 @@ remote_write_bytes (memaddr, myaddr, len) p = buf + strlen (buf); for (i = 0; i < len; i++) { - *p++ = (myaddr[i] > 4) & 0xf; - *p++ = myaddr[i] & 0xf; + *p++ = tohex ((myaddr[i] >> 4) & 0xf); + *p++ = tohex (myaddr[i] & 0xf); } remote_send (buf); @@ -338,7 +340,7 @@ remote_read_bytes (memaddr, myaddr, len) each byte encoded as two hex characters. */ p = buf; - for (i = 0; i < REGISTER_BYTES; i++) + for (i = 0; i < len; i++) { if (p[0] == 0 || p[1] == 0) error ("Remote reply is too short: %s", buf); @@ -440,12 +442,15 @@ getpkt (buf) char *buf; { char *bp; - char csum = 0; - int c, c1, c2; + unsigned char csum; + unsigned int c, c1, c2; extern kiodebug; while (1) { + /* Force csum to be zero here because of possible error retry. */ + csum = 0; + while ((c = readchar()) != '$'); bp = buf; @@ -616,8 +621,3 @@ dcache_init () insque (db, &dcache_free); } -static initialize () -{ -} - -END_FILE -- cgit v1.1