* [commit] Fix a zero-sized registers bug
@ 2007-02-26 19:29 Daniel Jacobowitz
0 siblings, 0 replies; only message in thread
From: Daniel Jacobowitz @ 2007-02-26 19:29 UTC (permalink / raw)
To: gdb-patches
A followon to the ARM iWMMXt patches, found during basic ARM testing.
If we do not add a special case for zero-sized registers, we'll get an
internal error during 'g' packet parsing - they appear to be past the
end of the 'g' packet, even though they occupy no bytes in it.
The right answer is to neither fetch nor store registers without
contents, of course. Anything else runs the risk of wasted 'p' / 'P'
packets going back and forth.
Tested on arm-linux and checked in.
--
Daniel Jacobowitz
CodeSourcery
2007-02-26 Daniel Jacobowitz <dan@codesourcery.com>
* remote.c (init_remote_state): Add special handling for placeholder
registers.
---
gdb/remote.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletion(-)
Index: gdb-6.6.50/gdb/remote.c
===================================================================
--- gdb-6.6.50.orig/gdb/remote.c 2007-02-26 05:03:30.000000000 -0800
+++ gdb-6.6.50/gdb/remote.c 2007-02-26 05:22:46.000000000 -0800
@@ -340,7 +340,13 @@ init_remote_state (struct gdbarch *gdbar
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
struct packet_reg *r = &rsa->regs[regnum];
- r->pnum = gdbarch_remote_register_number (gdbarch, regnum);
+
+ if (register_size (current_gdbarch, regnum) == 0)
+ /* Do not try to fetch zero-sized (placeholder) registers. */
+ r->pnum = -1;
+ else
+ r->pnum = gdbarch_remote_register_number (gdbarch, regnum);
+
r->regnum = regnum;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-02-26 19:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-26 19:29 [commit] Fix a zero-sized registers bug Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox