diff options
author | Theodore A. Roth <troth@openavr.org> | 2003-06-04 04:31:37 +0000 |
---|---|---|
committer | Theodore A. Roth <troth@openavr.org> | 2003-06-04 04:31:37 +0000 |
commit | aa6061fd55d50d1a4d0ebdf77f3a6b5029a4e853 (patch) | |
tree | 5d915b8cd8ab57a9a410bc29f2531c1354b8505b /gdb | |
parent | 48cfa53068106cbe8ab973e02f80cc1d146571e5 (diff) | |
download | gdb-aa6061fd55d50d1a4d0ebdf77f3a6b5029a4e853.tar.gz |
* remote.c (init_remote_state): Compute sizeof_g_packet by
accumulation of the size of all registers instead of blindly using
DEPRECATED_REGISTER_BYTES.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/remote.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7b727012f60..0202a1efbbc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-06-03 Theodore A. Roth <troth@openavr.org> + + * remote.c (init_remote_state): Compute sizeof_g_packet by + accumulation of the size of all registers instead of blindly using + DEPRECATED_REGISTER_BYTES. + 2003-06-03 Michael Snyder <msnyder@redhat.com> * config/h8300/tm-h8300.h (h8300sxmode): Declare. diff --git a/gdb/remote.c b/gdb/remote.c index 40be8e6badc..e55e141ab0b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -261,9 +261,10 @@ init_remote_state (struct gdbarch *gdbarch) int regnum; struct remote_state *rs = xmalloc (sizeof (struct remote_state)); - /* Start out by having the remote protocol mimic the existing - behavour - just copy in the description of the register cache. */ - rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; /* OK */ + if (DEPRECATED_REGISTER_BYTES != 0) + rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; + else + rs->sizeof_g_packet = 0; /* Assume a 1:1 regnum<->pnum table. */ rs->regs = xcalloc (NUM_REGS + NUM_PSEUDO_REGS, sizeof (struct packet_reg)); @@ -274,8 +275,11 @@ init_remote_state (struct gdbarch *gdbarch) r->regnum = regnum; r->offset = REGISTER_BYTE (regnum); r->in_g_packet = (regnum < NUM_REGS); - /* ...size = REGISTER_RAW_SIZE (regnum); */ /* ...name = REGISTER_NAME (regnum); */ + + /* Compute packet size by accumulating the size of all registers. */ + if (DEPRECATED_REGISTER_BYTES == 0) + rs->sizeof_g_packet += register_size (current_gdbarch, regnum); } /* Default maximum number of characters in a packet body. Many |