diff options
author | Mark Kettenis <kettenis@gnu.org> | 2002-10-26 14:41:37 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2002-10-26 14:41:37 +0000 |
commit | 751f1375d662b14f8550bd4821d8fd76f308ef0c (patch) | |
tree | 72ad15224820a6859430ae0cbf880ccf6256c32e /gdb | |
parent | 57266a339fa59d1217421a96fa52f9629ef180f6 (diff) | |
download | gdb-751f1375d662b14f8550bd4821d8fd76f308ef0c.zip gdb-751f1375d662b14f8550bd4821d8fd76f308ef0c.tar.gz gdb-751f1375d662b14f8550bd4821d8fd76f308ef0c.tar.bz2 |
* i386-tdep.c (i386_extract_struct_value_address): Use
regcache_raw_read_unsigned instead of
regcache_cooked_read_unsigned since we know that the register
we're reading isn't a pseudo register. Rename variable 'val' into
the more descriptive 'addr'.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 22 |
2 files changed, 13 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ef08593..4abddcd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2002-10-26 Mark Kettenis <kettenis@gnu.org> + * i386-tdep.c (i386_extract_struct_value_address): Use + regcache_raw_read_unsigned instead of + regcache_cooked_read_unsigned since we know that the register + we're reading isn't a pseudo register. Rename variable 'val' into + the more descriptive 'addr'. + * x86-64-tdep.c: Fix some formatting problems, mostly in comments. (x86_64_push_return_address): Add comment. (x86_64_pop_frame): Make static. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 5a19308..252a9b7 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1039,25 +1039,17 @@ i386_store_return_value (struct type *type, struct regcache *regcache, } } -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR. */ +/* Extract from REGCACHE, which contains the (raw) register state, the + address in which a function should return its structure value, as a + CORE_ADDR. */ static CORE_ADDR i386_extract_struct_value_address (struct regcache *regcache) { - /* 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; + ULONGEST addr; + + regcache_raw_read_unsigned (regcache, LOW_RETURN_REGNUM, &addr); + return addr; } |