aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-08-13 13:58:50 +0000
committerAndrew Cagney <cagney@redhat.com>2002-08-13 13:58:50 +0000
commita378f4192681bdbeb5f7aa12ae3c6e9505cd14a7 (patch)
treec9e865f6a70dd3c4c0e479debd2854f80ae9f251 /gdb/i386-tdep.c
parent212a3c4d9dc124caf97fda76260c67f0ea467cdd (diff)
downloadfsf-binutils-gdb-a378f4192681bdbeb5f7aa12ae3c6e9505cd14a7.zip
fsf-binutils-gdb-a378f4192681bdbeb5f7aa12ae3c6e9505cd14a7.tar.gz
fsf-binutils-gdb-a378f4192681bdbeb5f7aa12ae3c6e9505cd14a7.tar.bz2
2002-08-12 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_raw_read_as_address): Delete function. (regcache_cooked_read_signed): New function. (regcache_cooked_read_unsigned): New function. * regcache.h (regcache_cooked_read_signed): Declare. (regcache_cooked_read_unsigned): Declare. (regcache_raw_read_as_address): Delete declaration. * blockframe.c (generic_read_register_dummy): Use regcache_cooked_read_unsigned. * i386-tdep.c (i386_extract_struct_value_address): Use regcache_cooked_read_unsigned.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 2968c31..ad19691 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1028,7 +1028,18 @@ i386_store_return_value (struct type *type, char *valbuf)
static CORE_ADDR
i386_extract_struct_value_address (struct regcache *regcache)
{
- return regcache_raw_read_as_address (regcache, LOW_RETURN_REGNUM);
+ /* NOTE: cagney/2002-08-12: Replaced a call to
+ regcache_raw_read_as_address() with a call to
+ regcache_cooked_read_unsigned(). The old, ...as_address function
+ was eventually calling extract_unsigned_integer (via
+ extract_address) to unpack the registers value. The below is
+ doing an unsigned extract so that it is functionally equivalent.
+ The read needs to be cooked as, otherwise, it will never
+ correctly return the value of a register in the [NUM_REGS
+ .. NUM_REGS+NUM_PSEUDO_REGS) range. */
+ ULONGEST val;
+ regcache_cooked_read_unsigned (regcache, LOW_RETURN_REGNUM, &val);
+ return val;
}