* frame.c (frame_read_unsigned_register): Delete function.
* frame.h (frame_read_unsigned_register): Delete declaration.
* sparc-tdep.c (sparc_init_extra_frame_info): Use
get_frame_register_unsigned.
(sparc_frame_saved_pc, sparc_pop_frame): Ditto.
* m68hc11-tdep.c (m68hc11_print_register): Ditto.
* d10v-tdep.c (d10v_print_registers_info): Ditto.
* frame.h (frame_read_register): Delete declaration.
* frame.c (frame_read_register): Delete function.
* arch-utils.c (legacy_register_to_value): Use get_frame_register.
* sparc-tdep.c (sparc_fetch_pointer_argument): Ditto.
* rs6000-tdep.c (rs6000_fetch_pointer_argument): Ditto.
* mips-tdep.c (mips_register_to_value): Ditto.
* hppa-tdep.c (hppa_fetch_pointer_argument): Ditto.
* d10v-tdep.c (d10v_print_registers_info): Ditto.
* frame.c (frame_read_signed_register): Delete function.
(frame_read_unsigned_register): Update comments.
* frame.h (frame_read_signed_register): Delete declaration.
* h8300-tdep.c (h8300_print_register): Use
get_frame_register_signed.
* m68hc11-tdep.c (m68hc11_print_register): Ditto.
2003-09-28 Andrew Cagney <cagney@redhat.com>
+ * frame.c (frame_read_unsigned_register): Delete function.
+ * frame.h (frame_read_unsigned_register): Delete declaration.
+ * sparc-tdep.c (sparc_init_extra_frame_info): Use
+ get_frame_register_unsigned.
+ (sparc_frame_saved_pc, sparc_pop_frame): Ditto.
+ * m68hc11-tdep.c (m68hc11_print_register): Ditto.
+ * d10v-tdep.c (d10v_print_registers_info): Ditto.
+
+ * frame.h (frame_read_register): Delete declaration.
+ * frame.c (frame_read_register): Delete function.
+ * arch-utils.c (legacy_register_to_value): Use get_frame_register.
+ * sparc-tdep.c (sparc_fetch_pointer_argument): Ditto.
+ * rs6000-tdep.c (rs6000_fetch_pointer_argument): Ditto.
+ * mips-tdep.c (mips_register_to_value): Ditto.
+ * hppa-tdep.c (hppa_fetch_pointer_argument): Ditto.
+ * d10v-tdep.c (d10v_print_registers_info): Ditto.
+
+ * frame.c (frame_read_signed_register): Delete function.
+ (frame_read_unsigned_register): Update comments.
+ * frame.h (frame_read_signed_register): Delete declaration.
+ * h8300-tdep.c (h8300_print_register): Use
+ get_frame_register_signed.
+ * m68hc11-tdep.c (m68hc11_print_register): Ditto.
+
* config/pa/tm-hppa.h (DEPRECATED_VALUE_RETURNED_FROM_STACK):
Rename VALUE_RETURNED_FROM_STACK.
* infcmd.c (print_return_value): Update.
struct type *type, void *to)
{
char from[MAX_REGISTER_SIZE];
- frame_read_register (frame, regnum, from);
+ get_frame_register (frame, regnum, from);
DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to);
}
{
ULONGEST pc, psw, rpt_s, rpt_e, rpt_c;
- frame_read_unsigned_register (frame, D10V_PC_REGNUM, &pc);
- frame_read_unsigned_register (frame, PSW_REGNUM, &psw);
- frame_read_unsigned_register (frame, frame_map_name_to_regnum (frame, "rpt_s", -1), &rpt_s);
- frame_read_unsigned_register (frame, frame_map_name_to_regnum (frame, "rpt_e", -1), &rpt_e);
- frame_read_unsigned_register (frame, frame_map_name_to_regnum (frame, "rpt_c", -1), &rpt_c);
+ pc = get_frame_register_unsigned (frame, D10V_PC_REGNUM);
+ psw = get_frame_register_unsigned (frame, PSW_REGNUM);
+ rpt_s = get_frame_register_unsigned (frame, frame_map_name_to_regnum (frame, "rpt_s", -1));
+ rpt_e = get_frame_register_unsigned (frame, frame_map_name_to_regnum (frame, "rpt_e", -1));
+ rpt_c = get_frame_register_unsigned (frame, frame_map_name_to_regnum (frame, "rpt_c", -1));
fprintf_filtered (file, "PC=%04lx (0x%lx) PSW=%04lx RPT_S=%04lx RPT_E=%04lx RPT_C=%04lx\n",
(long) pc, (long) d10v_make_iaddr (pc), (long) psw,
(long) rpt_s, (long) rpt_e, (long) rpt_c);
for (r = group; r < group + 8; r++)
{
ULONGEST tmp;
- frame_read_unsigned_register (frame, r, &tmp);
+ tmp = get_frame_register_unsigned (frame, r);
fprintf_filtered (file, " %04lx", (long) tmp);
}
fprintf_filtered (file, "\n");
{
int i;
fprintf_filtered (file, " ");
- frame_read_register (frame, a, num);
+ get_frame_register (frame, a, num);
for (i = 0; i < register_size (gdbarch, a); i++)
{
fprintf_filtered (file, "%02x", (num[i] & 0xff));
(*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
-void
-frame_read_register (struct frame_info *frame, int regnum, void *buf)
-{
- gdb_assert (frame != NULL && frame->next != NULL);
- frame_unwind_register (frame->next, regnum, buf);
-}
-
-void
-frame_read_unsigned_register (struct frame_info *frame, int regnum,
- ULONGEST *val)
-{
- /* NOTE: cagney/2002-10-31: There is a bit of dogma here - there is
- always a frame. Both this, and the equivalent
- frame_read_signed_register() function, can only be called with a
- valid frame. If, for some reason, this function is called
- without a frame then the problem isn't here, but rather in the
- caller. It should of first created a frame and then passed that
- in. */
- /* NOTE: cagney/2002-10-31: As a side bar, keep in mind that the
- ``current_frame'' should not be treated as a special case. While
- ``get_next_frame (current_frame) == NULL'' currently holds, it
- should, as far as possible, not be relied upon. In the future,
- ``get_next_frame (current_frame)'' may instead simply return a
- normal frame object that simply always gets register values from
- the register cache. Consequently, frame code should try to avoid
- tests like ``if get_next_frame() == NULL'' and instead just rely
- on recursive frame calls (like the below code) when manipulating
- a frame chain. */
- gdb_assert (frame != NULL && frame->next != NULL);
- frame_unwind_unsigned_register (frame->next, regnum, val);
-}
-
-void
-frame_read_signed_register (struct frame_info *frame, int regnum,
- LONGEST *val)
-{
- /* See note above in frame_read_unsigned_register(). */
- gdb_assert (frame != NULL && frame->next != NULL);
- frame_unwind_signed_register (frame->next, regnum, val);
-}
-
void
put_frame_register (struct frame_info *frame, int regnum, const void *buf)
{
CORE_ADDR *addrp, int *realnump,
void *valuep);
-/* More convenient interface to frame_register(). */
-/* NOTE: cagney/2002-09-13: Return void as one day these functions may
- be changed to return an indication that the read succeeded. */
-
-/* Use get_frame_register. */
-extern void frame_read_register (struct frame_info *frame, int regnum,
- void *buf);
-
-/* Use get_frame_register_signed. */
-extern void frame_read_signed_register (struct frame_info *frame,
- int regnum, LONGEST *val);
-
-/* Use get_frame_register_unsigned. */
-extern void frame_read_unsigned_register (struct frame_info *frame,
- int regnum, ULONGEST *val);
-
/* The reverse. Store a register value relative to the specified
frame. Note: this call makes the frame's state undefined. The
register and frame caches must be flushed. */
extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
/* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a
- function called frame_read_register_p(). This slightly weird (and
- older) variant of frame_read_register() returns zero (indicating
- the register is unavailable) if either: the register isn't cached;
- or the register has been optimized out. Problem is, neither check
- is exactly correct. A register can't be optimized out (it may not
+ function called get_frame_register_p(). This slightly weird (and
+ older) variant of get_frame_register() returns zero (indicating the
+ register is unavailable) if either: the register isn't cached; or
+ the register has been optimized out. Problem is, neither check is
+ exactly correct. A register can't be optimized out (it may not
have been saved as part of a function call); The fact that a
register isn't in the register cache doesn't mean that the register
isn't available (it could have been fetched from memory). */
if (!name || !*name)
return;
- frame_read_signed_register (frame, regno, &rval);
+ rval = get_frame_register_signed (frame, regno);
fprintf_filtered (file, "%-14s ", name);
if (regno == E_PSEUDO_CCR_REGNUM || (regno == E_PSEUDO_EXR_REGNUM && h8300smode))
struct type *type)
{
CORE_ADDR addr;
- frame_read_register (frame, R0_REGNUM + 26 - argi, &addr);
+ get_frame_register (frame, R0_REGNUM + 26 - argi, &addr);
return addr;
}
if (regno == HARD_PC_REGNUM || regno == HARD_SP_REGNUM
|| regno == SOFT_FP_REGNUM || regno == M68HC12_HARD_PC_REGNUM)
- frame_read_unsigned_register (frame, regno, &rval);
+ rval = get_frame_register_unsigned (frame, regno);
else
- frame_read_signed_register (frame, regno, &rval);
+ rval = get_frame_register_signed (frame, regno);
if (regno == HARD_A_REGNUM || regno == HARD_B_REGNUM
|| regno == HARD_CCR_REGNUM || regno == HARD_PAGE_REGNUM)
{
ULONGEST page;
- frame_read_unsigned_register (frame, HARD_PAGE_REGNUM, &page);
+ page = get_frame_register_unsigned (frame, HARD_PAGE_REGNUM);
fprintf_filtered (file, "0x%02x:%04x ", (unsigned) page,
(unsigned) rval);
}
mips_register_to_value (struct frame_info *frame, int regnum,
struct type *type, void *to)
{
- frame_read_register (frame, regnum + 0, (char *) to + 4);
- frame_read_register (frame, regnum + 1, (char *) to + 0);
+ get_frame_register (frame, regnum + 0, (char *) to + 4);
+ get_frame_register (frame, regnum + 1, (char *) to + 0);
}
static void
struct type *type)
{
CORE_ADDR addr;
- frame_read_register (frame, 3 + argi, &addr);
+ get_frame_register (frame, 3 + argi, &addr);
return addr;
}
{
/* Should we adjust for stack bias here? */
ULONGEST tmp;
- frame_read_unsigned_register (fi, DEPRECATED_FP_REGNUM, &tmp);
+ tmp = get_frame_register_unsigned (fi, DEPRECATED_FP_REGNUM);
deprecated_update_frame_base_hack (fi, tmp);
if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
/* Overwrite the frame's address with the value in %i7. */
{
ULONGEST tmp;
- frame_read_unsigned_register (fi, I7_REGNUM, &tmp);
+ tmp = get_frame_register_unsigned (fi, I7_REGNUM);
deprecated_update_frame_base_hack (fi, tmp);
}
/* The sigcontext address is contained in register O2. */
{
ULONGEST tmp;
- frame_read_unsigned_register (frame, O0_REGNUM + 2, &tmp);
+ tmp = get_frame_register_unsigned (frame, O0_REGNUM + 2);
sigcontext_addr = tmp;
}
/* A frameless function interrupted by a signal did not save
the PC, it is still in %o7. */
ULONGEST tmp;
- frame_read_unsigned_register (frame, O7_REGNUM, &tmp);
+ tmp = get_frame_register_unsigned (frame, O7_REGNUM);
return PC_ADJUST (tmp);
}
if (get_frame_extra_info (frame)->flat)
it is a complicated way of saying
"pc = read_register (O7_REGNUM);". */
ULONGEST tmp;
- frame_read_unsigned_register (frame, O7_REGNUM, &tmp);
+ tmp = get_frame_register_unsigned (frame, O7_REGNUM);
pc = PC_ADJUST (tmp);
}
struct type *type)
{
CORE_ADDR addr;
- frame_read_register (frame, O0_REGNUM + argi, &addr);
+ get_frame_register (frame, O0_REGNUM + argi, &addr);
return addr;
}
if (target_has_registers)
{
- frame_read_register (frame, regNum, regValue);
+ get_frame_register (frame, regNum, regValue);
/* NOTE: cagney/2003-03-13: This is bogus. It is refering to
the register cache and not the frame which could have pulled
the register value off the stack. */