aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog139
-rw-r--r--gdb/alpha-tdep.c3
-rw-r--r--gdb/arm-tdep.c2
-rw-r--r--gdb/avr-tdep.c2
-rw-r--r--gdb/breakpoint.c2
-rw-r--r--gdb/config/pa/tm-hppa.h2
-rw-r--r--gdb/config/sparc/tm-sparc.h16
-rw-r--r--gdb/cris-tdep.c4
-rw-r--r--gdb/d10v-tdep.c120
-rw-r--r--gdb/doc/ChangeLog11
-rw-r--r--gdb/doc/gdbint.texinfo18
-rw-r--r--gdb/dummy-frame.c109
-rw-r--r--gdb/findvar.c18
-rw-r--r--gdb/frame-unwind.c9
-rw-r--r--gdb/frame-unwind.h110
-rw-r--r--gdb/frame.c423
-rw-r--r--gdb/frame.h31
-rw-r--r--gdb/frv-tdep.c3
-rw-r--r--gdb/gdbarch.c140
-rw-r--r--gdb/gdbarch.h80
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/h8300-tdep.c2
-rw-r--r--gdb/hppa-tdep.c2
-rw-r--r--gdb/i386-tdep.c8
-rw-r--r--gdb/ia64-tdep.c6
-rw-r--r--gdb/m68hc11-tdep.c6
-rw-r--r--gdb/m68k-tdep.c2
-rw-r--r--gdb/mcore-tdep.c2
-rw-r--r--gdb/mi/ChangeLog5
-rw-r--r--gdb/mi/mi-main.c9
-rw-r--r--gdb/mips-tdep.c4
-rw-r--r--gdb/mn10300-tdep.c2
-rw-r--r--gdb/ns32k-tdep.c2
-rw-r--r--gdb/regcache.h2
-rw-r--r--gdb/rs6000-tdep.c2
-rw-r--r--gdb/s390-tdep.c2
-rw-r--r--gdb/sentinel-frame.c32
-rw-r--r--gdb/sh-tdep.c8
-rw-r--r--gdb/sparc-tdep.c53
-rw-r--r--gdb/stack.c10
-rw-r--r--gdb/tui/ChangeLog9
-rw-r--r--gdb/tui/tui-out.c2
-rw-r--r--gdb/tui/tuiRegs.c8
-rw-r--r--gdb/v850-tdep.c2
-rw-r--r--gdb/valops.c2
-rw-r--r--gdb/vax-tdep.c3
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/x86-64-tdep.c4
-rw-r--r--gdb/xstormy16-tdep.c24
49 files changed, 910 insertions, 551 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c9ec531..bec734b8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,142 @@
+2003-03-17 Andrew Cagney <cagney@redhat.com>
+
+ Fix frame off-by-one bug.
+ * frame-unwind.h (frame_this_id_ftype): Replace
+ frame_unwind_id_ftype.
+ (frame_prev_register_ftype): Replace frame_unwind_reg_ftype.
+ (struct frame_unwind): Replace "id" with "this_id". Replace "reg"
+ with "prev_register".
+ * frame-unwind.c (frame_unwind_find_by_pc): Return
+ legacy_saved_regs_unwind instead of trad_frame_unwind. Update
+ comment.
+ * dummy-frame.c (cached_find_dummy_frame): Delete function.
+ (dummy_frame_this_id): Replace dummy_frame_id_unwind.
+ (dummy_frame_prev_register): Replace dummy_frame_register_unwind.
+ (dummy_frame_unwind): Update.
+ * sentinel-frame.c (sentinel_frame_prev_register): Replace
+ sentinel_frame_register_unwind.
+ (sentinel_frame_this_id): Replace sentinel_frame_id_unwind.
+ (sentinel_frame_unwinder): Update.
+ * frame.h (legacy_saved_regs_unwind): Replace trad_frame_unwind.
+ (struct frame_info): Rename "unwind_cache" to "prologue_cache".
+ * frame.c (create_sentinel_frame): Update. Initialize
+ "prologue_cache" instead of "unwind_cache".
+ (frame_register_unwind): Call this frame's prev_register with the
+ next frame and this frame's prologue cache.
+ (get_prev_frame): Simplify. Always call prev frame's this_id with
+ this frame and prev frame's prologue cache. Document that this
+ call is shifted one to the left when compared to the
+ frame_register_unwind call.
+ (legacy_saved_regs_prev_register): Replace
+ frame_saved_regs_register_unwind.
+ (legacy_saved_regs_this_id): Replace frame_saved_regs_id_unwind.
+ (legacy_saved_regs_unwinder): Replace trad_frame_unwinder.
+ (legacy_saved_regs_unwind): Replace trad_frame_unwind.
+ * d10v-tdep.c (d10v_frame_this_id): Replace d10v_frame_id_unwind.
+ (d10v_frame_unwind): Update.
+ (d10v_frame_prev_register): Replace d10v_frame_register_unwind.
+ (d10v_frame_unwind_cache): Replace this "fi" with "next_frame".
+ (saved_regs_unwinder): Replace this "frame" with "next_frame", and
+ "saved_regs" with "this_saved_regs".
+
+2003-03-16 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (frame_pop): Don't call target_store_registers. Fix
+ problem reported by Mark Kettenis.
+
+2003-03-16 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_register_type): Renamed from
+ i386_register_virtual_type. Adjust function signature.
+ (i386_gdbarch_init): Set register_type instead of
+ deprecated_max_register_raw_size,
+ deprecated_max_register_virtual_size and register_virtual_type.
+
+2003-03-14 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (get_prev_frame): When a legacy frame, always call
+ legacy_get_prev_frame. Simplify unwind code using assumption that
+ the unwinder is new.
+ (legacy_get_prev_frame): Handle legacy sentinel frame unwind here.
+ (legacy_frame_p): When no gdbarch_unwind_dummy_id, or
+ SAVED_DUMMY_FRAME_TOS, assume a legacy frame.
+
+2003-03-14 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (get_saved_register): Delete function.
+ * frame.h (get_saved_register): Delete declaration.
+ * xstormy16-tdep.c: Update comment.
+ * regcache.h: Update comments.
+ * sparc-tdep.c (sparc_init_extra_frame_info): Instead of
+ get_saved_register and extract_address, use
+ frame_read_unsigned_register.
+ (sparc_frame_saved_pc): Ditto.
+ (sparc_get_saved_register): Instead of get_saved_register, use
+ frame_register.
+ (sparc_pop_frame): Ditto.
+ * findvar.c: Update comments.
+ (value_of_register): Call frame_register instead of
+ get_saved_register.
+ (value_from_register): Ditto.
+ * config/sparc/tm-sparc.h: Update comment.
+ * breakpoint.c: Update comment.
+
+2003-03-14 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_GET_SAVED_REGISTER): Replace
+ GET_SAVED_REGISTER.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * frame.h: Update comments.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * x86-64-tdep.c (x86_64_init_abi): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * mips-tdep.c (mips_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * frame.c (frame_register): Update.
+ (get_saved_register): Update.
+ * config/sparc/tm-sparc.h (DEPRECATED_GET_SAVED_REGISTER): Update.
+
+2003-03-13 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_POP_FRAME): Replace POP_FRAME.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * valops.c (hand_function_call): Update comment.
+ * stack.c (return_command): Update comment.
+ * config/sparc/tm-sparc.h (DEPRECATED_POP_FRAME): Update.
+ * config/pa/tm-hppa.h (DEPRECATED_POP_FRAME): Update.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * x86-64-tdep.c (x86_64_init_abi): Update.
+ * vax-tdep.c (vax_gdbarch_init): Update.
+ * v850-tdep.c (v850_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Update.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Update.
+ * mips-tdep.c (mips_gdbarch_init): Update.
+ * mcore-tdep.c (mcore_gdbarch_init): Update.
+ * m68k-tdep.c (m68k_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * i386-tdep.c (i386_gdbarch_init): Update.
+ * hppa-tdep.c (hppa_gdbarch_init): Update.
+ * h8300-tdep.c (h8300_gdbarch_init): Update.
+ * frv-tdep.c (frv_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * avr-tdep.c (avr_gdbarch_init): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * alpha-tdep.c (alpha_gdbarch_init): Update.
+
+2003-03-13 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (legacy_frame_p): New function.
+ (get_prev_frame): Use legacy_frame_p.
+ * frame.h (legacy_frame_p): Declare.
+
2003-03-13 D. Venkatasubramanian <dvenkat@noida.hcltech.com>
* MAINTAINERS (write after approval): Alphabetically
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 43c2273..57cd893 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -70,7 +70,6 @@ static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call;
static gdbarch_frame_chain_ftype alpha_frame_chain;
static gdbarch_push_arguments_ftype alpha_push_arguments;
-static gdbarch_pop_frame_ftype alpha_pop_frame;
static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
@@ -1857,7 +1856,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_push_arguments (gdbarch, alpha_push_arguments);
- set_gdbarch_pop_frame (gdbarch, alpha_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, alpha_pop_frame);
/* On the Alpha, the call dummy code is never copied to user space,
stopping the user call is achieved via a bp_call_dummy breakpoint.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 9305105..e1d19c8 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -2915,7 +2915,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_num_args (gdbarch, arm_frame_num_args);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs);
- set_gdbarch_pop_frame (gdbarch, arm_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, arm_pop_frame);
/* Address manipulation. */
set_gdbarch_smash_text_address (gdbarch, arm_smash_text_address);
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index a242d6b..75707fe 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1183,7 +1183,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
set_gdbarch_push_arguments (gdbarch, avr_push_arguments);
set_gdbarch_push_return_address (gdbarch, avr_push_return_address);
- set_gdbarch_pop_frame (gdbarch, avr_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, avr_pop_frame);
set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return);
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 1ff80d7..491766d 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1679,7 +1679,7 @@ breakpoint_inserted_here_p (CORE_ADDR pc)
/* Return nonzero if FRAME is a dummy frame. We can't use
DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would
- take too much time, at least using get_saved_register on the 68k.
+ take too much time, at least using frame_register() on the 68k.
This means that for this function to work right a port must use the
bp_call_dummy breakpoint. */
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 4616bdd..4b196dc 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -463,7 +463,7 @@ extern void hppa_push_dummy_frame (struct inferior_status *);
/* Discard from the stack the innermost frame,
restoring all saved registers. */
#if !GDB_MULTI_ARCH
-#define POP_FRAME hppa_pop_frame ()
+#define DEPRECATED_POP_FRAME hppa_pop_frame ()
extern void hppa_pop_frame (void);
#endif
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index f0267d0..8ab7401 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -199,10 +199,10 @@ extern int sparc_intreg_size (void);
stack rather than with the other registers, and this causes hair
and confusion in places like pop_frame. It might be better to
remove the ins and locals from `registers', make sure that
- get_saved_register can get them from the stack (even in the
- innermost frame), and make this the way to access them. For the
- frame pointer we would do that via TARGET_READ_FP. On the other
- hand, that is likely to be confusing or worse for flat frames. */
+ frame_register() can get them from the stack (even in the innermost
+ frame), and make this the way to access them. For the frame
+ pointer we would do that via TARGET_READ_FP. On the other hand,
+ that is likely to be confusing or worse for flat frames. */
#define REGISTER_BYTES (32*4+32*4+8*4)
@@ -453,8 +453,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
/* time of the register saves. */ \
int sp_offset;
-/* We need to override GET_SAVED_REGISTER so that we can deal with the
- way outs change into ins in different frames. */
+/* We need to override DEPRECATED_GET_SAVED_REGISTER so that we can
+ deal with the way outs change into ins in different frames. */
void sparc_get_saved_register (char *raw_buffer,
int *optimized,
@@ -462,7 +462,7 @@ void sparc_get_saved_register (char *raw_buffer,
struct frame_info *frame,
int regnum, enum lval_type *lvalp);
-#define GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
+#define DEPRECATED_GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
sparc_get_saved_register (RAW_BUFFER, OPTIMIZED, ADDRP, \
FRAME, REGNUM, LVAL)
@@ -683,7 +683,7 @@ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
/* Push an empty stack frame, to record the current PC, etc. */
#define DEPRECATED_PUSH_DUMMY_FRAME sparc_push_dummy_frame ()
-#define POP_FRAME sparc_pop_frame ()
+#define DEPRECATED_POP_FRAME sparc_pop_frame ()
void sparc_push_dummy_frame (void);
void sparc_pop_frame (void);
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index fae9958..c71c12f 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -4279,13 +4279,13 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
/* No register requires conversion from raw format to virtual format. */
set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not);
set_gdbarch_push_return_address (gdbarch, cris_push_return_address);
- set_gdbarch_pop_frame (gdbarch, cris_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame);
set_gdbarch_store_struct_return (gdbarch, cris_store_struct_return);
set_gdbarch_deprecated_extract_struct_value_address
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index b60ce7f..f443cef 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -705,8 +705,8 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op,
for it IS the sp for the next frame. */
struct d10v_unwind_cache *
-d10v_frame_unwind_cache (struct frame_info *fi,
- void **cache)
+d10v_frame_unwind_cache (struct frame_info *next_frame,
+ void **this_prologue_cache)
{
CORE_ADDR pc;
ULONGEST prev_sp;
@@ -716,18 +716,18 @@ d10v_frame_unwind_cache (struct frame_info *fi,
int i;
struct d10v_unwind_cache *info;
- if ((*cache))
- return (*cache);
+ if ((*this_prologue_cache))
+ return (*this_prologue_cache);
info = FRAME_OBSTACK_ZALLOC (struct d10v_unwind_cache);
- (*cache) = info;
+ (*this_prologue_cache) = info;
info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
info->size = 0;
info->return_pc = 0;
info->sp_offset = 0;
- pc = get_pc_function_start (get_frame_pc (fi));
+ pc = get_pc_function_start (frame_pc_unwind (next_frame));
info->uses_frame = 0;
while (1)
@@ -788,7 +788,7 @@ d10v_frame_unwind_cache (struct frame_info *fi,
/* The SP was moved to the FP. This indicates that a new frame
was created. Get THIS frame's FP value by unwinding it from
the next frame. */
- frame_read_unsigned_register (fi, FP_REGNUM, &this_base);
+ frame_unwind_unsigned_register (next_frame, FP_REGNUM, &this_base);
/* The FP points at the last saved register. Adjust the FP back
to before the first saved register giving the SP. */
prev_sp = this_base + info->size;
@@ -806,7 +806,7 @@ d10v_frame_unwind_cache (struct frame_info *fi,
{
/* Assume that the FP is this frame's SP but with that pushed
stack space added back. */
- frame_read_unsigned_register (fi, SP_REGNUM, &this_base);
+ frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
prev_sp = this_base + info->size;
}
@@ -831,7 +831,7 @@ d10v_frame_unwind_cache (struct frame_info *fi,
else
{
ULONGEST return_pc;
- frame_read_unsigned_register (fi, LR_REGNUM, &return_pc);
+ frame_unwind_unsigned_register (next_frame, LR_REGNUM, &return_pc);
info->return_pc = d10v_make_iaddr (return_pc);
}
@@ -1457,58 +1457,55 @@ d10v_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
frame. This will be used to create a new GDB frame struct. */
static void
-d10v_frame_id_unwind (struct frame_info *frame,
- void **cache,
- struct frame_id *id)
+d10v_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
{
- struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache);
- CORE_ADDR addr;
+ struct d10v_unwind_cache *info
+ = d10v_frame_unwind_cache (next_frame, this_prologue_cache);
+ CORE_ADDR base;
+ CORE_ADDR pc;
/* Start with a NULL frame ID. */
- (*id) = null_frame_id;
+ (*this_id) = null_frame_id;
- if (info->return_pc == IMEM_START
- || info->return_pc <= IMEM_START
- || inside_entry_file (info->return_pc))
- {
- /* This is meant to halt the backtrace at "_start".
- Make sure we don't halt it at a generic dummy frame. */
- return;
- }
+ /* The PC is easy. */
+ pc = frame_pc_unwind (next_frame);
- if (!info->saved_regs[FP_REGNUM])
- {
- if (!info->saved_regs[SP_REGNUM]
- || info->saved_regs[SP_REGNUM] == STACK_START)
- return;
+ /* This is meant to halt the backtrace at "_start". Make sure we
+ don't halt it at a generic dummy frame. */
+ if (pc == IMEM_START || pc <= IMEM_START || inside_entry_file (pc))
+ return;
- id->base = info->saved_regs[SP_REGNUM];
- id->pc = info->return_pc;
- }
+ /* Hopefully the prologue analysis either correctly determined the
+ frame's base (which is the SP from the previous frame), or set
+ that base to "NULL". */
+ base = info->base;
+ if (base == STACK_START || base == 0)
+ return;
- addr = read_memory_unsigned_integer (info->saved_regs[FP_REGNUM],
- register_size (current_gdbarch, FP_REGNUM));
- if (addr == 0)
+ /* Check that we're not going round in circles with the same frame
+ ID (but avoid applying the test to sentinel frames which do go
+ round in circles). Can't use frame_id_eq() as that doesn't yet
+ compare the frame's PC value. */
+ if (frame_relative_level (next_frame) >= 0
+ && get_frame_type (next_frame) != DUMMY_FRAME
+ && get_frame_id (next_frame).pc == pc
+ && get_frame_id (next_frame).base == base)
return;
- id->base = d10v_make_daddr (addr);
- id->pc = info->return_pc;
+ this_id->base = base;
+ this_id->pc = pc;
}
static void
-saved_regs_unwinder (struct frame_info *frame,
- CORE_ADDR *saved_regs,
+saved_regs_unwinder (struct frame_info *next_frame,
+ CORE_ADDR *this_saved_regs,
int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp,
int *realnump, void *bufferp)
{
- /* If we're using generic dummy frames, we'd better not be in a call
- dummy. (generic_call_dummy_register_unwind ought to have been called
- instead.) */
- gdb_assert (!(DEPRECATED_USE_GENERIC_DUMMY_FRAMES
- && (get_frame_type (frame) == DUMMY_FRAME)));
-
- if (saved_regs[regnum] != 0)
+ if (this_saved_regs[regnum] != 0)
{
if (regnum == SP_REGNUM)
{
@@ -1519,7 +1516,7 @@ saved_regs_unwinder (struct frame_info *frame,
*realnump = -1;
if (bufferp != NULL)
store_address (bufferp, register_size (current_gdbarch, regnum),
- saved_regs[regnum]);
+ this_saved_regs[regnum]);
}
else
{
@@ -1527,12 +1524,12 @@ saved_regs_unwinder (struct frame_info *frame,
a local copy of its value. */
*optimizedp = 0;
*lvalp = lval_memory;
- *addrp = saved_regs[regnum];
+ *addrp = this_saved_regs[regnum];
*realnump = -1;
if (bufferp != NULL)
{
/* Read the value in from memory. */
- read_memory (saved_regs[regnum], bufferp,
+ read_memory (this_saved_regs[regnum], bufferp,
register_size (current_gdbarch, regnum));
}
}
@@ -1543,38 +1540,39 @@ saved_regs_unwinder (struct frame_info *frame,
value. If a value is needed, pass the request on down the chain;
otherwise just return an indication that the value is in the same
register as the next frame. */
- frame_register (frame, regnum, optimizedp, lvalp, addrp,
- realnump, bufferp);
+ frame_register_unwind (next_frame, regnum, optimizedp, lvalp, addrp,
+ realnump, bufferp);
}
static void
-d10v_frame_register_unwind (struct frame_info *frame,
- void **cache,
- int regnum, int *optimizedp,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *bufferp)
-{
- struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache);
+d10v_frame_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
+{
+ struct d10v_unwind_cache *info
+ = d10v_frame_unwind_cache (next_frame, this_prologue_cache);
if (regnum == PC_REGNUM)
{
/* The call instruction saves the caller's PC in LR. The
function prologue of the callee may then save the LR on the
stack. Find that possibly saved LR value and return it. */
- saved_regs_unwinder (frame, info->saved_regs, LR_REGNUM, optimizedp,
+ saved_regs_unwinder (next_frame, info->saved_regs, LR_REGNUM, optimizedp,
lvalp, addrp, realnump, bufferp);
}
else
{
- saved_regs_unwinder (frame, info->saved_regs, regnum, optimizedp,
+ saved_regs_unwinder (next_frame, info->saved_regs, regnum, optimizedp,
lvalp, addrp, realnump, bufferp);
}
}
static struct frame_unwind d10v_frame_unwind = {
- d10v_frame_id_unwind,
- d10v_frame_register_unwind
+ d10v_frame_this_id,
+ d10v_frame_prev_register
};
const struct frame_unwind *
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index c6e1c61..982322d 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,5 +1,16 @@
2003-03-12 Andrew Cagney <cagney@redhat.com>
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ references to get_saved_register. Rename GET_SAVED_REGISTER to
+ DEPRECATED_GET_SAVED_REGISTER.
+
+2003-03-13 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ POP_FRAME with DEPRECATED_POP_FRAME. Update description.
+
+2003-03-12 Andrew Cagney <cagney@redhat.com>
+
* gdbint.texinfo (Target Architecture Definition): Rename
FRAME_SAVED_PC to DEPRECATED_FRAME_SAVED_PC.
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 60d6c9d..186d9e7 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -3352,11 +3352,10 @@ assuming that we have just stopped at a @code{longjmp} breakpoint. It takes a
@code{CORE_ADDR *} as argument, and stores the target PC value through this
pointer. It examines the current state of the machine as needed.
-@item GET_SAVED_REGISTER
-@findex GET_SAVED_REGISTER
-@findex get_saved_register
+@item DEPRECATED_GET_SAVED_REGISTER
+@findex DEPRECATED_GET_SAVED_REGISTER
Define this if you need to supply your own definition for the function
-@code{get_saved_register}.
+@code{DEPRECATED_GET_SAVED_REGISTER}.
@item IBM6000_TARGET
@findex IBM6000_TARGET
@@ -3680,12 +3679,11 @@ A hook defined for XCOFF reading.
If defined, this is the number of the processor status register. (This
definition is only used in generic code when parsing "$ps".)
-@item POP_FRAME
-@findex POP_FRAME
-@findex call_function_by_hand
-@findex return_command
-Used in @samp{call_function_by_hand} to remove an artificial stack
-frame and in @samp{return_command} to remove a real stack frame.
+@item DEPRECATED_POP_FRAME
+@findex DEPRECATED_POP_FRAME
+@findex frame_pop
+If defined, used by @code{frame_pop} to remove a stack frame. This
+method has been superseeded by generic code.
@item PUSH_ARGUMENTS (@var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr})
@findex PUSH_ARGUMENTS
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index bf4a31c..3f7746f 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -30,6 +30,10 @@
#include "gdb_assert.h"
#include "frame-unwind.h"
+static void dummy_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id);
+
/* Dummy frame. This saves the processor state just prior to setting
up the inferior function call. Older targets save the registers
on the target stack (but that really slows down function calls). */
@@ -104,14 +108,6 @@ find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
return NULL;
}
-struct dummy_frame *
-cached_find_dummy_frame (struct frame_info *frame, void **cache)
-{
- if ((*cache) == NULL)
- (*cache) = find_dummy_frame (get_frame_pc (frame), get_frame_base (frame));
- return (*cache);
-}
-
struct regcache *
generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
@@ -313,12 +309,19 @@ generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
register value is taken from the local copy of the register buffer. */
static void
-dummy_frame_register_unwind (struct frame_info *frame, void **cache,
- int regnum, int *optimized,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnum, void *bufferp)
+dummy_frame_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimized,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnum, void *bufferp)
{
- struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache);
+ struct dummy_frame *dummy;
+ struct frame_id id;
+
+ /* Call the ID method which, if at all possible, will set the
+ prologue cache. */
+ dummy_frame_this_id (next_frame, this_prologue_cache, &id);
+ dummy = (*this_prologue_cache);
gdb_assert (dummy != NULL);
/* Describe the register's location. Generic dummy frames always
@@ -339,28 +342,80 @@ dummy_frame_register_unwind (struct frame_info *frame, void **cache,
}
}
-/* Assuming that FRAME is a dummy, return the ID of the calling frame
- (the frame that the dummy has the saved state of). */
+/* Assuming that THIS frame is a dummy (remember, the NEXT and not
+ THIS frame is passed in), return the ID of THIS frame. That ID is
+ determined by examining the NEXT frame's unwound registers using
+ the method unwind_dummy_id(). As a side effect, THIS dummy frame's
+ dummy cache is located and and saved in THIS_PROLOGUE_CACHE. */
static void
-dummy_frame_id_unwind (struct frame_info *frame,
- void **cache,
- struct frame_id *id)
+dummy_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
{
- struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache);
- /* Oops! In a dummy-frame but can't find the stack dummy. Pretend
- that the frame doesn't unwind. Should this function instead
- return a has-no-caller indication? */
- if (dummy == NULL)
- (*id) = null_frame_id;
+ struct dummy_frame *dummy = (*this_prologue_cache);
+ if (dummy != NULL)
+ {
+ (*this_id) = dummy->id;
+ return;
+ }
+ /* When unwinding a normal frame, the stack structure is determined
+ by analyzing the frame's function's code (be it using brute force
+ prologue analysis, or the dwarf2 CFI). In the case of a dummy
+ frame, that simply isn't possible. The The PC is either the
+ program entry point, or some random address on the stack. Trying
+ to use that PC to apply standard frame ID unwind techniques is
+ just asking for trouble. */
+ if (gdbarch_unwind_dummy_id_p (current_gdbarch))
+ {
+ /* Assume hand_function_call(), via SAVE_DUMMY_FRAME_TOS,
+ previously saved the dummy frame's ID. Things only work if
+ the two return the same value. */
+ gdb_assert (SAVE_DUMMY_FRAME_TOS_P ());
+ /* Use an architecture specific method to extract the prev's
+ dummy ID from the next frame. Note that this method uses
+ frame_register_unwind to obtain the register values needed to
+ determine the dummy frame's ID. */
+ (*this_id) = gdbarch_unwind_dummy_id (current_gdbarch, next_frame);
+ }
+ else if (frame_relative_level (next_frame) < 0)
+ {
+ /* We're unwinding a sentinel frame, the PC of which is pointing
+ at a stack dummy. Fake up the dummy frame's ID using the
+ same sequence as is found a traditional unwinder. Once all
+ architectures supply the unwind_dummy_id method, this code
+ can go away. */
+ (*this_id).base = read_fp ();
+ (*this_id).pc = read_pc ();
+ }
+ else if (legacy_frame_p (current_gdbarch)
+ && get_prev_frame (next_frame))
+ {
+ /* Things are looking seriously grim! Assume that the legacy
+ get_prev_frame code has already created THIS frame and linked
+ it in to the frame chain (a pretty bold assumption), extract
+ the ID from THIS base / pc. */
+ (*this_id).base = get_frame_base (get_prev_frame (next_frame));
+ (*this_id).pc = get_frame_pc (get_prev_frame (next_frame));
+ }
else
- (*id) = dummy->id;
+ {
+ /* Outch! We're not trying to find the innermost frame's ID yet
+ we're trying to unwind to a dummy. The architecture must
+ provide the unwind_dummy_id() method. Abandon the unwind
+ process but only after first warning the user. */
+ internal_warning (__FILE__, __LINE__,
+ "Missing unwind_dummy_id architecture method");
+ (*this_id) = null_frame_id;
+ return;
+ }
+ (*this_prologue_cache) = find_dummy_frame ((*this_id).pc, (*this_id).base);
}
static struct frame_unwind dummy_frame_unwind =
{
- dummy_frame_id_unwind,
- dummy_frame_register_unwind
+ dummy_frame_this_id,
+ dummy_frame_prev_register
};
const struct frame_unwind *
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 38d01cd..93c4d8a 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -299,6 +299,7 @@ value_of_register (int regnum, struct frame_info *frame)
CORE_ADDR addr;
int optim;
struct value *reg_val;
+ int realnum;
char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
enum lval_type lval;
@@ -307,8 +308,7 @@ value_of_register (int regnum, struct frame_info *frame)
if (regnum >= NUM_REGS + NUM_PSEUDO_REGS)
return value_of_builtin_reg (regnum, frame);
- get_saved_register (raw_buffer, &optim, &addr,
- frame, regnum, &lval);
+ frame_register (frame, regnum, &optim, &lval, &addr, &realnum, raw_buffer);
/* FIXME: cagney/2002-05-15: This test is just bogus.
@@ -780,12 +780,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
(value_bytes_copied += REGISTER_RAW_SIZE (local_regnum),
++local_regnum))
{
- get_saved_register (value_bytes + value_bytes_copied,
- &optim,
- &addr,
- frame,
- local_regnum,
- &lval);
+ int realnum;
+ frame_register (frame, local_regnum, &optim, &lval, &addr,
+ &realnum, value_bytes + value_bytes_copied);
if (register_cached (local_regnum) == -1)
return NULL; /* register value not available */
@@ -851,7 +848,10 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
register's contents in a real register or in core;
read the data in raw format. */
- get_saved_register (raw_buffer, &optim, &addr, frame, regnum, &lval);
+ {
+ int realnum;
+ frame_register (frame, regnum, &optim, &lval, &addr, &realnum, raw_buffer);
+ }
if (register_cached (regnum) == -1)
return NULL; /* register value not available */
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index a889f95..c72d24a 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -83,16 +83,19 @@ frame_unwind_find_by_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
int i;
struct frame_unwind_table *table =
gdbarch_data (gdbarch, frame_unwind_data);
- /* Seriously old code. Don't even try to use this new mechanism. */
if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
- return trad_frame_unwind;
+ /* Seriously old code. Don't even try to use this new mechanism.
+ (Note: The variable USE_GENERIC_DUMMY_FRAMES is deprecated, not
+ the dummy frame mechanism. All architectures should be using
+ generic dummy frames). */
+ return legacy_saved_regs_unwind;
for (i = 0; i < table->nr; i++)
{
const struct frame_unwind *desc = table->p[i] (pc);
if (desc != NULL)
return desc;
}
- return trad_frame_unwind;
+ return legacy_saved_regs_unwind;
}
void
diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h
index 5d85efe..099f9de 100644
--- a/gdb/frame-unwind.h
+++ b/gdb/frame-unwind.h
@@ -47,42 +47,92 @@ extern const struct frame_unwind *frame_unwind_find_by_pc (struct gdbarch
*gdbarch,
CORE_ADDR pc);
-/* Return the location (and possibly value) of REGNUM for the previous
- (older, up) frame. All parameters except VALUEP can be assumed to
- be non NULL. When VALUEP is NULL, just the location of the
- register should be returned.
-
- UNWIND_CACHE is provided as mechanism for implementing a per-frame
- local cache. It's initial value being NULL. Memory for that cache
- should be allocated using frame_obstack_zalloc().
-
- Register window architectures (eg SPARC) should note that REGNUM
- identifies the register for the previous frame. For instance, a
- request for the value of "o1" for the previous frame would be found
- in the register "i1" in this FRAME. */
-
-typedef void (frame_unwind_reg_ftype) (struct frame_info * frame,
- void **unwind_cache,
- int regnum,
- int *optimized,
- enum lval_type * lvalp,
- CORE_ADDR *addrp,
- int *realnump, void *valuep);
-
-/* Same as for registers above, but return the ID of the frame that
- called this one. */
-
-typedef void (frame_unwind_id_ftype) (struct frame_info * frame,
- void **unwind_cache,
- struct frame_id * id);
+/* The following unwind functions assume a chain of frames forming the
+ sequence: (outer) prev <-> this <-> next (inner). All the
+ functions are called with called with the next frame's `struct
+ frame_info' and and this frame's prologue cache.
+
+ THIS frame's register values can be obtained by unwinding NEXT
+ frame's registers (a recursive operation).
+
+ THIS frame's prologue cache can be used to cache information such
+ as where this frame's prologue stores the previous frame's
+ registers. */
+
+/* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
+ use the NEXT frame, and its register unwind method, to determine
+ the frame ID of THIS frame.
+
+ A frame ID provides an invariant that can be used to re-identify an
+ instance of a frame. It is a combination of the frame's `base' and
+ the frame's function's code address.
+
+ Traditionally, THIS frame's ID was determined by examining THIS
+ frame's function's prologue, and identifying the register/offset
+ used as THIS frame's base.
+
+ Example: An examination of THIS frame's prologue reveals that, on
+ entry, it saves the PC(+12), SP(+8), and R1(+4) registers
+ (decrementing the SP by 12). Consequently, the frame ID's base can
+ be determined by adding 12 to the THIS frame's stack-pointer, and
+ the value of THIS frame's SP can be obtained by unwinding the NEXT
+ frame's SP.
+
+ THIS_PROLOGUE_CACHE can be used to share any prolog analysis data
+ with the other unwind methods. Memory for that cache should be
+ allocated using frame_obstack_zalloc(). */
+
+typedef void (frame_this_id_ftype) (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id);
+
+/* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
+ use the NEXT frame, and its register unwind method, to unwind THIS
+ frame's registers (returning the value of the specified register
+ REGNUM in the previous frame).
+
+ Traditionally, THIS frame's registers were unwound by examining
+ THIS frame's function's prologue and identifying which registers
+ that prolog code saved on the stack.
+
+ Example: An examination of THIS frame's prologue reveals that, on
+ entry, it saves the PC(+12), SP(+8), and R1(+4) registers
+ (decrementing the SP by 12). Consequently, the value of the PC
+ register in the previous frame is found in memory at SP+12, and
+ THIS frame's SP can be obtained by unwinding the NEXT frame's SP.
+
+ Why not pass in THIS_FRAME? By passing in NEXT frame and THIS
+ cache, the supplied parameters are consistent with the sibling
+ function THIS_ID.
+
+ Can the code call ``frame_register (get_prev_frame (NEXT_FRAME))''?
+ Won't the call frame_register (THIS_FRAME) be faster? Well,
+ ignoring the possability that the previous frame does not yet
+ exist, the ``frame_register (FRAME)'' function is expanded to
+ ``frame_register_unwind (get_next_frame (FRAME)'' and hence that
+ call will expand to ``frame_register_unwind (get_next_frame
+ (get_prev_frame (NEXT_FRAME)))''. Might as well call
+ ``frame_register_unwind (NEXT_FRAME)'' directly.
+
+ THIS_PROLOGUE_CACHE can be used to share any prolog analysis data
+ with the other unwind methods. Memory for that cache should be
+ allocated using frame_obstack_zalloc(). */
+
+typedef void (frame_prev_register_ftype) (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int prev_regnum,
+ int *optimized,
+ enum lval_type * lvalp,
+ CORE_ADDR *addrp,
+ int *realnump, void *valuep);
struct frame_unwind
{
/* Should the frame's type go here? */
/* Should an attribute indicating the frame's address-in-block go
here? */
- frame_unwind_id_ftype *id;
- frame_unwind_reg_ftype *reg;
+ frame_this_id_ftype *this_id;
+ frame_prev_register_ftype *prev_register;
};
#endif
diff --git a/gdb/frame.c b/gdb/frame.c
index 267d484..900b515 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -198,12 +198,12 @@ frame_pop (struct frame_info *this_frame)
struct regcache *scratch_regcache;
struct cleanup *cleanups;
- if (POP_FRAME_P ())
+ if (DEPRECATED_POP_FRAME_P ())
{
/* A legacy architecture that has implemented a custom pop
function. All new architectures should instead be using the
generic code below. */
- POP_FRAME;
+ DEPRECATED_POP_FRAME;
}
else
{
@@ -215,6 +215,14 @@ frame_pop (struct frame_info *this_frame)
struct regcache *scratch = regcache_xmalloc (current_gdbarch);
struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch);
regcache_save (scratch, do_frame_unwind_register, this_frame);
+ /* FIXME: cagney/2003-03-16: It should be possible to tell the
+ target's register cache that it is about to be hit with a
+ burst register transfer and that the sequence of register
+ writes should be batched. The pair target_prepare_to_store()
+ and target_store_registers() kind of suggest this
+ functionality. Unfortunatly, they don't implement it. Their
+ lack of a formal definition can lead to targets writing back
+ bogus values (arguably a bug in the target code mind). */
/* Now copy those saved registers into the current regcache.
Here, regcache_cpy() calls regcache_restore(). */
regcache_cpy (current_regcache, scratch);
@@ -222,7 +230,6 @@ frame_pop (struct frame_info *this_frame)
}
/* We've made right mess of GDB's local state, just discard
everything. */
- target_store_registers (-1);
flush_cached_frames ();
}
@@ -247,9 +254,12 @@ frame_register_unwind (struct frame_info *frame, int regnum,
detected the problem before calling here. */
gdb_assert (frame != NULL);
- /* Ask this frame to unwind its register. */
- frame->unwind->reg (frame, &frame->unwind_cache, regnum,
- optimizedp, lvalp, addrp, realnump, bufferp);
+ /* Ask this frame to unwind its register. See comment in
+ "frame-unwind.h" for why NEXT frame and this unwind cace are
+ passed in. */
+ frame->unwind->prev_register (frame->next, &frame->prologue_cache, regnum,
+ optimizedp, lvalp, addrp, realnump, bufferp);
+
}
void
@@ -268,9 +278,10 @@ frame_register (struct frame_info *frame, int regnum,
/* Ulgh! Old code that, for lval_register, sets ADDRP to the offset
of the register in the register cache. It should instead return
the REGNUM corresponding to that register. Translate the . */
- if (GET_SAVED_REGISTER_P ())
+ if (DEPRECATED_GET_SAVED_REGISTER_P ())
{
- GET_SAVED_REGISTER (bufferp, optimizedp, addrp, frame, regnum, lvalp);
+ DEPRECATED_GET_SAVED_REGISTER (bufferp, optimizedp, addrp, frame,
+ regnum, lvalp);
/* Compute the REALNUM if the caller wants it. */
if (*lvalp == lval_register)
{
@@ -398,23 +409,6 @@ generic_unwind_get_saved_register (char *raw_buffer,
&realnumx, raw_buffer);
}
-void
-get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval)
-{
- if (GET_SAVED_REGISTER_P ())
- {
- GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
- return;
- }
- generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame,
- regnum, lval);
-}
-
/* frame_register_read ()
Find and return the value of REGNUM for the specified stack frame.
@@ -499,7 +493,7 @@ create_sentinel_frame (struct regcache *regcache)
/* Explicitly initialize the sentinel frame's cache. Provide it
with the underlying regcache. In the future additional
information, such as the frame's thread will be added. */
- frame->unwind_cache = sentinel_frame_cache (regcache);
+ frame->prologue_cache = sentinel_frame_cache (regcache);
/* For the moment there is only one sentinel frame implementation. */
frame->unwind = sentinel_frame_unwind;
/* Link this frame back to itself. The frame is self referential
@@ -656,19 +650,20 @@ select_frame (struct frame_info *fi)
most frame. */
static void
-frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
- int regnum, int *optimizedp,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *bufferp)
+legacy_saved_regs_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
{
- /* There is always a frame at this point. And THIS is the frame
- we're interested in. */
+ /* HACK: New code is passed the next frame and this cache.
+ Unfortunatly, old code expects this frame. Since this is a
+ backward compatibility hack, cheat by walking one level along the
+ prologue chain to the frame the old code expects.
+
+ Do not try this at home. Professional driver, closed course. */
+ struct frame_info *frame = next_frame->prev;
gdb_assert (frame != NULL);
- /* If we're using generic dummy frames, we'd better not be in a call
- dummy. (generic_call_dummy_register_unwind ought to have been called
- instead.) */
- gdb_assert (!(DEPRECATED_USE_GENERIC_DUMMY_FRAMES
- && (get_frame_type (frame) == DUMMY_FRAME)));
/* Only (older) architectures that implement the
DEPRECATED_FRAME_INIT_SAVED_REGS method should be using this
@@ -706,13 +701,13 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
#if 1
/* Save each register value, as it is read in, in a
frame based cache. */
- void **regs = (*cache);
+ void **regs = (*this_prologue_cache);
if (regs == NULL)
{
int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS)
* sizeof (void *));
regs = frame_obstack_zalloc (sizeof_cache);
- (*cache) = regs;
+ (*this_prologue_cache) = regs;
}
if (regs[regnum] == NULL)
{
@@ -732,22 +727,33 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
return;
}
- /* No luck, assume this and the next frame have the same register
- value. Pass the request down the frame chain to the next frame.
- Hopefully that will find the register's location, either in a
- register or in memory. */
- frame_register (frame, regnum, optimizedp, lvalp, addrp, realnump,
- bufferp);
+ /* No luck. Assume this and the next frame have the same register
+ value. Pass the unwind request down the frame chain to the next
+ frame. Hopefully that frame will find the register's location. */
+ frame_register_unwind (next_frame, regnum, optimizedp, lvalp, addrp,
+ realnump, bufferp);
}
static void
-frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache,
- struct frame_id *id)
+legacy_saved_regs_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *id)
{
int fromleaf;
CORE_ADDR base;
CORE_ADDR pc;
+ if (frame_relative_level (next_frame) < 0)
+ {
+ /* FIXME: cagney/2003-03-14: We've got the extra special case of
+ unwinding a sentinel frame, the PC of which is pointing at a
+ stack dummy. Fake up the dummy frame's ID using the same
+ sequence as is found a traditional unwinder. */
+ (*id).base = read_fp ();
+ (*id).pc = read_pc ();
+ return;
+ }
+
/* Start out by assuming it's NULL. */
(*id) = null_frame_id;
@@ -801,16 +807,16 @@ frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache,
id->base = base;
}
-const struct frame_unwind trad_frame_unwinder = {
- frame_saved_regs_id_unwind,
- frame_saved_regs_register_unwind
+const struct frame_unwind legacy_saved_regs_unwinder = {
+ legacy_saved_regs_this_id,
+ legacy_saved_regs_prev_register
};
-const struct frame_unwind *trad_frame_unwind = &trad_frame_unwinder;
+const struct frame_unwind *legacy_saved_regs_unwind = &legacy_saved_regs_unwinder;
-/* Function: get_saved_register
+/* Function: deprecated_generic_get_saved_register
Find register number REGNUM relative to FRAME and put its (raw,
- target format) contents in *RAW_BUFFER.
+ target format) contents in *RAW_BUFFER.
Set *OPTIMIZED if the variable was optimized out (and thus can't be
fetched). Note that this is never set to anything other than zero
@@ -826,10 +832,6 @@ const struct frame_unwind *trad_frame_unwind = &trad_frame_unwinder;
offset into the registers array. If the value is stored in a dummy
frame, set *ADDRP to zero.
- To use this implementation, define a function called
- "get_saved_register" in your target code, which simply passes all
- of its arguments to this function.
-
The argument RAW_BUFFER must point to aligned memory. */
void
@@ -1011,6 +1013,142 @@ legacy_get_prev_frame (struct frame_info *this_frame)
struct frame_info *prev;
int fromleaf;
+ /* Allocate the new frame but do not wire it in to the frame chain.
+ Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along
+ frame->next to pull some fancy tricks (of course such code is, by
+ definition, recursive). Try to prevent it.
+
+ There is no reason to worry about memory leaks, should the
+ remainder of the function fail. The allocated memory will be
+ quickly reclaimed when the frame cache is flushed, and the `we've
+ been here before' check, in get_prev_frame will stop repeated
+ memory allocation calls. */
+ prev = FRAME_OBSTACK_ZALLOC (struct frame_info);
+ prev->level = this_frame->level + 1;
+
+ /* NOTE: cagney/2002-11-18: Should have been correctly setting the
+ frame's type here, before anything else, and not last, at the
+ bottom of this function. The various
+ DEPRECATED_INIT_EXTRA_FRAME_INFO, DEPRECATED_INIT_FRAME_PC,
+ DEPRECATED_INIT_FRAME_PC_FIRST and
+ DEPRECATED_FRAME_INIT_SAVED_REGS methods are full of work-arounds
+ that handle the frame not being correctly set from the start.
+ Unfortunatly those same work-arounds rely on the type defaulting
+ to NORMAL_FRAME. Ulgh! The new frame code does not have this
+ problem. */
+ prev->type = NORMAL_FRAME;
+
+ /* Handle sentinel frame unwind as a special case. */
+ if (this_frame->level < 0)
+ {
+ /* Try to unwind the PC. If that doesn't work, assume we've reached
+ the oldest frame and simply return. Is there a better sentinal
+ value? The unwound PC value is then used to initialize the new
+ previous frame's type.
+
+ Note that the pc-unwind is intentionally performed before the
+ frame chain. This is ok since, for old targets, both
+ frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume
+ THIS_FRAME's data structures have already been initialized (using
+ DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order
+ doesn't matter.
+
+ By unwinding the PC first, it becomes possible to, in the case of
+ a dummy frame, avoid also unwinding the frame ID. This is
+ because (well ignoring the PPC) a dummy frame can be located
+ using THIS_FRAME's frame ID. */
+
+ prev->pc = frame_pc_unwind (this_frame);
+ if (prev->pc == 0)
+ {
+ /* The allocated PREV_FRAME will be reclaimed when the frame
+ obstack is next purged. */
+ if (frame_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "Outermost frame - unwound PC zero\n");
+ return NULL;
+ }
+ prev->type = frame_type_from_pc (prev->pc);
+
+ /* Set the unwind functions based on that identified PC. */
+ prev->unwind = frame_unwind_find_by_pc (current_gdbarch, prev->pc);
+
+ /* Find the prev's frame's ID. */
+ if (prev->type == DUMMY_FRAME
+ && gdbarch_unwind_dummy_id_p (current_gdbarch))
+ {
+ /* When unwinding a normal frame, the stack structure is
+ determined by analyzing the frame's function's code (be
+ it using brute force prologue analysis, or the dwarf2
+ CFI). In the case of a dummy frame, that simply isn't
+ possible. The The PC is either the program entry point,
+ or some random address on the stack. Trying to use that
+ PC to apply standard frame ID unwind techniques is just
+ asking for trouble. */
+ /* Assume hand_function_call(), via SAVE_DUMMY_FRAME_TOS,
+ previously saved the dummy frame's ID. Things only work
+ if the two return the same value. */
+ gdb_assert (SAVE_DUMMY_FRAME_TOS_P ());
+ /* Use an architecture specific method to extract the prev's
+ dummy ID from the next frame. Note that this method uses
+ frame_register_unwind to obtain the register values
+ needed to determine the dummy frame's ID. */
+ prev->id = gdbarch_unwind_dummy_id (current_gdbarch, this_frame);
+ }
+ else
+ {
+ /* We're unwinding a sentinel frame, the PC of which is
+ pointing at a stack dummy. Fake up the dummy frame's ID
+ using the same sequence as is found a traditional
+ unwinder. Once all architectures supply the
+ unwind_dummy_id method, this code can go away. */
+ prev->id.base = read_fp ();
+ prev->id.pc = read_pc ();
+ }
+
+ /* Check that the unwound ID is valid. */
+ if (!frame_id_p (prev->id))
+ {
+ if (frame_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "Outermost legacy sentinel frame - unwound frame ID invalid\n");
+ return NULL;
+ }
+
+ /* Check that the new frame isn't inner to (younger, below,
+ next) the old frame. If that happens the frame unwind is
+ going backwards. */
+ /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since
+ that doesn't have a valid frame ID. Should instead set the
+ sentinel frame's frame ID to a `sentinel'. Leave it until
+ after the switch to storing the frame ID, instead of the
+ frame base, in the frame object. */
+
+ /* FIXME: cagney/2002-12-18: Instead of this hack, should only
+ store the frame ID in PREV_FRAME. Unfortunatly, some
+ architectures (HP/UX) still reply on EXTRA_FRAME_INFO and,
+ hence, still poke at the "struct frame_info" object directly. */
+ prev->frame = prev->id.base;
+
+ /* Link it in. */
+ this_frame->prev = prev;
+ prev->next = this_frame;
+
+ /* FIXME: cagney/2002-01-19: This call will go away. Instead of
+ initializing extra info, all frames will use the frame_cache
+ (passed to the unwind functions) to store additional frame
+ info. Unfortunatly legacy targets can't use
+ legacy_get_prev_frame() to unwind the sentinel frame and,
+ consequently, are forced to take this code path and rely on
+ the below call to DEPRECATED_INIT_EXTRA_FRAME_INFO to
+ initialize the inner-most frame. */
+ if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ())
+ {
+ DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev);
+ }
+ return prev;
+ }
+
/* This code only works on normal frames. A sentinel frame, where
the level is -1, should never reach this code. */
gdb_assert (this_frame->level >= 0);
@@ -1067,19 +1205,10 @@ legacy_get_prev_frame (struct frame_info *this_frame)
if (address == 0)
return 0;
- /* Create an initially zero previous frame. */
- prev = frame_obstack_zalloc (sizeof (struct frame_info));
-
- /* Link it in. */
+ /* Link in the already allocated prev frame. */
this_frame->prev = prev;
prev->next = this_frame;
prev->frame = address;
- prev->level = this_frame->level + 1;
- /* FIXME: cagney/2002-11-18: Should be setting the frame's type
- here, before anything else, and not last. Various INIT functions
- are full of work-arounds for the frames type not being set
- correctly from the word go. Ulgh! */
- prev->type = NORMAL_FRAME;
/* This change should not be needed, FIXME! We should determine
whether any targets *need* DEPRECATED_INIT_FRAME_PC to happen
@@ -1324,14 +1453,8 @@ get_prev_frame (struct frame_info *this_frame)
}
/* If any of the old frame initialization methods are around, use
- the legacy get_prev_frame method. Just don't try to unwind a
- sentinel frame using that method - it doesn't work. All sentinal
- frames use the new unwind code. */
- if ((DEPRECATED_INIT_FRAME_PC_P ()
- || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
- || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
- || FRAME_CHAIN_P ())
- && this_frame->level >= 0)
+ the legacy get_prev_frame method. */
+ if (legacy_frame_p (current_gdbarch))
{
prev_frame = legacy_get_prev_frame (this_frame);
if (frame_debug && prev_frame == NULL)
@@ -1387,86 +1510,57 @@ get_prev_frame (struct frame_info *this_frame)
prev_frame->pc);
/* Find the prev's frame's ID. */
- switch (prev_frame->type)
+
+ /* The callee expects to be invoked with:
+
+ this->unwind->this_id (this->next, &this->cache, &this->id);
+
+ The below is carefully shifted one frame `to the left' so that
+ both the unwind->this_id and unwind->prev_register methods are
+ consistently invoked with NEXT_FRAME and THIS_PROLOGUE_CACHE.
+
+ Also note that, while the PC for this new previous frame was
+ unwound first (see above), the below is the first call that
+ [potentially] requires analysis of the new previous frame's
+ prologue. Consequently, it is this call, that typically ends up
+ initializing the previous frame's prologue cache. */
+ prev_frame->unwind->this_id (this_frame,
+ &prev_frame->prologue_cache,
+ &prev_frame->id);
+
+ /* Check that the unwound ID is valid. */
+ if (!frame_id_p (prev_frame->id))
{
- case DUMMY_FRAME:
- /* When unwinding a normal frame, the stack structure is
- determined by analyzing the frame's function's code (be it
- using brute force prologue analysis, or the dwarf2 CFI). In
- the case of a dummy frame, that simply isn't possible. The
- The PC is either the program entry point, or some random
- address on the stack. Trying to use that PC to apply
- standard frame ID unwind techniques is just asking for
- trouble. */
- if (gdbarch_unwind_dummy_id_p (current_gdbarch))
- {
- /* Assume hand_function_call(), via SAVE_DUMMY_FRAME_TOS,
- previously saved the dummy frame's ID. Things only work
- if the two return the same value. */
- gdb_assert (SAVE_DUMMY_FRAME_TOS_P ());
- /* Use an architecture specific method to extract the prev's
- dummy ID from the next frame. Note that this method uses
- frame_register_unwind to obtain the register values
- needed to determine the dummy frame's ID. */
- prev_frame->id = gdbarch_unwind_dummy_id (current_gdbarch,
- this_frame);
- }
- else if (this_frame->level < 0)
- {
- /* We're unwinding a sentinel frame, the PC of which is
- pointing at a stack dummy. Fake up the dummy frame's ID
- using the same sequence as is found a traditional
- unwinder. Once all architectures supply the
- unwind_dummy_id method, this code can go away. */
- prev_frame->id.base = read_fp ();
- prev_frame->id.pc = read_pc ();
- }
- else
- {
- /* Outch! We're not on the innermost frame yet we're trying
- to unwind to a dummy. The architecture must provide the
- unwind_dummy_id() method. Abandon the unwind process but
- only after first warning the user. */
- internal_warning (__FILE__, __LINE__,
- "Missing unwind_dummy_id architecture method");
- return NULL;
- }
- break;
- case NORMAL_FRAME:
- case SIGTRAMP_FRAME:
- /* FIXME: cagney/2003-03-04: The below call isn't right. It
- should instead be doing something like "prev_frame -> unwind
- -> id (this_frame, & prev_frame -> unwind_cache, & prev_frame
- -> id)" but that requires more extensive (pending) changes. */
- this_frame->unwind->id (this_frame, &this_frame->unwind_cache,
- &prev_frame->id);
- /* Check that the unwound ID is valid. */
- if (!frame_id_p (prev_frame->id))
- {
- if (frame_debug)
- fprintf_unfiltered (gdb_stdlog,
- "Outermost frame - unwound frame ID invalid\n");
- return NULL;
- }
- /* Check that the new frame isn't inner to (younger, below,
- next) the old frame. If that happens the frame unwind is
- going backwards. */
- /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since
- that doesn't have a valid frame ID. Should instead set the
- sentinel frame's frame ID to a `sentinel'. Leave it until
- after the switch to storing the frame ID, instead of the
- frame base, in the frame object. */
- if (this_frame->level >= 0
- && frame_id_inner (prev_frame->id, get_frame_id (this_frame)))
- error ("Unwound frame inner-to selected frame (corrupt stack?)");
- /* Note that, due to frameless functions, the stronger test of
- the new frame being outer to the old frame can't be used -
- frameless functions differ by only their PC value. */
- break;
- default:
- internal_error (__FILE__, __LINE__, "bad switch");
+ if (frame_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "Outermost frame - unwound frame ID invalid\n");
+ return NULL;
}
+ /* Check that the new frame isn't inner to (younger, below, next)
+ the old frame. If that happens the frame unwind is going
+ backwards. */
+ /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since that
+ doesn't have a valid frame ID. Should instead set the sentinel
+ frame's frame ID to a true `sentinel'. Leave it until after the
+ switch to storing the frame ID, instead of the frame base, in the
+ frame object. */
+ if (this_frame->level >= 0
+ && frame_id_inner (prev_frame->id, get_frame_id (this_frame)))
+ error ("Unwound frame inner-to selected frame (corrupt stack?)");
+
+ /* FIXME: cagney/2003-03-14: Should check that this and next frame's
+ IDs are different (i.e., !frame_id_eq()). Can't yet do that as
+ the EQ function doesn't yet compare PC values. */
+
+ /* FIXME: cagney/2003-03-14: Should delay the evaluation of the
+ frame ID until when it is needed. That way the inner most frame
+ can be created without needing to do prologue analysis. */
+
+ /* Note that, due to frameless functions, the stronger test of the
+ new frame being outer to the old frame can't be used - frameless
+ functions differ by only their PC value. */
+
/* FIXME: cagney/2002-12-18: Instead of this hack, should only store
the frame ID in PREV_FRAME. Unfortunatly, some architectures
(HP/UX) still reply on EXTRA_FRAME_INFO and, hence, still poke at
@@ -1477,20 +1571,6 @@ get_prev_frame (struct frame_info *this_frame)
this_frame->prev = prev_frame;
prev_frame->next = this_frame;
- /* FIXME: cagney/2002-01-19: This call will go away. Instead of
- initializing extra info, all frames will use the frame_cache
- (passed to the unwind functions) to store additional frame info.
- Unfortunatly legacy targets can't use legacy_get_prev_frame() to
- unwind the sentinel frame and, consequently, are forced to take
- this code path and rely on the below call to
- DEPRECATED_INIT_EXTRA_FRAME_INFO to initialize the inner-most
- frame. */
- if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ())
- {
- gdb_assert (prev_frame->level == 0);
- DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev_frame);
- }
-
return prev_frame;
}
@@ -1696,6 +1776,17 @@ deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs,
return frame;
}
+int
+legacy_frame_p (struct gdbarch *current_gdbarch)
+{
+ return (DEPRECATED_INIT_FRAME_PC_P ()
+ || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
+ || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
+ || FRAME_CHAIN_P ()
+ || !gdbarch_unwind_dummy_id_p (current_gdbarch)
+ || !SAVE_DUMMY_FRAME_TOS_P ());
+}
+
void
_initialize_frame (void)
{
diff --git a/gdb/frame.h b/gdb/frame.h
index 18c4df4..ee0fc7e 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -27,8 +27,9 @@ struct symtab_and_line;
struct frame_unwind;
struct block;
-/* The traditional frame unwinder. */
-extern const struct frame_unwind *trad_frame_unwind;
+/* A legacy unwinder to prop up architectures using the old style
+ saved regs array. */
+extern const struct frame_unwind *legacy_saved_regs_unwind;
/* The frame object. */
@@ -397,9 +398,9 @@ struct frame_info
related unwind data. */
struct context *context;
- /* Unwind cache shared between the unwind functions - they had
- better all agree as to the contents. */
- void *unwind_cache;
+ /* Prologue cache shared between the unwind functions. See
+ "frame-unwind.h" for more information. */
+ void *prologue_cache;
/* The frame's unwinder. */
const struct frame_unwind *unwind;
@@ -538,7 +539,7 @@ extern int generic_pc_in_call_dummy (CORE_ADDR pc,
/* NOTE: cagney/2002-06-26: Targets should no longer use this
function. Instead, the contents of a dummy frames registers can be
obtained by applying: frame_register_unwind to the dummy frame; or
- get_saved_register to the next outer frame. */
+ frame_register_unwind() to the next outer frame. */
extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
@@ -554,21 +555,17 @@ void generic_unwind_get_saved_register (char *raw_buffer,
enum lval_type *lvalp);
/* The function generic_get_saved_register() has been made obsolete.
- GET_SAVED_REGISTER now defaults to the recursive equivalent -
- generic_unwind_get_saved_register() - so there is no need to even
- set GET_SAVED_REGISTER. Architectures that need to override the
- register unwind mechanism should modify frame->unwind(). */
+ DEPRECATED_GET_SAVED_REGISTER now defaults to the recursive
+ equivalent - generic_unwind_get_saved_register() - so there is no
+ need to even set DEPRECATED_GET_SAVED_REGISTER. Architectures that
+ need to override the register unwind mechanism should modify
+ frame->unwind(). */
extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *,
struct frame_info *, int,
enum lval_type *);
extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
-extern void get_saved_register (char *raw_buffer, int *optimized,
- CORE_ADDR * addrp,
- struct frame_info *frame,
- int regnum, enum lval_type *lval);
-
/* 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
@@ -701,4 +698,8 @@ extern struct context *deprecated_get_frame_context (struct frame_info *fi);
extern void deprecated_set_frame_context (struct frame_info *fi,
struct context *context);
+/* Return non-zero if the architecture is relying on legacy frame
+ code. */
+extern int legacy_frame_p (struct gdbarch *gdbarch);
+
#endif /* !defined (FRAME_H) */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index b5bc335..2753283 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -45,7 +45,6 @@ static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info;
static gdbarch_store_struct_return_ftype frv_store_struct_return;
static gdbarch_push_arguments_ftype frv_push_arguments;
static gdbarch_push_return_address_ftype frv_push_return_address;
-static gdbarch_pop_frame_ftype frv_pop_frame;
static gdbarch_saved_pc_after_call_ftype frv_saved_pc_after_call;
static void frv_pop_frame_regular (struct frame_info *frame);
@@ -1095,7 +1094,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_push_arguments (gdbarch, frv_push_arguments);
set_gdbarch_push_return_address (gdbarch, frv_push_return_address);
- set_gdbarch_pop_frame (gdbarch, frv_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 6f75878..94e89f3 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -202,7 +202,7 @@ struct gdbarch
gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
int believe_pcc_promotion;
int believe_pcc_promotion_type;
- gdbarch_get_saved_register_ftype *get_saved_register;
+ gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
gdbarch_register_convertible_ftype *register_convertible;
gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
@@ -216,7 +216,7 @@ struct gdbarch
gdbarch_push_arguments_ftype *push_arguments;
gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame;
gdbarch_push_return_address_ftype *push_return_address;
- gdbarch_pop_frame_ftype *pop_frame;
+ gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame;
gdbarch_store_struct_return_ftype *store_struct_return;
gdbarch_extract_return_value_ftype *extract_return_value;
gdbarch_store_return_value_ftype *store_return_value;
@@ -711,7 +711,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
fprintf_unfiltered (log, "\n\tfix_call_dummy");
/* Skip verify of deprecated_init_frame_pc_first, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
- /* Skip verify of get_saved_register, has predicate */
+ /* Skip verify of deprecated_get_saved_register, has predicate */
/* Skip verify of register_convertible, invalid_p == 0 */
/* Skip verify of register_convert_to_virtual, invalid_p == 0 */
/* Skip verify of register_convert_to_raw, invalid_p == 0 */
@@ -725,7 +725,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of push_arguments, invalid_p == 0 */
/* Skip verify of deprecated_push_dummy_frame, has predicate */
/* Skip verify of push_return_address, has predicate */
- /* Skip verify of pop_frame, has predicate */
+ /* Skip verify of deprecated_pop_frame, has predicate */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->store_struct_return == 0))
fprintf_unfiltered (log, "\n\tstore_struct_return");
@@ -1213,6 +1213,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_frame_saved_pc
/*DEPRECATED_FRAME_SAVED_PC ()*/);
#endif
+#ifdef DEPRECATED_GET_SAVED_REGISTER_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_GET_SAVED_REGISTER_P()",
+ XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER_P() = %d\n",
+ DEPRECATED_GET_SAVED_REGISTER_P ());
+#endif
+#ifdef DEPRECATED_GET_SAVED_REGISTER
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
+ XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_get_saved_register
+ /*DEPRECATED_GET_SAVED_REGISTER ()*/);
+#endif
#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1330,6 +1353,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_pc_in_call_dummy
/*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
#endif
+#ifdef DEPRECATED_POP_FRAME_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_POP_FRAME_P()",
+ XSTRING (DEPRECATED_POP_FRAME_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_POP_FRAME_P() = %d\n",
+ DEPRECATED_POP_FRAME_P ());
+#endif
+#ifdef DEPRECATED_POP_FRAME
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_POP_FRAME(-)",
+ XSTRING (DEPRECATED_POP_FRAME (-)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_pop_frame
+ /*DEPRECATED_POP_FRAME ()*/);
+#endif
#ifdef DEPRECATED_PUSH_DUMMY_FRAME_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1637,29 +1683,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->get_longjmp_target
/*GET_LONGJMP_TARGET ()*/);
#endif
-#ifdef GET_SAVED_REGISTER_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "GET_SAVED_REGISTER_P()",
- XSTRING (GET_SAVED_REGISTER_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: GET_SAVED_REGISTER_P() = %d\n",
- GET_SAVED_REGISTER_P ());
-#endif
-#ifdef GET_SAVED_REGISTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
- XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: GET_SAVED_REGISTER = <0x%08lx>\n",
- (long) current_gdbarch->get_saved_register
- /*GET_SAVED_REGISTER ()*/);
-#endif
#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
fprintf_unfiltered (file,
"gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
@@ -1813,29 +1836,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->pointer_to_address
/*POINTER_TO_ADDRESS ()*/);
#endif
-#ifdef POP_FRAME_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "POP_FRAME_P()",
- XSTRING (POP_FRAME_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: POP_FRAME_P() = %d\n",
- POP_FRAME_P ());
-#endif
-#ifdef POP_FRAME
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "POP_FRAME(-)",
- XSTRING (POP_FRAME (-)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: POP_FRAME = <0x%08lx>\n",
- (long) current_gdbarch->pop_frame
- /*POP_FRAME ()*/);
-#endif
#ifdef PREPARE_TO_PROCEED
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -4013,29 +4013,29 @@ set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
}
int
-gdbarch_get_saved_register_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->get_saved_register != 0;
+ return gdbarch->deprecated_get_saved_register != 0;
}
void
-gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
+gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->get_saved_register == 0)
+ if (gdbarch->deprecated_get_saved_register == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_get_saved_register invalid");
+ "gdbarch: gdbarch_deprecated_get_saved_register invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
- gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_get_saved_register called\n");
+ gdbarch->deprecated_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
}
void
-set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
- gdbarch_get_saved_register_ftype get_saved_register)
+set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
+ gdbarch_deprecated_get_saved_register_ftype deprecated_get_saved_register)
{
- gdbarch->get_saved_register = get_saved_register;
+ gdbarch->deprecated_get_saved_register = deprecated_get_saved_register;
}
int
@@ -4307,29 +4307,29 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch,
}
int
-gdbarch_pop_frame_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->pop_frame != 0;
+ return gdbarch->deprecated_pop_frame != 0;
}
void
-gdbarch_pop_frame (struct gdbarch *gdbarch)
+gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->pop_frame == 0)
+ if (gdbarch->deprecated_pop_frame == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_pop_frame invalid");
+ "gdbarch: gdbarch_deprecated_pop_frame invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
- gdbarch->pop_frame ();
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pop_frame called\n");
+ gdbarch->deprecated_pop_frame ();
}
void
-set_gdbarch_pop_frame (struct gdbarch *gdbarch,
- gdbarch_pop_frame_ftype pop_frame)
+set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch,
+ gdbarch_deprecated_pop_frame_ftype deprecated_pop_frame)
{
- gdbarch->pop_frame = pop_frame;
+ gdbarch->deprecated_pop_frame = deprecated_pop_frame;
}
void
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index acb1c33..eb36ebc 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1388,40 +1388,40 @@ extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int
#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
#endif
-#if defined (GET_SAVED_REGISTER)
-/* Legacy for systems yet to multi-arch GET_SAVED_REGISTER */
-#if !defined (GET_SAVED_REGISTER_P)
-#define GET_SAVED_REGISTER_P() (1)
+#if defined (DEPRECATED_GET_SAVED_REGISTER)
+/* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */
+#if !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#define DEPRECATED_GET_SAVED_REGISTER_P() (1)
#endif
#endif
/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER_P)
-#define GET_SAVED_REGISTER_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#define DEPRECATED_GET_SAVED_REGISTER_P() (0)
#endif
-extern int gdbarch_get_saved_register_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER_P)
-#error "Non multi-arch definition of GET_SAVED_REGISTER"
+extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER_P)
-#define GET_SAVED_REGISTER_P() (gdbarch_get_saved_register_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "GET_SAVED_REGISTER"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER)
+#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0)
#endif
-typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
-extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
-extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
-#error "Non multi-arch definition of GET_SAVED_REGISTER"
+typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
+extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
+extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER)
+#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER)
+#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
#endif
#endif
@@ -1706,40 +1706,40 @@ extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_pu
#endif
#endif
-#if defined (POP_FRAME)
-/* Legacy for systems yet to multi-arch POP_FRAME */
-#if !defined (POP_FRAME_P)
-#define POP_FRAME_P() (1)
+#if defined (DEPRECATED_POP_FRAME)
+/* Legacy for systems yet to multi-arch DEPRECATED_POP_FRAME */
+#if !defined (DEPRECATED_POP_FRAME_P)
+#define DEPRECATED_POP_FRAME_P() (1)
#endif
#endif
/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME_P)
-#define POP_FRAME_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME_P)
+#define DEPRECATED_POP_FRAME_P() (0)
#endif
-extern int gdbarch_pop_frame_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME_P)
-#error "Non multi-arch definition of POP_FRAME"
+extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P)
+#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME_P)
-#define POP_FRAME_P() (gdbarch_pop_frame_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME_P)
+#define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME)
-#define POP_FRAME (internal_error (__FILE__, __LINE__, "POP_FRAME"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME)
+#define DEPRECATED_POP_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_POP_FRAME"), 0)
#endif
-typedef void (gdbarch_pop_frame_ftype) (void);
-extern void gdbarch_pop_frame (struct gdbarch *gdbarch);
-extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME)
-#error "Non multi-arch definition of POP_FRAME"
+typedef void (gdbarch_deprecated_pop_frame_ftype) (void);
+extern void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME)
+#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME)
-#define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME)
+#define DEPRECATED_POP_FRAME (gdbarch_deprecated_pop_frame (current_gdbarch))
#endif
#endif
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 2cf9a32..ff745ef 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -541,7 +541,7 @@ F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, st
#
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
-F:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
+F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
#
f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
@@ -559,7 +559,7 @@ f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::gen
f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0
F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0
-F:2:POP_FRAME:void:pop_frame:void:-:::0
+F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-:::0
#
f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
#
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 8349322..415acf8 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1151,7 +1151,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_return_address (gdbarch, h8300_push_return_address);
set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value);
set_gdbarch_push_arguments (gdbarch, h8300_push_arguments);
- set_gdbarch_pop_frame (gdbarch, h8300_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame);
set_gdbarch_store_struct_return (gdbarch, h8300_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 8385596..9fde53d 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -5017,7 +5017,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_num_args (gdbarch, hppa_frame_num_args);
set_gdbarch_frame_args_skip (gdbarch, 0);
/* set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); */
- set_gdbarch_pop_frame (gdbarch, hppa_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
/* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 4b479cc..bb588bf 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1129,7 +1129,7 @@ i386_use_struct_convention (int gcc_p, struct type *type)
potentially they could be used for things other than address. */
static struct type *
-i386_register_virtual_type (int regnum)
+i386_register_type (struct gdbarch *gdbarch, int regnum)
{
if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
return lookup_pointer_type (builtin_type_void);
@@ -1558,9 +1558,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, i386_register_name);
set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
- set_gdbarch_deprecated_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE);
- set_gdbarch_deprecated_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE);
- set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type);
+ set_gdbarch_register_type (gdbarch, i386_register_type);
set_gdbarch_print_float_info (gdbarch, i387_print_float_info);
@@ -1591,7 +1589,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_extract_return_value (gdbarch, i386_extract_return_value);
set_gdbarch_push_arguments (gdbarch, i386_push_arguments);
set_gdbarch_push_return_address (gdbarch, i386_push_return_address);
- set_gdbarch_pop_frame (gdbarch, i386_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, i386_pop_frame);
set_gdbarch_store_struct_return (gdbarch, i386_store_struct_return);
set_gdbarch_store_return_value (gdbarch, i386_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch,
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 62cff27..069c2e6 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -93,7 +93,6 @@ static gdbarch_register_byte_ftype ia64_register_byte;
static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
static gdbarch_frame_chain_ftype ia64_frame_chain;
static gdbarch_skip_prologue_ftype ia64_skip_prologue;
-static gdbarch_get_saved_register_ftype ia64_get_saved_register;
static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value;
static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address;
static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
@@ -101,7 +100,6 @@ static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invoc
static gdbarch_store_struct_return_ftype ia64_store_struct_return;
static gdbarch_push_arguments_ftype ia64_push_arguments;
static gdbarch_push_return_address_ftype ia64_push_return_address;
-static gdbarch_pop_frame_ftype ia64_pop_frame;
static gdbarch_saved_pc_after_call_ftype ia64_saved_pc_after_call;
static void ia64_pop_frame_regular (struct frame_info *frame);
static struct type *is_float_or_hfa_type (struct type *t);
@@ -2199,7 +2197,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_frame_saved_pc (gdbarch, ia64_frame_saved_pc);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs);
- set_gdbarch_get_saved_register (gdbarch, ia64_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, ia64_get_saved_register);
set_gdbarch_register_convertible (gdbarch, ia64_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual);
@@ -2222,7 +2220,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_push_arguments (gdbarch, ia64_push_arguments);
set_gdbarch_push_return_address (gdbarch, ia64_push_return_address);
- set_gdbarch_pop_frame (gdbarch, ia64_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words);
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index d1173ba..7d64860 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1390,7 +1390,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
sizeof (m68hc11_call_dummy_words));
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
- set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
set_gdbarch_push_arguments (gdbarch, m68hc11_push_arguments);
@@ -1410,7 +1410,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_saved_pc_after_call (gdbarch, m68hc11_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value);
@@ -1418,7 +1418,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
(gdbarch, m68hc11_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, m68hc11_init_extra_frame_info);
- set_gdbarch_pop_frame (gdbarch, m68hc11_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, m68hc11_pop_frame);
set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 1e09cf8..b79c68a 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -1051,7 +1051,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame);
- set_gdbarch_pop_frame (gdbarch, m68k_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame);
return gdbarch;
}
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index a0d8693..36dbbdb 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -1151,7 +1151,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_address (gdbarch, mcore_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, mcore_frame_locals_address);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- set_gdbarch_pop_frame (gdbarch, mcore_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, mcore_pop_frame);
set_gdbarch_virtual_frame_pointer (gdbarch, mcore_virtual_frame_pointer);
/* Misc.: */
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 7290ef9..1785b9b 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-12 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (get_register): Use frame_register instead of
+ get_saved_register.
+
2003-03-08 Andrew Cagney <cagney@redhat.com>
* mi-out.c: Update copyright.
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index f08bd3f..6ba0698 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -514,6 +514,9 @@ get_register (int regnum, int format)
char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
int optim;
+ int realnum;
+ CORE_ADDR addr;
+ enum lval_type lval;
static struct ui_stream *stb = NULL;
stb = ui_out_stream_new (uiout);
@@ -521,9 +524,9 @@ get_register (int regnum, int format)
if (format == 'N')
format = 0;
- get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL,
- deprecated_selected_frame,
- regnum, (enum lval_type *) NULL);
+ frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr,
+ &realnum, raw_buffer);
+
if (optim)
{
xasprintf (&mi_error_message, "Optimized out");
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index ae28790..506fd1f 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -6007,7 +6007,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
set_gdbarch_push_return_address (gdbarch, mips_push_return_address);
- set_gdbarch_pop_frame (gdbarch, mips_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
@@ -6031,7 +6031,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
set_gdbarch_frame_args_skip (gdbarch, 0);
- set_gdbarch_get_saved_register (gdbarch, mips_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, mips_get_saved_register);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_breakpoint_from_pc (gdbarch, mips_breakpoint_from_pc);
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 7996b1e..df6e043 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1177,7 +1177,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
(gdbarch, mn10300_extract_struct_value_address);
set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value);
set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return);
- set_gdbarch_pop_frame (gdbarch, mn10300_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame);
set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 20696c7..9737120 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -593,7 +593,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Call dummy info */
set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
- set_gdbarch_pop_frame (gdbarch, ns32k_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_words (gdbarch, ns32k_call_dummy_words);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index bc9757e..3fb43c4 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -98,7 +98,7 @@ extern void regcache_collect (int regnum, void *buf);
/* The register's ``offset''.
- FIXME: cagney/2002-11-07: The get_saved_register() function, when
+ FIXME: cagney/2002-11-07: The frame_register() function, when
specifying the real location of a register, does so using that
registers offset in the register cache. That offset is then used
by valops.c to determine the location of the register. The code
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 72079ce..46733a3 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2917,7 +2917,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
- set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, rs6000_pop_frame);
set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index f26ea13..138ef78 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1820,7 +1820,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
This is often the number of bytes in BREAKPOINT
but not always. */
set_gdbarch_decr_pc_after_break (gdbarch, 2);
- set_gdbarch_pop_frame (gdbarch, s390_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
/* Stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Offset from address of function to start of its code.
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index 961e030..e4060d2 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -45,13 +45,13 @@ sentinel_frame_cache (struct regcache *regcache)
/* Here the register value is taken direct from the register cache. */
void
-sentinel_frame_register_unwind (struct frame_info *frame,
- void **unwind_cache,
- int regnum, int *optimized,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnum, void *bufferp)
+sentinel_frame_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimized,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnum, void *bufferp)
{
- struct frame_unwind_cache *cache = *unwind_cache;
+ struct frame_unwind_cache *cache = *this_prologue_cache;
/* Describe the register's location. A reg-frame maps all registers
onto the corresponding hardware register. */
*optimized = 0;
@@ -71,22 +71,20 @@ sentinel_frame_register_unwind (struct frame_info *frame,
}
void
-sentinel_frame_id_unwind (struct frame_info *frame,
- void **cache,
- struct frame_id *id)
+sentinel_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
{
- /* FIXME: cagney/2003-01-08: This should be using a per-architecture
- method that doesn't suffer from DECR_PC_AFTER_BREAK problems.
- Such a method would take unwind_cache, regcache and stop reason
- parameters. */
- id->base = read_fp ();
- id->pc = read_pc ();
+ /* The sentinel frame is used as a starting point for creating the
+ previous (inner most) frame. That frame's THIS_ID method will be
+ called to determine the inner most frame's ID. Not this one. */
+ internal_error (__FILE__, __LINE__, "sentinel_frame_this_id called");
}
const struct frame_unwind sentinel_frame_unwinder =
{
- sentinel_frame_id_unwind,
- sentinel_frame_register_unwind
+ sentinel_frame_this_id,
+ sentinel_frame_prev_register
};
const struct frame_unwind *const sentinel_frame_unwind = &sentinel_frame_unwinder;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 081c063..2a6449f 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -4372,14 +4372,14 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info);
set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
set_gdbarch_frame_chain (gdbarch, sh_frame_chain);
- set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh_init_extra_frame_info);
set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value);
set_gdbarch_push_arguments (gdbarch, sh_push_arguments);
set_gdbarch_store_struct_return (gdbarch, sh_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- set_gdbarch_pop_frame (gdbarch, sh_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, sh_pop_frame);
set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh);
set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
skip_prologue_hard_way = sh_skip_prologue_hard_way;
@@ -4615,13 +4615,13 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
set_gdbarch_frame_chain (gdbarch, sh64_frame_chain);
- set_gdbarch_get_saved_register (gdbarch, sh64_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, sh64_get_saved_register);
set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value);
set_gdbarch_push_arguments (gdbarch, sh64_push_arguments);
/*set_gdbarch_store_struct_return (gdbarch, sh64_store_struct_return);*/
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
- set_gdbarch_pop_frame (gdbarch, sh64_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame);
set_gdbarch_elf_make_msymbol_special (gdbarch,
sh64_elf_make_msymbol_special);
break;
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index be8197f..6e1b211 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -326,9 +326,9 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
else
{
/* Should we adjust for stack bias here? */
- get_saved_register (buf, 0, 0, fi, FP_REGNUM, 0);
- deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (FP_REGNUM)));
-
+ ULONGEST tmp;
+ frame_read_unsigned_register (fi, FP_REGNUM, &tmp);
+ 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);
}
@@ -367,8 +367,11 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
get_frame_extra_info (fi)->sp_offset = offset;
/* Overwrite the frame's address with the value in %i7. */
- get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0);
- deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (I7_REGNUM)));
+ {
+ ULONGEST tmp;
+ frame_read_unsigned_register (fi, I7_REGNUM, &tmp);
+ 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);
@@ -487,9 +490,11 @@ sparc_frame_saved_pc (struct frame_info *frame)
saved_pc_offset = 12;
/* The sigcontext address is contained in register O2. */
- get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
- frame, O0_REGNUM + 2, (enum lval_type *) NULL);
- sigcontext_addr = extract_address (buf, REGISTER_RAW_SIZE (O0_REGNUM + 2));
+ {
+ ULONGEST tmp;
+ frame_read_unsigned_register (frame, O0_REGNUM + 2, &tmp);
+ sigcontext_addr = tmp;
+ }
/* Don't cause a memory_error when accessing sigcontext in case the
stack layout has changed or the stack is corrupt. */
@@ -505,9 +510,9 @@ sparc_frame_saved_pc (struct frame_info *frame)
{
/* A frameless function interrupted by a signal did not save
the PC, it is still in %o7. */
- get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
- frame, O7_REGNUM, (enum lval_type *) NULL);
- return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
+ ULONGEST tmp;
+ frame_read_unsigned_register (frame, O7_REGNUM, &tmp);
+ return PC_ADJUST (tmp);
}
if (get_frame_extra_info (frame)->flat)
addr = get_frame_extra_info (frame)->pc_addr;
@@ -936,8 +941,9 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
{
/* Outs become ins. */
- get_saved_register (raw_buffer, optimized, addrp, frame1,
- (regnum - O0_REGNUM + I0_REGNUM), lval);
+ int realnum;
+ frame_register (frame1, (regnum - O0_REGNUM + I0_REGNUM),
+ optimized, lval, addrp, &realnum, raw_buffer);
return;
}
}
@@ -1090,10 +1096,10 @@ sparc_push_dummy_frame (void)
I think few ports of GDB get right--if you are popping a frame
which does not save some register that *is* saved by a more inner
frame (such a frame will never be a dummy frame because dummy
- frames save all registers). Rewriting pop_frame to use
- get_saved_register would solve this problem and also get rid of the
- ugly duplication between sparc_frame_find_saved_regs and
- get_saved_register.
+ frames save all registers).
+
+ NOTE: cagney/2003-03-12: Since pop_frame has been rewritten to use
+ frame_unwind_register() the need for this function is questionable.
Stores, into an array of CORE_ADDR,
the addresses of the saved registers of frame described by FRAME_INFO.
@@ -1369,12 +1375,9 @@ sparc_pop_frame (void)
/* I think this happens only in the innermost frame, if so then
it is a complicated way of saying
"pc = read_register (O7_REGNUM);". */
- char *buf;
-
- buf = alloca (MAX_REGISTER_RAW_SIZE);
- get_saved_register (buf, 0, 0, frame, O7_REGNUM, 0);
- pc = PC_ADJUST (extract_address
- (buf, REGISTER_RAW_SIZE (O7_REGNUM)));
+ ULONGEST tmp;
+ frame_read_unsigned_register (frame, O7_REGNUM, &tmp);
+ pc = PC_ADJUST (tmp);
}
write_register (PC_REGNUM, pc);
@@ -3150,7 +3153,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_frame_saved_pc (gdbarch, sparc_frame_saved_pc);
set_gdbarch_frameless_function_invocation (gdbarch,
frameless_look_for_prologue);
- set_gdbarch_get_saved_register (gdbarch, sparc_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, sparc_get_saved_register);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
@@ -3158,7 +3161,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
- set_gdbarch_pop_frame (gdbarch, sparc_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, sparc_pop_frame);
set_gdbarch_push_return_address (gdbarch, sparc_push_return_address);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, sparc_push_dummy_frame);
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
diff --git a/gdb/stack.c b/gdb/stack.c
index 3eab979..98b8a0f 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1639,9 +1639,13 @@ return_command (char *retval_exp, int from_tty)
that. */
/* Do the real work. Pop until the specified frame is current. We
- use this method because the deprecated_selected_frame is not valid after
- a POP_FRAME. The pc comparison makes this work even if the
- selected frame shares its fp with another frame. */
+ use this method because the deprecated_selected_frame is not
+ valid after a frame_pop(). The pc comparison makes this work
+ even if the selected frame shares its fp with another frame. */
+
+ /* FIXME: cagney/32003-03-12: This code should use frame_id_eq().
+ Unfortunatly, that function doesn't yet include the PC in any
+ frame ID comparison. */
while (selected_frame_addr != get_frame_base (frame = get_current_frame ())
|| selected_frame_pc != get_frame_pc (frame))
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index a9f918a..7069f96 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,12 @@
+2003-03-14 Andrew Cagney <cagney@redhat.com>
+
+ * tuiRegs.c (_tuiGetRegisterRawValue): Use frame_read_register,
+ instead of get_saved_register.
+
+2003-03-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tui-out.c (tui_out_data): Fix typedef.
+
2003-03-08 Andrew Cagney <cagney@redhat.com>
* tui-out.c: Update copyright.
diff --git a/gdb/tui/tui-out.c b/gdb/tui/tui-out.c
index 1ec6d86..94fda09 100644
--- a/gdb/tui/tui-out.c
+++ b/gdb/tui/tui-out.c
@@ -36,7 +36,7 @@ struct ui_out_data
int line;
int start_of_line;
};
-struct ui_out_data tui_out_data;
+typedef struct ui_out_data tui_out_data;
/* These are the CLI output functions */
diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c
index 6fc63d9..6920d80 100644
--- a/gdb/tui/tuiRegs.c
+++ b/gdb/tui/tuiRegs.c
@@ -799,10 +799,10 @@ _tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
if (target_has_registers)
{
- int opt;
-
- get_saved_register (regValue, &opt, (CORE_ADDR*) NULL, frame,
- regNum, (enum lval_type*) NULL);
+ frame_read_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. */
if (register_cached (regNum) >= 0)
ret = TUI_SUCCESS;
}
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 94fcb81..f0c12a2 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1271,7 +1271,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_return_address (gdbarch, v850_push_return_address);
set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value);
set_gdbarch_push_arguments (gdbarch, v850_push_arguments);
- set_gdbarch_pop_frame (gdbarch, v850_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame);
set_gdbarch_store_struct_return (gdbarch, v850_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
diff --git a/gdb/valops.c b/gdb/valops.c
index 6dcc6f1..f21b781 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1303,7 +1303,7 @@ hand_function_call (struct value *function, int nargs, struct value **args)
if (DEPRECATED_PUSH_DUMMY_FRAME_P ())
{
/* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the
- inferior registers (and POP_FRAME for restoring them). (At
+ inferior registers (and frame_pop() for restoring them). (At
least on most machines) they are saved on the stack in the
inferior. */
DEPRECATED_PUSH_DUMMY_FRAME;
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 4b1851e..f5cd267 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -52,7 +52,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype
vax_extract_struct_value_address;
static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
-static gdbarch_pop_frame_ftype vax_pop_frame;
static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy;
/* Return 1 if P points to an invalid floating point value.
@@ -668,7 +667,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Call dummy info */
set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
- set_gdbarch_pop_frame (gdbarch, vax_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, vax_pop_frame);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_words (gdbarch, vax_call_dummy_words);
diff --git a/gdb/version.in b/gdb/version.in
index 2f39186..c9ca6c9 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2003-03-13-cvs
+2003-03-17-cvs
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index 85057f7..ced11dc 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -1006,7 +1006,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
x86_64_register_convert_to_raw);
/* Getting saved registers is handled by unwind information. */
- set_gdbarch_get_saved_register (gdbarch, cfi_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, cfi_get_saved_register);
/* FIXME: kettenis/20021026: Should we set parm_boundary to 64 here? */
set_gdbarch_read_fp (gdbarch, cfi_read_fp);
@@ -1015,7 +1015,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments);
set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address);
- set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, x86_64_pop_frame);
set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return);
set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value);
/* Override, since this is handled by x86_64_extract_return_value. */
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index e44b64d..2ccbb1e 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -723,11 +723,10 @@ xstormy16_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
actual value of the previous frame's stack register.
This function may be called in any context where the saved register
- values may be needed (backtrace, frame_info, get_saved_register).
- On many targets, it is called directly by init_extra_frame_info,
- in part because the information may be needed immediately by
- frame_chain.
-*/
+ values may be needed (backtrace, frame_info, frame_register). On
+ many targets, it is called directly by init_extra_frame_info, in
+ part because the information may be needed immediately by
+ frame_chain. */
static void
xstormy16_frame_init_saved_regs (struct frame_info *fi)
@@ -841,12 +840,11 @@ xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain);
}
-/* Function: xstormy16_saved_pc_after_call
- Returns the previous PC immediately after a function call.
- This function is meant to bypass the regular get_saved_register
- mechanism, ie. it is meant to work even if the frame isn't complete.
- Called by step_over_function, and sometimes by get_prev_frame.
-*/
+/* Function: xstormy16_saved_pc_after_call Returns the previous PC
+ immediately after a function call. This function is meant to
+ bypass the regular frame_register() mechanism, ie. it is meant to
+ work even if the frame isn't complete. Called by
+ step_over_function, and sometimes by get_prev_frame. */
static CORE_ADDR
xstormy16_saved_pc_after_call (struct frame_info *ignore)
@@ -1058,7 +1056,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
xstormy16_frame_init_saved_regs);
set_gdbarch_frame_chain (gdbarch, xstormy16_frame_chain);
- set_gdbarch_get_saved_register (gdbarch, xstormy16_get_saved_register);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, xstormy16_get_saved_register);
set_gdbarch_saved_pc_after_call (gdbarch, xstormy16_saved_pc_after_call);
set_gdbarch_deprecated_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
@@ -1089,7 +1087,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address);
set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments);
- set_gdbarch_pop_frame (gdbarch, xstormy16_pop_frame);
+ set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame);
set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);