diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-08-27 01:59:34 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-08-27 01:59:34 +0000 |
commit | d1984822f8f5bf74da5d0b5955c6ac4817e485cb (patch) | |
tree | 8a78a2094d2210a034b83492e0c9a794ea1a466d | |
parent | 6501e46a92b5d81ec57c031d14fbe303ad65c2de (diff) | |
download | fsf-binutils-gdb-d1984822f8f5bf74da5d0b5955c6ac4817e485cb.zip fsf-binutils-gdb-d1984822f8f5bf74da5d0b5955c6ac4817e485cb.tar.gz fsf-binutils-gdb-d1984822f8f5bf74da5d0b5955c6ac4817e485cb.tar.bz2 |
* regcache.c (read_register_bytes): When REGISTER_NAME indicates
that a register should be ignored, supply a value for the register
from the raw registers[] buffer.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/regcache.c | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 709c8ed..66b7514 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2001-08-24 Andrew Cagney <ac131313@redhat.com> + * regcache.c (read_register_bytes): When REGISTER_NAME indicates + that a register should be ignored, supply a value for the register + from the raw registers[] buffer. + +2001-08-24 Andrew Cagney <ac131313@redhat.com> + * go32-nat.c (go32_create_inferior): Use xfree instead of free. * config/djgpp/fnchange.lst: Add entries for i386bsd-tdep.c and i386bsd-nat.c. diff --git a/gdb/regcache.c b/gdb/regcache.c index b939d9a..79dee26 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -230,9 +230,6 @@ read_register_bytes (int in_start, char *in_buf, int in_len) int end; int byte; - if (REGISTER_NAME (regnum) == NULL || *REGISTER_NAME (regnum) == '\0') - continue; - reg_start = REGISTER_BYTE (regnum); reg_len = REGISTER_RAW_SIZE (regnum); reg_end = reg_start + reg_len; @@ -241,8 +238,18 @@ read_register_bytes (int in_start, char *in_buf, int in_len) /* The range the user wants to read doesn't overlap with regnum. */ continue; - /* Force the cache to fetch the entire register. */ - read_register_gen (regnum, reg_buf); + if (REGISTER_NAME (regnum) != NULL && *REGISTER_NAME (regnum) != '\0') + /* Force the cache to fetch the entire register. */ + read_register_gen (regnum, reg_buf); + else + /* Legacy note: even though this register is ``invalid'' we + still need to return something. It would appear that some + code relies on apparent gaps in the register array also + being returned. */ + /* FIXME: cagney/2001-08-18: This is just silly. It defeats + the entire register read/write flow of control. Must + resist temptation to return 0xdeadbeef. */ + memcpy (reg_buf, registers + reg_start, reg_len); /* Legacy note: This function, for some reason, allows a NULL input buffer. If the buffer is NULL, the registers are still |