aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-07-03 20:36:54 +0000
committerAndrew Cagney <cagney@redhat.com>2002-07-03 20:36:54 +0000
commit36160dc4b2bf0b2f8341f8f017ea606adfcac332 (patch)
tree54f3da9959241f17896fa3667cc20097a5915d5f /gdb/valops.c
parent4dd79c29b4a65ae1ff861c3e9d42f190f6846770 (diff)
downloadgdb-36160dc4b2bf0b2f8341f8f017ea606adfcac332.zip
gdb-36160dc4b2bf0b2f8341f8f017ea606adfcac332.tar.gz
gdb-36160dc4b2bf0b2f8341f8f017ea606adfcac332.tar.bz2
* infcmd.c (print_return_value): Remove compatibility code calling
deprecated_grub_regcache_for_registers. * values.c: Include "regcache.h". (value_being_returned): Update. Use deprecated_grub_regcache_for_registers to extract the register buffer address. * value.h (value_being_returned): Change ``retbuf'' parameter to a ``struct regcache''. * Makefile.in (values.o): Add dependency on $(regcache_h). * inferior.h (run_stack_dummy): Change type of second parameter to a ``struct regcache''. * valops.c (hand_function_call): Change type of retbuf to ``struct regcache''. Allocate using regcache_xmalloc, clean using make_cleanup_regcache_xfree. * infcmd.c (run_stack_dummy): Update. Use regcache_cpu_no_passthrough instead of memcpy to copy the buffer. * regcache.c (do_regcache_xfree): New function. (make_cleanup_regcache_xfree): New function. * regcache.h (make_cleanup_regcache_xfree): Declare.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 3e72e94..df42e09 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1316,7 +1316,7 @@ hand_function_call (struct value *function, int nargs, struct value **args)
struct type *value_type;
unsigned char struct_return;
CORE_ADDR struct_addr = 0;
- char *retbuf;
+ struct regcache *retbuf;
struct cleanup *retbuf_cleanup;
struct inferior_status *inf_status;
struct cleanup *inf_status_cleanup;
@@ -1339,8 +1339,8 @@ hand_function_call (struct value *function, int nargs, struct value **args)
containing the register values). This chain is create BEFORE the
inf_status chain so that the inferior status can cleaned up
(restored or discarded) without having the retbuf freed. */
- retbuf = xmalloc (REGISTER_BYTES);
- retbuf_cleanup = make_cleanup (xfree, retbuf);
+ retbuf = regcache_xmalloc (current_gdbarch);
+ retbuf_cleanup = make_cleanup_regcache_xfree (retbuf);
/* A cleanup for the inferior status. Create this AFTER the retbuf
so that this can be discarded or applied without interfering with