summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-24 19:48:13 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-24 19:48:13 +0000
commit7c1f2cfeceafc8d2879f0f8297e2fa1bf3d2d9cd (patch)
tree4b432574949f104c78344ef8c9c8b923c284bf0f
parent461f81195c0cd8dee6d150c29e0c1f6eaeb9eeee (diff)
downloadgdb-7c1f2cfeceafc8d2879f0f8297e2fa1bf3d2d9cd.tar.gz
2002-11-19 Andrew Cagney <ac131313@redhat.com>
* frame.h (FRAME_FP): Delete macro. (get_frame_base): New function declaration. * frame.c (get_frame_base): New function. (get_frame_id): Use ->frame. (frame_find_by_id): Rewrite to use get_frame_id. * blockframe.c: Use get_frame_base instead of FRAME_FP. * cris-tdep.c, d10v-tdep.c, findvar.c, h8500-tdep.c: Ditto. * hppa-tdep.c, i386-tdep.c, infcmd.c, infrun.c: Ditto. * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto. * mn10200-tdep.c, mn10300-tdep.c, rs6000-tdep.c: Ditto. * sh-tdep.c, sparc-tdep.c, stack.c, tracepoint.c: Ditto. * v850-tdep.c, valops.c, z8k-tdep.c: Ditto.
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/cris-tdep.c12
-rw-r--r--gdb/d10v-tdep.c2
-rw-r--r--gdb/findvar.c2
-rw-r--r--gdb/frame.c26
-rw-r--r--gdb/frame.h64
-rw-r--r--gdb/h8500-tdep.c4
-rw-r--r--gdb/hppa-tdep.c2
-rw-r--r--gdb/i386-tdep.c2
-rw-r--r--gdb/infcmd.c6
-rw-r--r--gdb/infrun.c16
-rw-r--r--gdb/m68hc11-tdep.c2
-rw-r--r--gdb/m68k-tdep.c2
-rw-r--r--gdb/mcore-tdep.c2
-rw-r--r--gdb/mips-tdep.c2
-rw-r--r--gdb/mn10200-tdep.c2
-rw-r--r--gdb/mn10300-tdep.c2
-rw-r--r--gdb/rs6000-tdep.c4
-rw-r--r--gdb/sh-tdep.c8
-rw-r--r--gdb/sparc-tdep.c10
-rw-r--r--gdb/stack.c4
-rw-r--r--gdb/tracepoint.c6
-rw-r--r--gdb/v850-tdep.c2
-rw-r--r--gdb/valops.c2
-rw-r--r--gdb/z8k-tdep.c2
25 files changed, 128 insertions, 73 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 031101a0347..09bd2df104a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2002-11-19 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.h (FRAME_FP): Delete macro.
+ (get_frame_base): New function declaration.
+ * frame.c (get_frame_base): New function.
+ (get_frame_id): Use ->frame.
+ (frame_find_by_id): Rewrite to use get_frame_id.
+ * blockframe.c: Use get_frame_base instead of FRAME_FP.
+ * cris-tdep.c, d10v-tdep.c, findvar.c, h8500-tdep.c: Ditto.
+ * hppa-tdep.c, i386-tdep.c, infcmd.c, infrun.c: Ditto.
+ * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto.
+ * mn10200-tdep.c, mn10300-tdep.c, rs6000-tdep.c: Ditto.
+ * sh-tdep.c, sparc-tdep.c, stack.c, tracepoint.c: Ditto.
+ * v850-tdep.c, valops.c, z8k-tdep.c: Ditto.
+
2002-11-24 Andrew Cagney <ac131313@redhat.com>
* arm-tdep.c (arm_gdbarch_init): Do not set get_saved_register.
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index a7ba7331210..7fc8e7e1f7b 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -681,29 +681,29 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
if (have_fp)
{
- fi->saved_regs[FP_REGNUM] = FRAME_FP (fi);
+ fi->saved_regs[FP_REGNUM] = get_frame_base (fi);
/* Calculate the addresses. */
for (regno = regsave; regno >= 0; regno--)
{
- fi->saved_regs[regno] = FRAME_FP (fi) - val;
+ fi->saved_regs[regno] = get_frame_base (fi) - val;
val -= 4;
}
if (fi->extra_info->leaf_function)
{
/* Set the register SP to contain the stack pointer of
the caller. */
- fi->saved_regs[SP_REGNUM] = FRAME_FP (fi) + 4;
+ fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 4;
}
else
{
/* Set the register SP to contain the stack pointer of
the caller. */
- fi->saved_regs[SP_REGNUM] = FRAME_FP (fi) + 8;
+ fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 8;
/* Set the register SRP to contain the return address of
the caller. */
- fi->saved_regs[SRP_REGNUM] = FRAME_FP (fi) + 4;
+ fi->saved_regs[SRP_REGNUM] = get_frame_base (fi) + 4;
}
}
return ip;
@@ -1260,7 +1260,7 @@ cris_frame_chain (struct frame_info *fi)
}
else if (!inside_entry_file (fi->pc))
{
- return read_memory_unsigned_integer (FRAME_FP (fi), 4);
+ return read_memory_unsigned_integer (get_frame_base (fi), 4);
}
else
{
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index e1adf501818..1302765e1cc 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -547,7 +547,7 @@ do_d10v_pop_frame (struct frame_info *fi)
int regnum;
char raw_buffer[8];
- fp = FRAME_FP (fi);
+ fp = get_frame_base (fi);
/* fill out fsr with the address of where each */
/* register was stored in the frame */
d10v_frame_init_saved_regs (fi);
diff --git a/gdb/findvar.c b/gdb/findvar.c
index eeb7e297a1e..a95c6aa45dd 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -786,7 +786,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
for some good purpose. */
{
VALUE_LVAL (v) = lval_reg_frame_relative;
- VALUE_FRAME (v) = FRAME_FP (frame);
+ VALUE_FRAME (v) = get_frame_base (frame);
VALUE_FRAME_REGNUM (v) = regnum;
}
else if (mem_stor)
diff --git a/gdb/frame.c b/gdb/frame.c
index ba692c5b3e8..cf7f2b9a16c 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -47,7 +47,7 @@ get_frame_id (struct frame_info *fi, struct frame_id *id)
}
else
{
- id->base = FRAME_FP (fi);
+ id->base = fi->frame;
id->pc = fi->pc;
}
}
@@ -66,19 +66,21 @@ frame_find_by_id (struct frame_id id)
frame != NULL;
frame = get_prev_frame (frame))
{
- if (INNER_THAN (FRAME_FP (frame), id.base))
+ struct frame_id this;
+ get_frame_id (frame, &this);
+ if (INNER_THAN (this.base, id.base))
/* ``inner/current < frame < id.base''. Keep looking along
the frame chain. */
continue;
- if (INNER_THAN (id.base, FRAME_FP (frame)))
+ if (INNER_THAN (id.base, this.base))
/* ``inner/current < id.base < frame''. Oops, gone past it.
Just give up. */
return NULL;
/* FIXME: cagney/2002-04-21: This isn't sufficient. It should
- use id.pc to check that the two frames belong to the same
- function. Otherwise we'll do things like match dummy frames
- or mis-match frameless functions. However, until someone
- notices, stick with the existing behavour. */
+ use id.pc / this.pc to check that the two frames belong to
+ the same function. Otherwise we'll do things like match
+ dummy frames or mis-match frameless functions. However,
+ until someone notices, stick with the existing behavour. */
return frame;
}
return NULL;
@@ -826,7 +828,7 @@ get_prev_frame (struct frame_info *next_frame)
/* FIXME: 2002-11-09: There isn't any reason to special case this
edge condition. Instead the per-architecture code should hande
it locally. */
- address = FRAME_FP (next_frame);
+ address = get_frame_base (next_frame);
else
{
/* Two macros defined in tm.h specify the machine-dependent
@@ -1018,6 +1020,14 @@ get_frame_pc (struct frame_info *frame)
return frame->pc;
}
+/* Per "frame.h", return the ``address'' of the frame. Code should
+ really be using get_frame_id(). */
+CORE_ADDR
+get_frame_base (struct frame_info *fi)
+{
+ return fi->frame;
+}
+
/* Level of the selected frame: 0 for innermost, 1 for its caller, ...
or -1 for a NULL frame. */
diff --git a/gdb/frame.h b/gdb/frame.h
index 86d11726283..9434cdec407 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -85,6 +85,49 @@ extern struct frame_info *frame_find_by_id (struct frame_id id);
this frame. */
extern CORE_ADDR get_frame_pc (struct frame_info *);
+/* Return the frame address from FI. Except in the machine-dependent
+ *FRAME* macros, a frame address has no defined meaning other than
+ as a magic cookie which identifies a frame over calls to the
+ inferior (um, SEE NOTE BELOW). The only known exception is
+ inferior.h (PC_IN_CALL_DUMMY) [ON_STACK]; see comments there. You
+ cannot assume that a frame address contains enough information to
+ reconstruct the frame; if you want more than just to identify the
+ frame (e.g. be able to fetch variables relative to that frame),
+ then save the whole struct frame_info (and the next struct
+ frame_info, since the latter is used for fetching variables on some
+ machines) (um, again SEE NOTE BELOW).
+
+ NOTE: cagney/2002-11-18: Actually, the frame address isn't
+ sufficient for identifying a frame, and the counter examples are
+ wrong!
+
+ Code that needs to (re)identify a frame must use get_frame_id() and
+ frame_find_by_id() (and in the future, a frame_compare() function
+ instead of INNER_THAN()). Two reasons: an architecture (e.g.,
+ ia64) can have more than one frame address (due to multiple stack
+ pointers) (frame ID is going to be expanded to accomodate this);
+ successive frameless function calls can only be differientated by
+ comparing both the frame's base and the frame's enclosing function
+ (frame_find_by_id() is going to be modified to perform this test).
+
+ The generic dummy frame version of PC_IN_CALL_DUMMY() is able to
+ identify a dummy frame using only the PC value. So the frame
+ address is not needed. In fact, most PC_IN_CALL_DUMMY() calls now
+ pass zero as the frame/sp values as the caller knows that those
+ values won't be used. Once all architectures are using generic
+ dummy frames, PC_IN_CALL_DUMMY() can drop the sp/frame parameters.
+ When it comes to finding a dummy frame, the next frame's frame ID
+ (with out duing an unwind) can be used (ok, could if it wasn't for
+ the need to change the way the PPC defined frame base in a strange
+ way).
+
+ Modern architectures should be using something like dwarf2's
+ location expression to describe where a variable lives. Such
+ expressions specify their own debug info centric frame address.
+ Consequently, a generic frame address is pretty meaningless. */
+
+extern CORE_ADDR get_frame_base (struct frame_info *);
+
/* Return the per-frame unique identifer. Can be used to relocate a
frame after a frame cache flush (and other similar operations). */
extern void get_frame_id (struct frame_info *fi, struct frame_id *id);
@@ -235,9 +278,10 @@ struct frame_saved_regs
struct frame_info
{
- /* Nominal address of the frame described. See comments at FRAME_FP
- about what this means outside the *FRAME* macros; in the *FRAME*
- macros, it can mean whatever makes most sense for this machine. */
+ /* Nominal address of the frame described. See comments at
+ get_frame_base() about what this means outside the *FRAME*
+ macros; in the *FRAME* macros, it can mean whatever makes most
+ sense for this machine. */
CORE_ADDR frame;
/* Address at which execution is occurring in this frame.
@@ -334,20 +378,6 @@ enum print_what
extern void *frame_obstack_alloc (unsigned long size);
extern void frame_saved_regs_zalloc (struct frame_info *);
-/* Return the frame address from FI. Except in the machine-dependent
- *FRAME* macros, a frame address has no defined meaning other than
- as a magic cookie which identifies a frame over calls to the
- inferior. The only known exception is inferior.h
- (PC_IN_CALL_DUMMY) [ON_STACK]; see comments there. You cannot
- assume that a frame address contains enough information to
- reconstruct the frame; if you want more than just to identify the
- frame (e.g. be able to fetch variables relative to that frame),
- then save the whole struct frame_info (and the next struct
- frame_info, since the latter is used for fetching variables on some
- machines). */
-
-#define FRAME_FP(fi) ((fi)->frame)
-
/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
is the outermost one and has no caller.
diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c
index 0bfae7a7624..d7ccb1a8e52 100644
--- a/gdb/h8500-tdep.c
+++ b/gdb/h8500-tdep.c
@@ -117,7 +117,7 @@ CORE_ADDR
h8500_frame_chain (struct frame_info *thisframe)
{
if (!inside_entry_file (thisframe->pc))
- return (read_memory_integer (FRAME_FP (thisframe), PTR_SIZE));
+ return (read_memory_integer (get_frame_base (thisframe), PTR_SIZE));
else
return 0;
}
@@ -154,7 +154,7 @@ NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, char *pword1)
CORE_ADDR
frame_saved_pc (struct frame_info *frame)
{
- return read_memory_integer (FRAME_FP (frame) + 2, PTR_SIZE);
+ return read_memory_integer (get_frame_base (frame) + 2, PTR_SIZE);
}
void
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 2c1fac061f0..5875011f3cd 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1532,7 +1532,7 @@ hppa_pop_frame (void)
struct frame_saved_regs fsr;
double freg_buffer;
- fp = FRAME_FP (frame);
+ fp = get_frame_base (frame);
get_frame_saved_regs (frame, &fsr);
#ifndef NO_PC_SPACE_QUEUE_RESTORE
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 32fb68eb536..becb7956227 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -860,7 +860,7 @@ i386_do_pop_frame (struct frame_info *frame)
int regnum;
char regbuf[I386_MAX_REGISTER_SIZE];
- fp = FRAME_FP (frame);
+ fp = get_frame_base (frame);
i386_frame_init_saved_regs (frame);
for (regnum = 0; regnum < NUM_REGS; regnum++)
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 2556221f29d..65995d3fb69 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -618,7 +618,7 @@ step_1 (int skip_subroutines, int single_inst, char *count_string)
frame = get_current_frame ();
if (!frame) /* Avoid coredump here. Why tho? */
error ("No current frame");
- step_frame_address = FRAME_FP (frame);
+ step_frame_address = get_frame_base (frame);
step_sp = read_sp ();
if (!single_inst)
@@ -733,7 +733,7 @@ step_once (int skip_subroutines, int single_inst, int count)
frame = get_current_frame ();
if (!frame) /* Avoid coredump here. Why tho? */
error ("No current frame");
- step_frame_address = FRAME_FP (frame);
+ step_frame_address = get_frame_base (frame);
step_sp = read_sp ();
if (!single_inst)
@@ -1096,7 +1096,7 @@ until_next_command (int from_tty)
}
step_over_calls = STEP_OVER_ALL;
- step_frame_address = FRAME_FP (frame);
+ step_frame_address = get_frame_base (frame);
step_sp = read_sp ();
step_multi = 0; /* Only one call to proceed */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index b179bf63ea6..49b90a6a2b4 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2053,7 +2053,7 @@ handle_inferior_event (struct execution_control_state *ecs)
|| trap_expected
|| (!CALL_DUMMY_BREAKPOINT_OFFSET_P
&& PC_IN_CALL_DUMMY (stop_pc, read_sp (),
- FRAME_FP (get_current_frame ())))
+ get_frame_base (get_current_frame ())))
|| (step_range_end && step_resume_breakpoint == NULL));
else
@@ -2064,7 +2064,7 @@ handle_inferior_event (struct execution_control_state *ecs)
check here as well as above. */
|| (!CALL_DUMMY_BREAKPOINT_OFFSET_P
&& PC_IN_CALL_DUMMY (stop_pc, read_sp (),
- FRAME_FP
+ get_frame_base
(get_current_frame
()))));
if (!ecs->random_signal)
@@ -2255,7 +2255,7 @@ process_event_stop_test:
#if 0
/* FIXME - Need to implement nested temporary breakpoints */
if (step_over_calls
- && (INNER_THAN (FRAME_FP (get_current_frame ()),
+ && (INNER_THAN (get_frame_base (get_current_frame ()),
step_frame_address)))
{
ecs->another_trap = 1;
@@ -2466,7 +2466,7 @@ process_event_stop_test:
case she'd better know what she's doing. */
if (CALL_DUMMY_HAS_COMPLETED (stop_pc, read_sp (),
- FRAME_FP (get_current_frame ()))
+ get_frame_base (get_current_frame ()))
&& !step_range_end)
{
stop_print_frame = 0;
@@ -2567,7 +2567,7 @@ process_event_stop_test:
{
- CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+ CORE_ADDR current_frame = get_frame_base (get_current_frame ());
if (INNER_THAN (current_frame, step_frame_address))
{
@@ -2838,7 +2838,7 @@ process_event_stop_test:
}
step_range_start = ecs->sal.pc;
step_range_end = ecs->sal.end;
- step_frame_address = FRAME_FP (get_current_frame ());
+ step_frame_address = get_frame_base (get_current_frame ());
ecs->current_line = ecs->sal.line;
ecs->current_symtab = ecs->sal.symtab;
@@ -2846,7 +2846,7 @@ process_event_stop_test:
of a line of the caller, continue stepping, but step_frame_address
must be modified to current frame */
{
- CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+ CORE_ADDR current_frame = get_frame_base (get_current_frame ());
if (!(INNER_THAN (current_frame, step_frame_address)))
step_frame_address = current_frame;
}
@@ -3353,7 +3353,7 @@ normal_stop (void)
{
case PRINT_UNKNOWN:
if (stop_step
- && step_frame_address == FRAME_FP (get_current_frame ())
+ && step_frame_address == get_frame_base (get_current_frame ())
&& step_start_function == find_pc_function (stop_pc))
source_flag = SRC_LINE; /* finished step, just print source line */
else
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 3045a58fa88..3dfd1a10c5b 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -438,7 +438,7 @@ m68hc11_pop_frame (void)
generic_pop_dummy_frame ();
else
{
- fp = FRAME_FP (frame);
+ fp = get_frame_base (frame);
FRAME_INIT_SAVED_REGS (frame);
/* Copy regs from where they were saved in the frame. */
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 1eacea17b22..097555e3d22 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -472,7 +472,7 @@ m68k_pop_frame (void)
register int regnum;
char raw_buffer[12];
- fp = FRAME_FP (frame);
+ fp = get_frame_base (frame);
m68k_frame_init_saved_regs (frame);
for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--)
{
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 9f72876b103..d5a852cd5c3 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -810,7 +810,7 @@ mcore_pop_frame (void)
}
/* Actually cut back the stack. */
- write_register (SP_REGNUM, FRAME_FP (fi));
+ write_register (SP_REGNUM, get_frame_base (fi));
}
/* Finally, throw away any cached frame information. */
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 6d73e90d5bb..be1d52b42a7 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -3813,7 +3813,7 @@ mips_pop_frame (void)
{
register int regnum;
struct frame_info *frame = get_current_frame ();
- CORE_ADDR new_sp = FRAME_FP (frame);
+ CORE_ADDR new_sp = get_frame_base (frame);
mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
if (USE_GENERIC_DUMMY_FRAMES
diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c
index a8d7d72ef8e..3f56ab3bb78 100644
--- a/gdb/mn10200-tdep.c
+++ b/gdb/mn10200-tdep.c
@@ -703,7 +703,7 @@ mn10200_pop_frame (struct frame_info *frame)
}
/* Actually cut back the stack. */
- write_register (SP_REGNUM, FRAME_FP (frame));
+ write_register (SP_REGNUM, get_frame_base (frame));
/* Don't we need to set the PC?!? XXX FIXME. */
}
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 6ed9cc14fdc..cc8e411268d 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -738,7 +738,7 @@ mn10300_pop_frame_regular (struct frame_info *frame)
}
/* Actually cut back the stack. */
- write_register (SP_REGNUM, FRAME_FP (frame));
+ write_register (SP_REGNUM, get_frame_base (frame));
/* Don't we need to set the PC?!? XXX FIXME. */
}
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 57de0832e03..08ca1cf0172 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -956,7 +956,7 @@ rs6000_pop_frame (void)
int ii, wordsize;
pc = read_pc ();
- sp = FRAME_FP (frame);
+ sp = get_frame_base (frame);
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
{
@@ -1761,7 +1761,7 @@ rs6000_frame_chain (struct frame_info *thisframe)
&& FRAMELESS_FUNCTION_INVOCATION (thisframe))
/* A frameless function interrupted by a signal did not change the
frame pointer. */
- fp = FRAME_FP (thisframe);
+ fp = get_frame_base (thisframe);
else
fp = read_memory_addr ((thisframe)->frame, wordsize);
return fp;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 12e26d34678..0013031ae23 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -930,7 +930,7 @@ sh_frame_chain (struct frame_info *frame)
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
return frame->frame; /* dummy frame same as caller's frame */
if (frame->pc && !inside_entry_file (frame->pc))
- return read_memory_integer (FRAME_FP (frame) + frame->extra_info->f_offset, 4);
+ return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, 4);
else
return 0;
}
@@ -975,7 +975,7 @@ sh64_frame_chain (struct frame_info *frame)
size = 4;
else
size = REGISTER_RAW_SIZE (translate_insn_rn (FP_REGNUM, media_mode));
- return read_memory_integer (FRAME_FP (frame) + frame->extra_info->f_offset, size);
+ return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, size);
}
else
return 0;
@@ -1912,7 +1912,7 @@ sh_pop_frame (void)
generic_pop_dummy_frame ();
else
{
- fp = FRAME_FP (frame);
+ fp = get_frame_base (frame);
FRAME_INIT_SAVED_REGS (frame);
/* Copy regs from where they were saved in the frame */
@@ -1942,7 +1942,7 @@ sh64_pop_frame (void)
generic_pop_dummy_frame ();
else
{
- fp = FRAME_FP (frame);
+ fp = get_frame_base (frame);
FRAME_INIT_SAVED_REGS (frame);
/* Copy regs from where they were saved in the frame */
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 006f76f4619..b5251ef291a 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -320,7 +320,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
/* A frameless function interrupted by a signal did not change
the frame pointer, fix up frame pointer accordingly. */
- fi->frame = FRAME_FP (fi->next);
+ fi->frame = get_frame_base (fi->next);
fi->extra_info->bottom = fi->next->extra_info->bottom;
}
else
@@ -848,7 +848,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (frame1->pc >= (frame1->extra_info->bottom ?
frame1->extra_info->bottom : read_sp ())
- && frame1->pc <= FRAME_FP (frame1))
+ && frame1->pc <= get_frame_base (frame1))
{
/* Dummy frame. All but the window regs are in there somewhere.
The window registers are saved on the stack, just like in a
@@ -1112,7 +1112,7 @@ static void
sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
{
register int regnum;
- CORE_ADDR frame_addr = FRAME_FP (fi);
+ CORE_ADDR frame_addr = get_frame_base (fi);
if (!fi)
internal_error (__FILE__, __LINE__,
@@ -1122,7 +1122,7 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
if (fi->pc >= (fi->extra_info->bottom ?
fi->extra_info->bottom : read_sp ())
- && fi->pc <= FRAME_FP (fi))
+ && fi->pc <= get_frame_base (fi))
{
/* Dummy frame. All but the window regs are in there somewhere. */
for (regnum = G1_REGNUM; regnum < G1_REGNUM + 7; regnum++)
@@ -1205,7 +1205,7 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
}
/* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */
/* FIXME -- should this adjust for the sparc64 offset? */
- saved_regs_addr[SP_REGNUM] = FRAME_FP (fi);
+ saved_regs_addr[SP_REGNUM] = get_frame_base (fi);
}
/* Discard from the stack the innermost frame, restoring all saved registers.
diff --git a/gdb/stack.c b/gdb/stack.c
index a3731260220..969f5420fcd 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1737,7 +1737,7 @@ return_command (char *retval_exp, int from_tty)
if (selected_frame == NULL)
error ("No selected frame.");
thisfun = get_frame_function (selected_frame);
- selected_frame_addr = FRAME_FP (selected_frame);
+ selected_frame_addr = get_frame_base (selected_frame);
selected_frame_pc = selected_frame->pc;
/* Compute the return value (if any -- possibly getting errors here). */
@@ -1799,7 +1799,7 @@ return_command (char *retval_exp, int from_tty)
/* If we are at the end of a call dummy now, pop the dummy frame too. */
if (CALL_DUMMY_HAS_COMPLETED (read_pc(), read_sp (),
- FRAME_FP (get_current_frame ())))
+ get_frame_base (get_current_frame ())))
POP_FRAME;
/* If interactive, print the frame that is now current. */
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index b2900b60a41..d68f2411a28 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1862,7 +1862,7 @@ finish_tfind_command (char *msg,
struct symbol *old_func;
char *reply;
- old_frame_addr = FRAME_FP (get_current_frame ());
+ old_frame_addr = get_frame_base (get_current_frame ());
old_func = find_pc_function (read_pc ());
putpkt (msg);
@@ -1948,8 +1948,8 @@ finish_tfind_command (char *msg,
if (old_func == find_pc_function (read_pc ()) &&
(old_frame_addr == 0 ||
- FRAME_FP (get_current_frame ()) == 0 ||
- old_frame_addr == FRAME_FP (get_current_frame ())))
+ get_frame_base (get_current_frame ()) == 0 ||
+ old_frame_addr == get_frame_base (get_current_frame ())))
source_only = -1;
else
source_only = 1;
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 2ecd691cae6..8a8d22c35b2 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -895,7 +895,7 @@ v850_pop_frame (void)
read_memory_unsigned_integer (frame->saved_regs[regnum],
v850_register_raw_size (regnum)));
- write_register (E_SP_REGNUM, FRAME_FP (frame));
+ write_register (E_SP_REGNUM, get_frame_base (frame));
}
flush_cached_frames ();
diff --git a/gdb/valops.c b/gdb/valops.c
index a1da69dcba4..1cf22a8f209 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -660,7 +660,7 @@ value_assign (struct value *toval, struct value *fromval)
else
{
for (frame = get_current_frame ();
- frame && FRAME_FP (frame) != VALUE_FRAME (toval);
+ frame && get_frame_base (frame) != VALUE_FRAME (toval);
frame = get_prev_frame (frame))
;
value_reg = VALUE_FRAME_REGNUM (toval);
diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c
index e06f343f11d..2b06d805248 100644
--- a/gdb/z8k-tdep.c
+++ b/gdb/z8k-tdep.c
@@ -249,7 +249,7 @@ frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp)
pc = skip_adjust (get_pc_function_start (fip->pc), &locals);
{
- adr = FRAME_FP (fip) - locals;
+ adr = get_frame_base (fip) - locals;
for (i = 0; i < 8; i++)
{
int word = read_memory_short (pc);