* infrun.c (stop_registers): Change variable's type to ``struct

regcache'''.
(xmalloc_inferior_status): Delete function.
(free_inferior_status): Delete function.
(normal_stop): Use regcache_cpy.
(struct inferior_status): Change type of fields ``stop_registers''
and ``registers'' to ``struct regcache''.
(write_inferior_status_register): Use regcache_write.
(save_inferior_status): Instead of calling
xmalloc_inferior_status, allocate the inf_status buffer directly.
Use regcache_dup_no_passthrough and regcache_dup to save the
buffers.
(restore_inferior_status): Use regcache_xfree and regcache_cpy.
Replace the stop_registers regcache instead of overriding it.  Use
regcache_xfree.  Instead of calling free_inferior_status, xfree
the buffer directly.
(discard_inferior_status): Use regcache_xfree.  Instead of calling
free_inferior_status, xfree the buffer directly.
(build_infrun): Use regcache_xmalloc.
(_initialize_infrun): Delete redundant call to build_infrun.
* Makefile.in (infcmd.o): Add $(regcache_h).
* infcmd.c: Include "regcache.h".
(run_stack_dummy): Use deprecated_grub_regcache_for_registers to
obtain the address of `stop_registers' register buffer.
(print_return_value): Ditto.
* inferior.h (struct regcache): Add opaque declaration.
(stop_registers): Change variable's declared type to ``struct
regcache''.
This commit is contained in:
Andrew Cagney 2002-06-25 18:38:57 +00:00
parent 8f28b84541
commit 72cec14173
5 changed files with 78 additions and 39 deletions

View file

@ -41,6 +41,8 @@
#include "event-top.h"
#include "parser-defs.h"
#include "regcache.h" /* for deprecated_grub_regcache_for_registers(). */
/* Functions exported for general use: */
void nofp_registers_info (char *, int);
@ -1043,7 +1045,8 @@ run_stack_dummy (CORE_ADDR addr, char *buffer)
/* On normal return, the stack dummy has been popped already. */
memcpy (buffer, stop_registers, REGISTER_BYTES);
memcpy (buffer, deprecated_grub_regcache_for_registers (stop_registers),
REGISTER_BYTES);
return 0;
}
@ -1143,7 +1146,15 @@ print_return_value (int structure_return, struct type *value_type)
if (!structure_return)
{
#if 0
value = value_being_returned (value_type, stop_registers, structure_return);
#else
/* FIXME: cagney/2002-06-22: Function value_being_returned()
should take a regcache as a parameter. */
value = value_being_returned
(value_type, deprecated_grub_regcache_for_registers (stop_registers),
structure_return);
#endif
stb = ui_out_stream_new (uiout);
ui_out_text (uiout, "Value returned is ");
ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
@ -1164,7 +1175,15 @@ print_return_value (int structure_return, struct type *value_type)
ui_out_text (uiout, ".");
ui_out_text (uiout, " Cannot determine contents\n");
#else
#if 0
value = value_being_returned (value_type, stop_registers, structure_return);
#else
/* FIXME: cagney/2002-06-22: Function value_being_returned()
should take a regcache as a parameter. */
value = value_being_returned
(value_type, deprecated_grub_regcache_for_registers (stop_registers),
structure_return);
#endif
stb = ui_out_stream_new (uiout);
ui_out_text (uiout, "Value returned is ");
ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));