diff options
author | Stu Grossman <grossman@cygnus> | 1992-08-15 09:34:25 +0000 |
---|---|---|
committer | Stu Grossman <grossman@cygnus> | 1992-08-15 09:34:25 +0000 |
commit | 4ecee2f9f17ab0cd2b4e10e3b1b75eb33f1b4940 (patch) | |
tree | 55fcae8a8c17befc056adbe8fd3d07603d80e221 /gdb/remote.c | |
parent | 1d4bd6ad280fa2c8137ea862cecbf31167fdeb0a (diff) | |
download | gdb-4ecee2f9f17ab0cd2b4e10e3b1b75eb33f1b4940.zip gdb-4ecee2f9f17ab0cd2b4e10e3b1b75eb33f1b4940.tar.gz gdb-4ecee2f9f17ab0cd2b4e10e3b1b75eb33f1b4940.tar.bz2 |
* sparc-stub.c: New file. Mix it with your SPARClite
application, and it will speak GDB remote protocol!
* remote.c (remote_wait): Change 'T' (expedited reply) message to
deal with arbitrary registers. Needed for sparc-stub,
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index cb1ad34..03d4dee 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -416,7 +416,8 @@ remote_wait (status) void (*ofunc)(); unsigned char *p; int i; - char regs[REGISTER_RAW_SIZE (PC_REGNUM) + REGISTER_RAW_SIZE (FP_REGNUM)]; + int regno; + unsigned char regs[8]; /* Better be big enough for largest reg */ WSETEXIT ((*status), 0); @@ -428,17 +429,27 @@ remote_wait (status) error ("Remote failure reply: %s", buf); if (buf[0] == 'T') { - /* Expedited reply, containing Signal, PC, and FP. */ + /* Expedited reply, containing Signal, {regno, reg} repeat */ p = &buf[3]; /* after Txx */ - for (i = 0; i < sizeof (regs); i++) + + while (*p) { - if (p[0] == 0 || p[1] == 0) - error ("Remote reply is too short: %s", buf); - regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]); + regno = fromhex (p[0]) * 16 + fromhex (p[1]); p += 2; + if (regno >= NUM_REGS) + error ("Remote sent illegal register number %d (0x%x)", regno, + regno); + + for (i = 0; i < REGISTER_RAW_SIZE (regno); i++) + { + if (p[0] == 0 || p[1] == 0) + error ("Remote reply is too short: %s", buf); + regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]); + p += 2; + } + + supply_register (regno, regs); } - supply_register (PC_REGNUM, ®s[0]); - supply_register (FP_REGNUM, ®s[REGISTER_RAW_SIZE (PC_REGNUM)]); } else if (buf[0] != 'S') error ("Invalid remote reply: %s", buf); |