* remote.c (remote_write_bytes): Chop up large transfers.
This commit is contained in:
parent
8513c9536d
commit
ec10503a73
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Aug 15 07:51:21 1995 steve chamberlain <sac@slash.cygnus.com>
|
||||||
|
|
||||||
|
* remote.c (remote_write_bytes): Chop up large transfers.
|
||||||
|
|
||||||
Mon Aug 14 17:56:36 1995 Stan Shebs <shebs@andros.cygnus.com>
|
Mon Aug 14 17:56:36 1995 Stan Shebs <shebs@andros.cygnus.com>
|
||||||
|
|
||||||
* gcc.patch: Remove, relevant only to long-ago versions of GCC.
|
* gcc.patch: Remove, relevant only to long-ago versions of GCC.
|
||||||
|
|
22
gdb/remote.c
22
gdb/remote.c
|
@ -135,8 +135,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
running and the debugger should
|
running and the debugger should
|
||||||
continue to wait for 'W', 'T', etc.
|
continue to wait for 'W', 'T', etc.
|
||||||
|
|
||||||
or... Otext Send text to stdout.
|
|
||||||
|
|
||||||
thread alive TXX Find out if the thread XX is alive.
|
thread alive TXX Find out if the thread XX is alive.
|
||||||
reply OK thread is still alive
|
reply OK thread is still alive
|
||||||
ENN thread is dead
|
ENN thread is dead
|
||||||
|
@ -1054,19 +1052,29 @@ remote_write_bytes (memaddr, myaddr, len)
|
||||||
char buf[PBUFSIZ];
|
char buf[PBUFSIZ];
|
||||||
int i;
|
int i;
|
||||||
char *p;
|
char *p;
|
||||||
|
int done;
|
||||||
|
/* Chop the transfer down if necessary */
|
||||||
|
|
||||||
|
done = 0;
|
||||||
|
while (done < len)
|
||||||
|
{
|
||||||
|
int todo = len - done;
|
||||||
|
int cando = PBUFSIZ /2 - 32; /* number of bytes that will fit. */
|
||||||
|
if (todo > cando)
|
||||||
|
todo = cando;
|
||||||
|
|
||||||
/* FIXME-32x64: Need a version of print_address_numeric which puts the
|
/* FIXME-32x64: Need a version of print_address_numeric which puts the
|
||||||
result in a buffer like sprintf. */
|
result in a buffer like sprintf. */
|
||||||
sprintf (buf, "M%lx,%x:", (unsigned long) memaddr, len);
|
sprintf (buf, "M%lx,%x:", (unsigned long) memaddr + done, todo);
|
||||||
|
|
||||||
/* We send target system values byte by byte, in increasing byte addresses,
|
/* We send target system values byte by byte, in increasing byte addresses,
|
||||||
each byte encoded as two hex characters. */
|
each byte encoded as two hex characters. */
|
||||||
|
|
||||||
p = buf + strlen (buf);
|
p = buf + strlen (buf);
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < todo; i++)
|
||||||
{
|
{
|
||||||
*p++ = tohex ((myaddr[i] >> 4) & 0xf);
|
*p++ = tohex ((myaddr[i + done] >> 4) & 0xf);
|
||||||
*p++ = tohex (myaddr[i] & 0xf);
|
*p++ = tohex (myaddr[i + done] & 0xf);
|
||||||
}
|
}
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
|
@ -1082,6 +1090,8 @@ remote_write_bytes (memaddr, myaddr, len)
|
||||||
errno = EIO;
|
errno = EIO;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
done += todo;
|
||||||
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue