* regcache.c (read_sp): Remove.
* gcore.c (derive_stack_segment): Use get_frame_sp instead of read_sp.
* infcall.c (call_function_by_hand): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Use regcache instead
of calling read_sp.
* rs6000-tdep.c (rs6000_push_dummy_call): Likewise.
+2007-05-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * inferior.h (read_sp): Remove prototype.
+ * regcache.c (read_sp): Remove.
+ * gcore.c (derive_stack_segment): Use get_frame_sp instead of read_sp.
+ * infcall.c (call_function_by_hand): Likewise.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Use regcache instead
+ of calling read_sp.
+ * rs6000-tdep.c (rs6000_push_dummy_call): Likewise.
+
2007-05-11 Ulrich Weigand <uweigand@de.ibm.com>
* i386-linux-nat.c (i386_linux_resume): Use regcache functions
/* Save frame pointer of TOS frame. */
*top = get_frame_base (fi);
/* If current stack pointer is more "inner", use that instead. */
- if (INNER_THAN (read_sp (), *top))
- *top = read_sp ();
+ if (INNER_THAN (get_frame_sp (fi), *top))
+ *top = get_frame_sp (fi);
/* Find prev-most frame. */
while ((tmp_fi = get_prev_frame (fi)) != NULL)
/* Ensure that the initial SP is correctly aligned. */
{
- CORE_ADDR old_sp = read_sp ();
+ CORE_ADDR old_sp = get_frame_sp (get_current_frame ());
if (gdbarch_frame_align_p (current_gdbarch))
{
sp = gdbarch_frame_align (current_gdbarch, old_sp);
extern void generic_target_write_pc (CORE_ADDR, ptid_t);
-extern CORE_ADDR read_sp (void);
-
extern CORE_ADDR unsigned_pointer_to_address (struct type *type,
const gdb_byte *buf);
extern void unsigned_address_to_pointer (struct type *type, gdb_byte *buf,
int struct_return, CORE_ADDR struct_addr)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- const CORE_ADDR saved_sp = read_sp ();
+ ULONGEST saved_sp;
int argspace = 0; /* 0 is an initial wrong guess. */
int write_pass;
+ regcache_cooked_read_unsigned (regcache, SP_REGNUM, &saved_sp);
+
/* Go through the argument list twice.
Pass 1: Figure out how much new stack space is required for
{
CORE_ADDR func_addr = find_function_addr (function, NULL);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- /* By this stage in the proceedings, SP has been decremented by "red
- zone size" + "struct return size". Fetch the stack-pointer from
- before this and use that as the BACK_CHAIN. */
- const CORE_ADDR back_chain = read_sp ();
+ ULONGEST back_chain;
/* See for-loop comment below. */
int write_pass;
/* Size of the Altivec's vector parameter region, the final value is
the possible values of tdep->wordsize. */
gdb_assert (tdep->wordsize == 8);
+ /* By this stage in the proceedings, SP has been decremented by "red
+ zone size" + "struct return size". Fetch the stack-pointer from
+ before this and use that as the BACK_CHAIN. */
+ regcache_cooked_read_unsigned (regcache, SP_REGNUM, &back_chain);
+
/* Go through the argument list twice.
Pass 1: Compute the function call's stack space and register
}
-/* read_pc, write_pc, read_sp, etc. Special handling for registers
- PC, SP, and FP. */
+/* read_pc, write_pc, etc. Special handling for register PC. */
/* NOTE: cagney/2001-02-18: The functions read_pc_pid(), read_pc() and
read_sp(), will eventually be replaced by per-frame methods.
write_pc_pid (pc, inferior_ptid);
}
-/* Cope with strage ways of getting to the stack and frame pointers */
-
-CORE_ADDR
-read_sp (void)
-{
- if (TARGET_READ_SP_P ())
- return TARGET_READ_SP ();
- else if (gdbarch_unwind_sp_p (current_gdbarch))
- return get_frame_sp (get_current_frame ());
- else if (SP_REGNUM >= 0)
- /* Try SP_REGNUM last: this makes all sorts of [wrong] assumptions
- about the architecture so put it at the end. */
- return read_register (SP_REGNUM);
- internal_error (__FILE__, __LINE__, _("read_sp: Unable to find SP"));
-}
static void
reg_flush_command (char *command, int from_tty)
struct value *arg = 0;
struct type *type;
- CORE_ADDR saved_sp;
+ ULONGEST saved_sp;
/* The calling convention this function implements assumes the
processor has floating-point registers. We shouldn't be using it
ran_out_of_registers_for_arguments:
- saved_sp = read_sp ();
+ regcache_cooked_read_unsigned (regcache, SP_REGNUM, &saved_sp);
/* Location for 8 parameters are always reserved. */
sp -= wordsize * 8;