aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorTheodore A. Roth <troth@openavr.org>2003-06-04 04:31:37 +0000
committerTheodore A. Roth <troth@openavr.org>2003-06-04 04:31:37 +0000
commit7d58c67dbb8ad7f7094aa4d3dd85b60116593d04 (patch)
treee533ba78536a84d6dbbf99a11633dc67983318f2 /gdb/remote.c
parent0a48e7e82632466952c5916cd4c22021c41fdf50 (diff)
downloadbinutils-7d58c67dbb8ad7f7094aa4d3dd85b60116593d04.zip
binutils-7d58c67dbb8ad7f7094aa4d3dd85b60116593d04.tar.gz
binutils-7d58c67dbb8ad7f7094aa4d3dd85b60116593d04.tar.bz2
* 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/remote.c')
-rw-r--r--gdb/remote.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 40be8e6..e55e141 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