aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/remote-utils.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-11-02 04:44:47 +0000
committerJason Molenda <jmolenda@apple.com>1999-11-02 04:44:47 +0000
commit5c44784c11ecc8febfff615b88496c56c9ad5274 (patch)
tree74f9079f5b0ddae1182abf087af8adc02103e149 /gdb/gdbserver/remote-utils.c
parent9503fd8735ec438fcb2fca34afa276e3e6ca94f5 (diff)
downloadgdb-5c44784c11ecc8febfff615b88496c56c9ad5274.zip
gdb-5c44784c11ecc8febfff615b88496c56c9ad5274.tar.gz
gdb-5c44784c11ecc8febfff615b88496c56c9ad5274.tar.bz2
import gdb-1999-11-01 snapshot
Diffstat (limited to 'gdb/gdbserver/remote-utils.c')
-rw-r--r--gdb/gdbserver/remote-utils.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 4dab2ab..cd078cc 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -201,7 +201,7 @@ putpkt (buf)
{
int i;
unsigned char csum = 0;
- char buf2[2000];
+ char buf2[PBUFSIZ];
char buf3[1];
int cnt = strlen (buf);
char *p;
@@ -435,10 +435,13 @@ outreg (regno, buf)
int regno;
char *buf;
{
- extern char registers[];
int regsize = REGISTER_RAW_SIZE (regno);
- *buf++ = tohex (regno >> 4);
+ if ((regno >> 12) != 0)
+ *buf++ = tohex ((regno >> 12) & 0xf);
+ if ((regno >> 8) != 0)
+ *buf++ = tohex ((regno >> 8) & 0xf);
+ *buf++ = tohex ((regno >> 4) & 0xf);
*buf++ = tohex (regno & 0xf);
*buf++ = ':';
convert_int_to_ascii (&registers[REGISTER_BYTE (regno)], buf, regsize);
@@ -469,6 +472,18 @@ prepare_resume_reply (buf, status, signo)
if (status == 'T')
{
+#ifdef GDBSERVER_RESUME_REGS
+ static int gdbserver_resume_regs[] = GDBSERVER_RESUME_REGS ;
+ int i;
+ for (i = 0;
+ i < sizeof (gdbserver_resume_regs)
+ / sizeof (gdbserver_resume_regs[0]);
+ i++)
+ {
+ int regnum = gdbserver_resume_regs[i];
+ buf = outreg (regnum, buf);
+ }
+#else /* !defined(GDBSERVER_RESUME_REGS) */
buf = outreg (PC_REGNUM, buf);
buf = outreg (FP_REGNUM, buf);
buf = outreg (SP_REGNUM, buf);
@@ -478,6 +493,7 @@ prepare_resume_reply (buf, status, signo)
#ifdef O7_REGNUM
buf = outreg (O7_REGNUM, buf);
#endif
+#endif /* GDBSERVER_RESUME_REGS */
/* If the debugger hasn't used any thread features, don't burden it with
threads. If we didn't check this, GDB 4.13 and older would choke. */