aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-11-03 22:41:12 +0000
committerStu Grossman <grossman@cygnus>1994-11-03 22:41:12 +0000
commit6c27841f3b120b58f6306070deaccd7421696c1b (patch)
tree0b861530082869d6e91c0fa85bc365f9b145b61e /gdb/remote.c
parent78b459a7e7d0930a3ac1c4ca2fe4706559675cdc (diff)
downloadgdb-6c27841f3b120b58f6306070deaccd7421696c1b.zip
gdb-6c27841f3b120b58f6306070deaccd7421696c1b.tar.gz
gdb-6c27841f3b120b58f6306070deaccd7421696c1b.tar.bz2
* corelow.c, exec.c, inftarg.c, m3-nat.c, op50-rom.c, procfs.c,
remote-adapt.c, remote-e7000.c, remote-eb.c, remote-es.c, remote-hms.c, remote-mips.c, remote-mm.c, remote-mon.c, remote-nindy.c, remote-os9k.c, remote-pa.c, remote-sim.c, remote-st.c, remote-udi.c, remote-vx.c, remote-z8k.c, remote.c, w89k-rom.c, target.c, target.h: Add support for target_stop(). * gdbtk.c (gdb_stop): Switch to target_stop().
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index fb6184a..942f1bd 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -284,7 +284,7 @@ remote_close (quitting)
static void
get_offsets ()
{
- unsigned char buf[PBUFSIZ];
+ char buf[PBUFSIZ];
int nvals;
CORE_ADDR text_addr, data_addr, bss_addr;
struct section_offsets *offs;
@@ -460,7 +460,7 @@ fromhex (a)
else if (a >= 'a' && a <= 'f')
return a - 'a' + 10;
else
- error ("Reply contains invalid hex digit");
+ error ("Reply contains invalid hex digit %d", a);
}
/* Convert number NIB to a hex digit. */
@@ -639,14 +639,13 @@ remote_wait (pid, status)
return inferior_pid;
}
case 'O': /* Console output */
- fputs_filtered (buf + 1, gdb_stdout);
+ fputs_filtered ((char *)(buf + 1), gdb_stdout);
continue;
default:
warning ("Invalid remote reply: %s", buf);
continue;
}
}
- return inferior_pid;
}
/* Number of bytes of registers this stub implements. */
@@ -1171,7 +1170,7 @@ putpkt (buf)
break; /* Retransmit buffer */
case '$':
{
- unsigned char junkbuf[PBUFSIZ];
+ char junkbuf[PBUFSIZ];
/* It's probably an old response, and we're out of sync. Just
gobble up the packet and ignore it. */
@@ -1249,11 +1248,13 @@ read_frame (buf)
if (csum == pktcsum)
return 1;
- printf_filtered ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
- pktcsum, csum);
- puts_filtered (buf);
- puts_filtered ("\n");
-
+ if (remote_debug)
+ {
+ printf_filtered ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
+ pktcsum, csum);
+ puts_filtered (buf);
+ puts_filtered ("\n");
+ }
return 0;
}
case '*': /* Run length encoding */
@@ -1262,7 +1263,8 @@ read_frame (buf)
csum += c;
c = c - ' ' + 3; /* Compute repeat count */
- if (bp + c - 1 < buf + PBUFSIZ - 1)
+
+ if (c > 0 && c < 255 && bp + c - 1 < buf + PBUFSIZ - 1)
{
memset (bp, *(bp - 1), c);
bp += c;
@@ -1460,6 +1462,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", /* to_doc */
remote_mourn, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
+ 0, /* to_stop */
process_stratum, /* to_stratum */
NULL, /* to_next */
1, /* to_has_all_memory */