aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-08 01:53:38 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-08 01:53:38 +0000
commit1e2330ba1fbf486c2851272e2aa09dd57ad367e6 (patch)
tree9a92bb6aff20e7c56c6efce933de70fd249841e1
parenta3982d4858ac407c7e879a57762bc4130d54d4b8 (diff)
downloadgdb-1e2330ba1fbf486c2851272e2aa09dd57ad367e6.zip
gdb-1e2330ba1fbf486c2851272e2aa09dd57ad367e6.tar.gz
gdb-1e2330ba1fbf486c2851272e2aa09dd57ad367e6.tar.bz2
2003-01-07 Andrew Cagney <cagney@redhat.com>
* alpha-tdep.c: Use get_frame_base. * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto. * h8300-tdep.c, i386-tdep.c, ia64-tdep.c, m68hc11-tdep.c: Ditto. * m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10200-tdep.c: Ditto. * mn10300-tdep.c, ns32k-tdep.c, s390-tdep.c, sh-tdep.c: Ditto. * sparc-tdep.c, v850-tdep.c, vax-tdep.c: Ditto. * x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto. * config/h8500/tm-h8500.h, config/mn10200/tm-mn10200.h: Ditto. * config/sparc/tm-sparc.h: Ditto.
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/alpha-tdep.c16
-rw-r--r--gdb/arm-tdep.c38
-rw-r--r--gdb/avr-tdep.c35
-rw-r--r--gdb/config/h8500/tm-h8500.h4
-rw-r--r--gdb/config/mn10200/tm-mn10200.h4
-rw-r--r--gdb/config/sparc/tm-sparc.h6
-rw-r--r--gdb/cris-tdep.c23
-rw-r--r--gdb/d10v-tdep.c16
-rw-r--r--gdb/h8300-tdep.c31
-rw-r--r--gdb/i386-tdep.c16
-rw-r--r--gdb/ia64-tdep.c71
-rw-r--r--gdb/m68hc11-tdep.c22
-rw-r--r--gdb/m68k-tdep.c38
-rw-r--r--gdb/mcore-tdep.c30
-rw-r--r--gdb/mips-tdep.c20
-rw-r--r--gdb/mn10200-tdep.c52
-rw-r--r--gdb/mn10300-tdep.c52
-rw-r--r--gdb/ns32k-tdep.c18
-rw-r--r--gdb/s390-tdep.c23
-rw-r--r--gdb/sh-tdep.c73
-rw-r--r--gdb/sparc-tdep.c34
-rw-r--r--gdb/v850-tdep.c23
-rw-r--r--gdb/vax-tdep.c22
-rw-r--r--gdb/x86-64-linux-tdep.c6
-rw-r--r--gdb/xstormy16-tdep.c21
26 files changed, 407 insertions, 299 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3b4b360..0ea9555 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
2003-01-07 Andrew Cagney <cagney@redhat.com>
+ * alpha-tdep.c: Use get_frame_base.
+ * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
+ * h8300-tdep.c, i386-tdep.c, ia64-tdep.c, m68hc11-tdep.c: Ditto.
+ * m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10200-tdep.c: Ditto.
+ * mn10300-tdep.c, ns32k-tdep.c, s390-tdep.c, sh-tdep.c: Ditto.
+ * sparc-tdep.c, v850-tdep.c, vax-tdep.c: Ditto.
+ * x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto.
+ * config/h8500/tm-h8500.h, config/mn10200/tm-mn10200.h: Ditto.
+ * config/sparc/tm-sparc.h: Ditto.
+
+2003-01-07 Andrew Cagney <cagney@redhat.com>
+
* frame.c (deprecated_get_frame_context): New function.
(deprecated_set_frame_context): New function.
* frame.h (deprecated_get_frame_context): Declare.
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 645b6b0..4b98514 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -411,7 +411,7 @@ alpha_find_saved_regs (struct frame_info *frame)
/* Fill in the offsets for the registers which gen_mask says
were saved. */
- reg_position = frame->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = get_frame_base (frame) + PROC_REG_OFFSET (proc_desc);
mask = PROC_REG_MASK (proc_desc);
returnreg = PROC_PC_REG (proc_desc);
@@ -436,7 +436,7 @@ alpha_find_saved_regs (struct frame_info *frame)
/* Fill in the offsets for the registers which float_mask says
were saved. */
- reg_position = frame->frame + PROC_FREG_OFFSET (proc_desc);
+ reg_position = get_frame_base (frame) + PROC_FREG_OFFSET (proc_desc);
mask = PROC_FREG_MASK (proc_desc);
for (ireg = 0; ireg <= 31; ++ireg)
@@ -454,7 +454,7 @@ alpha_frame_init_saved_regs (struct frame_info *fi)
{
if (get_frame_saved_regs (fi) == NULL)
alpha_find_saved_regs (fi);
- get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi);
}
static CORE_ADDR
@@ -473,7 +473,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
/* We have to get the saved sp from the sigcontext
if it is a signal handler frame. */
if (regno == SP_REGNUM && !(get_frame_type (fi) == SIGTRAMP_FRAME))
- return fi->frame;
+ return get_frame_base (fi);
else
{
if (get_frame_saved_regs (fi) == NULL)
@@ -495,7 +495,7 @@ alpha_frame_saved_pc (struct frame_info *frame)
: frame->extra_info->pc_reg;
if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
- return read_memory_integer (frame->frame - 8, 8);
+ return read_memory_integer (get_frame_base (frame) - 8, 8);
return read_next_frame_reg (frame, pcreg);
}
@@ -1043,13 +1043,13 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame)
static CORE_ADDR
alpha_frame_locals_address (struct frame_info *fi)
{
- return (fi->frame - fi->extra_info->localoff);
+ return (get_frame_base (fi) - fi->extra_info->localoff);
}
static CORE_ADDR
alpha_frame_args_address (struct frame_info *fi)
{
- return (fi->frame - (ALPHA_NUM_ARG_REGS * 8));
+ return (get_frame_base (fi) - (ALPHA_NUM_ARG_REGS * 8));
}
/* ALPHA stack frames are almost impenetrable. When execution stops,
@@ -1289,7 +1289,7 @@ alpha_pop_frame (void)
{
register int regnum;
struct frame_info *frame = get_current_frame ();
- CORE_ADDR new_sp = frame->frame;
+ CORE_ADDR new_sp = get_frame_base (frame);
alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 169564f..0d81ad0 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -291,14 +291,14 @@ arm_frameless_function_invocation (struct frame_info *fi)
static CORE_ADDR
arm_frame_args_address (struct frame_info *fi)
{
- return fi->frame;
+ return get_frame_base (fi);
}
/* The address of the local variables in the frame. */
static CORE_ADDR
arm_frame_locals_address (struct frame_info *fi)
{
- return fi->frame;
+ return get_frame_base (fi);
}
/* The number of arguments being passed in the frame. */
@@ -832,7 +832,7 @@ arm_scan_prologue (struct frame_info *fi)
{
/* Get address of the stmfd in the prologue of the callee;
the saved PC is the address of the stmfd + 8. */
- if (!safe_read_memory_integer (fi->frame, 4, &return_value))
+ if (!safe_read_memory_integer (get_frame_base (fi), 4, &return_value))
return;
else
{
@@ -996,7 +996,8 @@ arm_find_callers_reg (struct frame_info *fi, int regnum)
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
{
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
}
else if (get_frame_saved_regs (fi)[regnum] != 0)
{
@@ -1025,7 +1026,7 @@ arm_frame_chain (struct frame_info *fi)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
/* A generic call dummy's frame is the same as caller's. */
- return fi->frame;
+ return get_frame_base (fi);
if (get_frame_pc (fi) < LOWEST_PC)
return 0;
@@ -1061,7 +1062,7 @@ arm_frame_chain (struct frame_info *fi)
if (framereg == ARM_FP_REGNUM || framereg == THUMB_FP_REGNUM)
return arm_find_callers_reg (fi, framereg);
else
- return fi->frame + fi->extra_info->framesize;
+ return get_frame_base (fi) + fi->extra_info->framesize;
}
/* This function actually figures out the frame address for a given pc
@@ -1100,10 +1101,11 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 0, 0))
/* For generic dummy frames, pull the value direct from the frame.
Having an unwind function to do this would be nice. */
- sp = deprecated_read_register_dummy (get_frame_pc (fi->next), fi->next->frame,
+ sp = deprecated_read_register_dummy (get_frame_pc (fi->next),
+ get_frame_base (fi->next),
ARM_SP_REGNUM);
else
- sp = (fi->next->frame - fi->next->extra_info->frameoffset
+ sp = (get_frame_base (fi->next) - fi->next->extra_info->frameoffset
+ fi->next->extra_info->framesize);
/* Determine whether or not we're in a sigtramp frame.
@@ -1146,7 +1148,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 0, 0))
/* Next inner most frame is a dummy, just grab its frame.
Dummy frames always have the same FP as their caller. */
- deprecated_update_frame_base_hack (fi, fi->next->frame);
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
else if (fi->extra_info->framereg == ARM_FP_REGNUM
|| fi->extra_info->framereg == THUMB_FP_REGNUM)
{
@@ -1164,7 +1166,8 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
determined by arm_scan_prologue. */
for (reg = 0; reg < NUM_REGS; reg++)
if (get_frame_saved_regs (fi)[reg] != 0)
- get_frame_saved_regs (fi)[reg] += (fi->frame + fi->extra_info->framesize
+ get_frame_saved_regs (fi)[reg] += (get_frame_base (fi)
+ + fi->extra_info->framesize
- fi->extra_info->frameoffset);
}
}
@@ -1183,10 +1186,13 @@ arm_frame_saved_pc (struct frame_info *fi)
{
/* If a dummy frame, pull the PC out of the frame's register buffer. */
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, ARM_PC_REGNUM);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), ARM_PC_REGNUM);
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame - fi->extra_info->frameoffset,
- fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ (get_frame_base (fi)
+ - fi->extra_info->frameoffset),
+ get_frame_base (fi)))
{
return read_memory_integer (get_frame_saved_regs (fi)[ARM_PC_REGNUM],
REGISTER_RAW_SIZE (ARM_PC_REGNUM));
@@ -1508,10 +1514,12 @@ arm_pop_frame (void)
{
int regnum;
struct frame_info *frame = get_current_frame ();
- CORE_ADDR old_SP = (frame->frame - frame->extra_info->frameoffset
+ CORE_ADDR old_SP = (get_frame_base (frame) - frame->extra_info->frameoffset
+ frame->extra_info->framesize);
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
flush_cached_frames ();
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 779b5b4..59fcf10 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -749,11 +749,12 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi)
avr_scan_prologue (fi);
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
AVR_PC_REGNUM));
}
else if (!fi->next) /* this is the innermost frame? */
@@ -763,7 +764,7 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
struct frame_info *next_fi = fi->next;
if (fi->extra_info->framereg == AVR_SP_REGNUM)
- deprecated_update_frame_base_hack (fi, next_fi->frame + 2 /* ret addr */ + next_fi->extra_info->framesize);
+ deprecated_update_frame_base_hack (fi, get_frame_base (next_fi) + 2 /* ret addr */ + next_fi->extra_info->framesize);
/* FIXME: I don't analyse va_args functions */
else
{
@@ -798,7 +799,7 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi)
CORE_ADDR addr;
int i;
- addr = fi->frame + fi->extra_info->framesize + 1;
+ addr = get_frame_base (fi) + fi->extra_info->framesize + 1;
/* Return address in stack in different endianness */
@@ -831,7 +832,9 @@ avr_pop_frame (void)
CORE_ADDR saddr;
struct frame_info *frame = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
}
@@ -850,7 +853,7 @@ avr_pop_frame (void)
read_memory_unsigned_integer (saddr, 1));
}
else if (get_frame_saved_regs (frame)[regnum] && regnum == AVR_SP_REGNUM)
- write_register (regnum, frame->frame + 2);
+ write_register (regnum, get_frame_base (frame) + 2);
}
/* Don't forget the update the PC too! */
@@ -864,8 +867,11 @@ avr_pop_frame (void)
static CORE_ADDR
avr_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame),
AVR_PC_REGNUM);
else
return frame->extra_info->return_pc;
@@ -1015,7 +1021,7 @@ avr_skip_prologue (CORE_ADDR pc)
static CORE_ADDR
avr_frame_address (struct frame_info *fi)
{
- return avr_make_saddr (fi->frame);
+ return avr_make_saddr (get_frame_base (fi));
}
/* Given a GDB frame, determine the address of the calling function's
@@ -1029,16 +1035,19 @@ avr_frame_address (struct frame_info *fi)
static CORE_ADDR
avr_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
/* initialize the return_pc now */
frame->extra_info->return_pc
- = deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+ = deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame),
AVR_PC_REGNUM);
- return frame->frame;
+ return get_frame_base (frame);
}
return (frame->extra_info->is_main ? 0
- : frame->frame + frame->extra_info->framesize + 2 /* ret addr */ );
+ : get_frame_base (frame) + frame->extra_info->framesize + 2 /* ret addr */ );
}
/* Store the address of the place in which to copy the structure the
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index 4f8f347..6b91a71 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -215,9 +215,9 @@ extern CORE_ADDR h8500_frame_chain (struct frame_info *);
#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
extern CORE_ADDR frame_saved_pc (struct frame_info *frame);
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
+#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h
index f25578c..beb063e 100644
--- a/gdb/config/mn10200/tm-mn10200.h
+++ b/gdb/config/mn10200/tm-mn10200.h
@@ -177,8 +177,8 @@ extern CORE_ADDR mn10200_skip_prologue (CORE_ADDR);
#define FRAME_ARGS_SKIP 0
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
+#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
#define FRAME_NUM_ARGS(fi) (-1)
extern void mn10200_pop_frame (struct frame_info *);
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 404f685..b43e3a3 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -488,9 +488,9 @@ extern CORE_ADDR sparc_frame_chain (struct frame_info *);
extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *);
/* If the argument is on the stack, it will be here. */
-#define FRAME_ARGS_ADDRESS(FI) ((FI)->frame)
+#define FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
-#define FRAME_LOCALS_ADDRESS(FI) ((FI)->frame)
+#define FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
@@ -526,7 +526,7 @@ extern void sparc_print_extra_frame_info (struct frame_info *);
#define FRAME_SAVED_L0 0
#define FRAME_SAVED_I0 (8 * REGISTER_RAW_SIZE (L0_REGNUM))
-#define FRAME_STRUCT_ARGS_ADDRESS(FI) ((FI)->frame)
+#define FRAME_STRUCT_ARGS_ADDRESS(FI) (get_frame_base (FI))
/* Things needed for making the inferior call functions. */
/*
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index ec342b6..85c5088 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1157,7 +1157,8 @@ cris_frame_init_saved_regs (struct frame_info *fi)
CORE_ADDR ip;
struct symtab_and_line sal;
int best_limit;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+ get_frame_base (fi));
/* Examine the entire prologue. */
register int frameless_p = 0;
@@ -1211,14 +1212,16 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
fi->extra_info->return_pc = 0;
fi->extra_info->leaf_function = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ get_frame_base (fi),
+ get_frame_base (fi)))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
- SP_REGNUM));
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
fi->extra_info->return_pc =
- deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, PC_REGNUM);
+ deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), PC_REGNUM);
/* FIXME: Is this necessarily true? */
fi->extra_info->leaf_function = 0;
@@ -1252,9 +1255,11 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
CORE_ADDR
cris_frame_chain (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ get_frame_base (fi),
+ get_frame_base (fi)))
{
- return fi->frame;
+ return get_frame_base (fi);
}
else if (!inside_entry_file (get_frame_pc (fi)))
{
@@ -1510,7 +1515,9 @@ cris_pop_frame (void)
register int regno;
register int stack_offset = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ get_frame_base (fi),
+ get_frame_base (fi)))
{
/* This happens when we hit a breakpoint set at the entry point,
when returning from a dummy frame. */
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index a745a97..48139d1 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -505,9 +505,11 @@ d10v_extract_struct_value_address (char *regbuf)
static CORE_ADDR
d10v_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
return d10v_make_iaddr (deprecated_read_register_dummy (get_frame_pc (frame),
- frame->frame,
+ get_frame_base (frame),
PC_REGNUM));
else
return ((frame)->extra_info->return_pc);
@@ -681,8 +683,9 @@ d10v_frame_chain (struct frame_info *fi)
CORE_ADDR addr;
/* A generic call dummy's frame is the same as caller's. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
- return fi->frame;
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return get_frame_base (fi);
d10v_frame_init_saved_regs (fi);
@@ -794,7 +797,7 @@ d10v_frame_init_saved_regs (struct frame_info *fi)
unsigned short op1, op2;
int i;
- fp = fi->frame;
+ fp = get_frame_base (fi);
memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
next_addr = 0;
@@ -909,7 +912,8 @@ d10v_init_extra_frame_info (int fromleaf, struct frame_info *fi)
/* The call dummy doesn't save any registers on the stack, so we can
return now. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
return;
}
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 471a3c0..bd13bd6 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -475,7 +475,8 @@ h8300_frame_init_saved_regs (struct frame_info *fi)
struct symtab_and_line sal = find_pc_line (func_addr, 0);
CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi)) ? sal.end : get_frame_pc (fi);
/* This will fill in fields in fi. */
- h8300_examine_prologue (func_addr, limit, fi->frame, get_frame_saved_regs (fi), fi);
+ h8300_examine_prologue (func_addr, limit, get_frame_base (fi),
+ get_frame_saved_regs (fi), fi);
}
/* Else we're out of luck (can't debug completely stripped code).
FIXME. */
@@ -493,12 +494,15 @@ h8300_frame_init_saved_regs (struct frame_info *fi)
static CORE_ADDR
h8300_frame_chain (struct frame_info *thisframe)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), thisframe->frame, thisframe->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe),
+ get_frame_base (thisframe),
+ get_frame_base (thisframe)))
{ /* initialize the from_pc now */
thisframe->extra_info->from_pc =
- deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
+ deprecated_read_register_dummy (get_frame_pc (thisframe),
+ get_frame_base (thisframe),
E_PC_REGNUM);
- return thisframe->frame;
+ return get_frame_base (thisframe);
}
return get_frame_saved_regs (thisframe)[E_SP_REGNUM];
}
@@ -511,8 +515,11 @@ h8300_frame_chain (struct frame_info *thisframe)
static CORE_ADDR
h8300_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame),
E_PC_REGNUM);
else
return frame->extra_info->from_pc;
@@ -540,7 +547,8 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
static CORE_ADDR
h8300_frame_locals_address (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
return (CORE_ADDR) 0; /* Not sure what else to do... */
return fi->extra_info->locals_pointer;
}
@@ -551,7 +559,8 @@ h8300_frame_locals_address (struct frame_info *fi)
static CORE_ADDR
h8300_frame_args_address (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
return (CORE_ADDR) 0; /* Not sure what else to do... */
return fi->extra_info->args_pointer;
}
@@ -746,7 +755,9 @@ h8300_pop_frame (void)
unsigned regno;
struct frame_info *frame = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
}
@@ -761,7 +772,7 @@ h8300_pop_frame (void)
read_memory_integer (get_frame_saved_regs (frame)[regno],
BINWORD));
else if (get_frame_saved_regs (frame)[regno] && regno == E_SP_REGNUM)
- write_register (regno, frame->frame + 2 * BINWORD);
+ write_register (regno, get_frame_base (frame) + 2 * BINWORD);
}
/* Don't forget to update the PC too! */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index f4a7df0..6252926 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -512,14 +512,14 @@ static CORE_ADDR
i386_frame_chain (struct frame_info *frame)
{
if (pc_in_dummy_frame (get_frame_pc (frame)))
- return frame->frame;
+ return get_frame_base (frame);
if (get_frame_type (frame) == SIGTRAMP_FRAME
|| i386_frameless_signal_p (frame))
- return frame->frame;
+ return get_frame_base (frame);
if (! inside_entry_file (get_frame_pc (frame)))
- return read_memory_unsigned_integer (frame->frame, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame), 4);
return 0;
}
@@ -585,7 +585,7 @@ i386_frame_saved_pc (struct frame_info *frame)
return read_memory_unsigned_integer (sp, 4);
}
- return read_memory_unsigned_integer (frame->frame + 4, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);
}
/* Immediately after a function call, return the saved pc. */
@@ -719,7 +719,7 @@ i386_frame_init_saved_regs (struct frame_info *fip)
if (locals >= 0)
{
- addr = fip->frame - 4 - locals;
+ addr = get_frame_base (fip) - 4 - locals;
for (i = 0; i < 8; i++)
{
op = codestream_get ();
@@ -735,8 +735,8 @@ i386_frame_init_saved_regs (struct frame_info *fip)
}
}
- get_frame_saved_regs (fip)[PC_REGNUM] = fip->frame + 4;
- get_frame_saved_regs (fip)[FP_REGNUM] = fip->frame;
+ get_frame_saved_regs (fip)[PC_REGNUM] = get_frame_base (fip) + 4;
+ get_frame_saved_regs (fip)[FP_REGNUM] = get_frame_base (fip);
}
/* Return PC of first real instruction. */
@@ -1371,7 +1371,7 @@ i386_svr4_sigcontext_addr (struct frame_info *frame)
gdb_assert (sigcontext_offset != -1);
if (frame->next)
- return frame->next->frame + sigcontext_offset;
+ return get_frame_base (frame->next) + sigcontext_offset;
return read_register (SP_REGNUM) + sigcontext_offset;
}
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 46285edd..61605b7 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -335,7 +335,7 @@ read_sigcontext_register (struct frame_info *frame, int regnum)
internal_error (__FILE__, __LINE__,
"read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
- regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum);
+ regaddr = SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regnum);
if (regaddr)
return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum));
else
@@ -705,15 +705,18 @@ ia64_frame_chain (struct frame_info *frame)
{
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame, sp_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame;
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return get_frame_base (frame);
else
{
FRAME_INIT_SAVED_REGS (frame);
if (get_frame_saved_regs (frame)[IA64_VFP_REGNUM])
return read_memory_integer (get_frame_saved_regs (frame)[IA64_VFP_REGNUM], 8);
else
- return frame->frame + frame->extra_info->mem_stack_frame_size;
+ return (get_frame_base (frame)
+ + frame->extra_info->mem_stack_frame_size);
}
}
@@ -722,8 +725,11 @@ ia64_frame_saved_pc (struct frame_info *frame)
{
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame, pc_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame, pc_regnum);
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame), pc_regnum);
else
{
FRAME_INIT_SAVED_REGS (frame);
@@ -937,7 +943,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
/* Hmm... whether or not this will work will depend on
where the pc is. If it's still early in the prologue
this'll be wrong. FIXME */
- spill_addr = (frame ? frame->frame : 0)
+ spill_addr = (frame ? get_frame_base (frame) : 0)
+ (rM == 12 ? 0 : mem_stack_frame_size)
+ imm;
spill_reg = rN;
@@ -1170,37 +1176,37 @@ ia64_frame_init_saved_regs (struct frame_info *frame)
frame_saved_regs_zalloc (frame);
get_frame_saved_regs (frame)[IA64_VRAP_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_IP_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_IP_REGNUM);
get_frame_saved_regs (frame)[IA64_CFM_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CFM_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_CFM_REGNUM);
get_frame_saved_regs (frame)[IA64_PSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PSR_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_PSR_REGNUM);
#if 0
get_frame_saved_regs (frame)[IA64_BSP_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM);
#endif
get_frame_saved_regs (frame)[IA64_RNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_RNAT_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_RNAT_REGNUM);
get_frame_saved_regs (frame)[IA64_CCV_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CCV_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_CCV_REGNUM);
get_frame_saved_regs (frame)[IA64_UNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_UNAT_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_UNAT_REGNUM);
get_frame_saved_regs (frame)[IA64_FPSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_FPSR_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_FPSR_REGNUM);
get_frame_saved_regs (frame)[IA64_PFS_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PFS_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_PFS_REGNUM);
get_frame_saved_regs (frame)[IA64_LC_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_LC_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_LC_REGNUM);
for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
if (regno != sp_regnum)
get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
for (regno = IA64_FR2_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
}
else
{
@@ -1233,12 +1239,15 @@ ia64_get_saved_register (char *raw_buffer,
if (lval != NULL)
*lval = not_lval;
- is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame);
+ is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame));
if (regnum == SP_REGNUM && frame->next)
{
/* Handle SP values for all frames but the topmost. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame);
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ get_frame_base (frame));
}
else if (regnum == IA64_BSP_REGNUM)
{
@@ -1251,7 +1260,8 @@ ia64_get_saved_register (char *raw_buffer,
for the frame pointer, it'll be found by ia64_find_saved_register()
above. If the function lacks one of these frame pointers, we can
still provide a value since we know the size of the frame */
- CORE_ADDR vfp = frame->frame + frame->extra_info->mem_stack_frame_size;
+ CORE_ADDR vfp = (get_frame_base (frame)
+ + frame->extra_info->mem_stack_frame_size);
store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
}
else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
@@ -1481,8 +1491,9 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
{
CORE_ADDR bsp, cfm;
int next_frame_is_call_dummy = ((frame->next != NULL)
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame->next), frame->next->frame,
- frame->next->frame));
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame->next),
+ get_frame_base (frame->next),
+ get_frame_base (frame->next)));
frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info));
@@ -1500,10 +1511,10 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
else if (next_frame_is_call_dummy)
{
bsp = deprecated_read_register_dummy (get_frame_pc (frame->next),
- frame->next->frame,
+ get_frame_base (frame->next),
IA64_BSP_REGNUM);
cfm = deprecated_read_register_dummy (get_frame_pc (frame->next),
- frame->next->frame,
+ get_frame_base (frame->next),
IA64_CFM_REGNUM);
}
else
@@ -1517,9 +1528,11 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME))
cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
else if (frn->next
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frn->next), frn->next->frame,
- frn->next->frame))
- cfm = deprecated_read_register_dummy (get_frame_pc (frn->next), frn->next->frame,
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frn->next),
+ get_frame_base (frn->next),
+ get_frame_base (frn->next)))
+ cfm = deprecated_read_register_dummy (get_frame_pc (frn->next),
+ get_frame_base (frn->next),
IA64_PFS_REGNUM);
else
cfm = read_register (IA64_PFS_REGNUM);
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index fa7b6f5..b4840e8 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -409,7 +409,7 @@ m68hc11_frame_args_address (struct frame_info *frame)
{
CORE_ADDR addr;
- addr = frame->frame + frame->extra_info->size + STACK_CORRECTION + 2;
+ addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION + 2;
if (frame->extra_info->return_kind == RETURN_RTC)
addr += 1;
else if (frame->extra_info->return_kind == RETURN_RTI)
@@ -421,7 +421,7 @@ m68hc11_frame_args_address (struct frame_info *frame)
static CORE_ADDR
m68hc11_frame_locals_address (struct frame_info *frame)
{
- return frame->frame;
+ return get_frame_base (frame);
}
/* Discard from the stack the innermost frame, restoring all saved
@@ -434,7 +434,9 @@ m68hc11_pop_frame (void)
register CORE_ADDR fp, sp;
register int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
@@ -812,19 +814,21 @@ m68hc11_frame_chain (struct frame_info *frame)
{
CORE_ADDR addr;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame; /* dummy frame same as caller's frame */
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return get_frame_base (frame); /* dummy frame same as caller's frame */
if (frame->extra_info->return_pc == 0
|| inside_entry_file (frame->extra_info->return_pc))
return (CORE_ADDR) 0;
- if (frame->frame == 0)
+ if (get_frame_base (frame) == 0)
{
return (CORE_ADDR) 0;
}
- addr = frame->frame + frame->extra_info->size + STACK_CORRECTION - 2;
+ addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION - 2;
addr = read_memory_unsigned_integer (addr, 2) & 0x0FFFF;
return addr;
}
@@ -847,10 +851,10 @@ m68hc11_frame_init_saved_regs (struct frame_info *fi)
pc = get_frame_pc (fi);
fi->extra_info->return_kind = m68hc11_get_return_insn (pc);
- m68hc11_guess_from_prologue (pc, fi->frame, &pc, &fi->extra_info->size,
+ m68hc11_guess_from_prologue (pc, get_frame_base (fi), &pc, &fi->extra_info->size,
get_frame_saved_regs (fi));
- addr = fi->frame + fi->extra_info->size + STACK_CORRECTION;
+ addr = get_frame_base (fi) + fi->extra_info->size + STACK_CORRECTION;
if (soft_regs[SOFT_FP_REGNUM].name)
get_frame_saved_regs (fi)[SOFT_FP_REGNUM] = addr - 2;
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index bcaae9d..0e36e87 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -258,9 +258,9 @@ static CORE_ADDR
m68k_frame_chain (struct frame_info *thisframe)
{
if (get_frame_type (thisframe) == SIGTRAMP_FRAME)
- return thisframe->frame;
+ return get_frame_base (thisframe);
else if (!inside_entry_file (get_frame_pc (thisframe)))
- return read_memory_unsigned_integer (thisframe->frame, 4);
+ return read_memory_unsigned_integer (get_frame_base (thisframe), 4);
else
return 0;
}
@@ -284,14 +284,14 @@ m68k_frame_saved_pc (struct frame_info *frame)
if (get_frame_type (frame) == SIGTRAMP_FRAME)
{
if (frame->next)
- return read_memory_unsigned_integer (frame->next->frame
+ return read_memory_unsigned_integer (get_frame_base (frame->next)
+ SIG_PC_FP_OFFSET, 4);
else
return read_memory_unsigned_integer (read_register (SP_REGNUM)
+ SIG_PC_FP_OFFSET - 8, 4);
}
else
- return read_memory_unsigned_integer (frame->frame + 4, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);
}
@@ -332,17 +332,17 @@ delta68_frame_args_address (struct frame_info *frame_info)
/* we assume here that the only frameless functions are the system calls
or other functions who do not put anything on the stack. */
if (get_frame_type (frame_info) == SIGTRAMP_FRAME)
- return frame_info->frame + 12;
+ return get_frame_base (frame_info) + 12;
else if (frameless_look_for_prologue (frame_info))
{
/* Check for an interrupted system call */
if (frame_info->next && (get_frame_type (frame_info->next) == SIGTRAMP_FRAME))
- return frame_info->next->frame + 16;
+ return get_frame_base (frame_info->next) + 16;
else
- return frame_info->frame + 4;
+ return get_frame_base (frame_info) + 4;
}
else
- return frame_info->frame;
+ return get_frame_base (frame_info);
}
CORE_ADDR
@@ -589,7 +589,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
/* First possible address for a pc in a call dummy for this frame. */
CORE_ADDR possible_call_dummy_start =
- frame_info->frame - 28 - FP_REGNUM * 4 - 4 - 8 * 12;
+ get_frame_base (frame_info) - 28 - FP_REGNUM * 4 - 4 - 8 * 12;
int nextinsn;
@@ -601,7 +601,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
memset (get_frame_saved_regs (frame_info), 0, SIZEOF_FRAME_SAVED_REGS);
if (get_frame_pc (frame_info) >= possible_call_dummy_start
- && get_frame_pc (frame_info) <= frame_info->frame)
+ && get_frame_pc (frame_info) <= get_frame_base (frame_info))
{
/* It is a call dummy. We could just stop now, since we know
@@ -609,7 +609,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
to parse the "prologue" which is part of the call dummy.
This is needlessly complex and confusing. FIXME. */
- next_addr = frame_info->frame;
+ next_addr = get_frame_base (frame_info);
pc = possible_call_dummy_start;
}
else
@@ -622,7 +622,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
{
/* pea %fp
move.l %sp, %fp */
- next_addr = frame_info->frame;
+ next_addr = get_frame_base (frame_info);
pc += 4;
}
else if (P_LINKL_FP == nextinsn)
@@ -630,7 +630,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
/* Find the address above the saved
regs using the amount of storage from the link instruction. */
{
- next_addr = frame_info->frame + read_memory_integer (pc + 2, 4);
+ next_addr = get_frame_base (frame_info) + read_memory_integer (pc + 2, 4);
pc += 6;
}
else if (P_LINKW_FP == nextinsn)
@@ -638,7 +638,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
/* Find the address above the saved
regs using the amount of storage from the link instruction. */
{
- next_addr = frame_info->frame + read_memory_integer (pc + 2, 2);
+ next_addr = get_frame_base (frame_info) + read_memory_integer (pc + 2, 2);
pc += 4;
}
else
@@ -667,7 +667,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
{
register CORE_ADDR addr;
- addr = frame_info->frame + read_memory_integer (pc + 4, 2);
+ addr = get_frame_base (frame_info) + read_memory_integer (pc + 4, 2);
/* Regmask's low bit is for register fp7, the first pushed */
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
@@ -694,7 +694,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
{
register CORE_ADDR addr;
- addr = frame_info->frame + read_memory_integer (pc + 4, 2);
+ addr = get_frame_base (frame_info) + read_memory_integer (pc + 4, 2);
/* Regmask's low bit is for register 0, the first written */
for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
if (regmask & 1)
@@ -742,9 +742,9 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
break;
}
lose:;
- get_frame_saved_regs (frame_info)[SP_REGNUM] = (frame_info)->frame + 8;
- get_frame_saved_regs (frame_info)[FP_REGNUM] = (frame_info)->frame;
- get_frame_saved_regs (frame_info)[PC_REGNUM] = (frame_info)->frame + 4;
+ get_frame_saved_regs (frame_info)[SP_REGNUM] = get_frame_base (frame_info) + 8;
+ get_frame_saved_regs (frame_info)[FP_REGNUM] = get_frame_base (frame_info);
+ get_frame_saved_regs (frame_info)[PC_REGNUM] = get_frame_base (frame_info) + 4;
#ifdef SIG_SP_FP_OFFSET
/* Adjust saved SP_REGNUM for fake _sigtramp frames. */
if ((get_frame_type (frame_info) == SIGTRAMP_FRAME) && frame_info->next)
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 6f05f4e..26ba057 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -627,7 +627,7 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue)
{
if (register_offsets[rn] >= 0)
{
- get_frame_saved_regs (fi)[rn] = fi->frame - register_offsets[rn];
+ get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - register_offsets[rn];
mcore_insn_debug (("Saved register %s stored at 0x%08x, value=0x%08x\n",
mcore_register_names[rn], fi->saved_regs[rn],
read_memory_integer (fi->saved_regs[rn], 4)));
@@ -669,7 +669,7 @@ mcore_frame_chain (struct frame_info * fi)
If our caller does not have a frame pointer, then his frame base
is <our base> + -<caller's frame size>. */
- dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), fi->frame);
+ dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
if (dummy->extra_info->status & MY_FRAME_IN_FP)
{
@@ -693,7 +693,7 @@ mcore_frame_chain (struct frame_info * fi)
else
{
/* Our caller does not have a frame pointer. */
- callers_addr = fi->frame + dummy->extra_info->framesize;
+ callers_addr = get_frame_base (fi) + dummy->extra_info->framesize;
}
return callers_addr;
@@ -724,13 +724,13 @@ mcore_skip_prologue (CORE_ADDR pc)
CORE_ADDR
mcore_frame_args_address (struct frame_info * fi)
{
- return fi->frame - fi->extra_info->framesize;
+ return get_frame_base (fi) - fi->extra_info->framesize;
}
CORE_ADDR
mcore_frame_locals_address (struct frame_info * fi)
{
- return fi->frame - fi->extra_info->framesize;
+ return get_frame_base (fi) - fi->extra_info->framesize;
}
/* Return the frame pointer in use at address PC. */
@@ -758,8 +758,10 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi != NULL; fi = fi->next)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
else if (get_frame_saved_regs (fi)[regnum] != 0)
return read_memory_integer (get_frame_saved_regs (fi)[regnum],
REGISTER_SIZE);
@@ -774,8 +776,10 @@ CORE_ADDR
mcore_frame_saved_pc (struct frame_info * fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, PC_REGNUM);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), PC_REGNUM);
else
return mcore_find_callers_reg (fi, PR_REGNUM);
}
@@ -791,7 +795,8 @@ mcore_pop_frame (void)
int rn;
struct frame_info *fi = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
generic_pop_dummy_frame ();
else
{
@@ -1048,11 +1053,12 @@ mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
fi->extra_info->status = 0;
fi->extra_info->framesize = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, SP_REGNUM));
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
}
else
mcore_analyze_prologue (fi, 0, 0);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 267b780..4e3546a 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -1420,17 +1420,17 @@ mips_find_saved_regs (struct frame_info *fci)
{
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
- reg_position = fci->frame + SIGFRAME_REGSAVE_OFF
+ reg_position = get_frame_base (fci) + SIGFRAME_REGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE;
get_frame_saved_regs (fci)[ireg] = reg_position;
}
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
- reg_position = fci->frame + SIGFRAME_FPREGSAVE_OFF
+ reg_position = get_frame_base (fci) + SIGFRAME_FPREGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE;
get_frame_saved_regs (fci)[FP0_REGNUM + ireg] = reg_position;
}
- get_frame_saved_regs (fci)[PC_REGNUM] = fci->frame + SIGFRAME_PC_OFF;
+ get_frame_saved_regs (fci)[PC_REGNUM] = get_frame_base (fci) + SIGFRAME_PC_OFF;
return;
}
@@ -1496,7 +1496,7 @@ mips_find_saved_regs (struct frame_info *fci)
/* Fill in the offsets for the registers which gen_mask says
were saved. */
- reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = get_frame_base (fci) + PROC_REG_OFFSET (proc_desc);
for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1)
if (gen_mask & 0x80000000)
{
@@ -1517,7 +1517,7 @@ mips_find_saved_regs (struct frame_info *fci)
int sreg_count = (inst >> 6) & 3;
/* Check if the ra register was pushed on the stack. */
- reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = get_frame_base (fci) + PROC_REG_OFFSET (proc_desc);
if (inst & 0x20)
reg_position -= MIPS_SAVED_REGSIZE;
@@ -1532,7 +1532,7 @@ mips_find_saved_regs (struct frame_info *fci)
/* Fill in the offsets for the registers which float_mask says
were saved. */
- reg_position = fci->frame + PROC_FREG_OFFSET (proc_desc);
+ reg_position = get_frame_base (fci) + PROC_FREG_OFFSET (proc_desc);
/* Apparently, the freg_offset gives the offset to the first 64 bit
saved.
@@ -1576,7 +1576,7 @@ mips_frame_init_saved_regs (struct frame_info *frame)
{
mips_find_saved_regs (frame);
}
- get_frame_saved_regs (frame)[SP_REGNUM] = frame->frame;
+ get_frame_saved_regs (frame)[SP_REGNUM] = get_frame_base (frame);
}
static CORE_ADDR
@@ -1704,7 +1704,7 @@ mips_frame_saved_pc (struct frame_info *frame)
saved_pc = tmp;
}
else if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
- saved_pc = read_memory_integer (frame->frame - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE);
+ saved_pc = read_memory_integer (get_frame_base (frame) - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE);
else
saved_pc = read_next_frame_reg (frame, pcreg);
@@ -2433,7 +2433,7 @@ mips_frame_chain (struct frame_info *frame)
/* A dummy frame, uses SP not FP. Get the old SP value. If all
is well, frame->frame the bottom of the current frame will
contain that value. */
- return frame->frame;
+ return get_frame_base (frame);
}
/* Look up the procedure descriptor for this PC. */
@@ -2517,7 +2517,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
value of the stack pointer register. The other saved_regs
values are addresses (in the inferior) at which a given
register's value may be found. */
- get_frame_saved_regs (fci)[SP_REGNUM] = fci->frame;
+ get_frame_saved_regs (fci)[SP_REGNUM] = get_frame_base (fci);
}
}
diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c
index 808f7e4..1e6827b 100644
--- a/gdb/mn10200-tdep.c
+++ b/gdb/mn10200-tdep.c
@@ -435,10 +435,10 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
{
if (fi)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
}
return addr;
}
@@ -455,10 +455,10 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
{
if (fi)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
}
return addr;
}
@@ -472,10 +472,10 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
{
if (fi && fi->next == NULL)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
}
return addr;
}
@@ -488,16 +488,16 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
/* Now that we know the size of the outgoing arguments, fix
fi->frame again if this is the innermost frame. */
if (fi && fi->next == NULL)
- deprecated_update_frame_base_hack (fi, fi->frame - outgoing_args_size);
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi) - outgoing_args_size);
/* Note the register save information and update the stack
size for this frame too. */
if (fi)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
fi->stack_size += outgoing_args_size;
}
/* There can be no more prologue insns, so return now. */
@@ -534,7 +534,7 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
status = target_read_memory (addr + 2, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[2] = (fi->frame + stack_size
+ fi->fsr.regs[2] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
}
addr += 3;
@@ -551,7 +551,7 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
status = target_read_memory (addr + 2, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[3] = (fi->frame + stack_size
+ fi->fsr.regs[3] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
}
addr += 3;
@@ -568,7 +568,7 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
status = target_read_memory (addr + 1, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[5] = (fi->frame + stack_size
+ fi->fsr.regs[5] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
}
addr += 2;
@@ -585,7 +585,7 @@ mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
status = target_read_memory (addr + 1, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[6] = (fi->frame + stack_size
+ fi->fsr.regs[6] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
fi->status &= ~CALLER_A2_IN_A0;
}
@@ -641,7 +641,7 @@ mn10200_frame_chain (struct frame_info *fi)
So we set up a dummy frame and call mn10200_analyze_prologue to
find stuff for us. */
deprecated_update_frame_pc_hack (dummy_frame, FRAME_SAVED_PC (fi));
- deprecated_update_frame_base_hack (dummy_frame, fi->frame);
+ deprecated_update_frame_base_hack (dummy_frame, get_frame_base (fi));
memset (dummy_frame->fsr.regs, '\000', sizeof dummy_frame->fsr.regs);
dummy_frame->status = 0;
dummy_frame->stack_size = 0;
@@ -663,7 +663,7 @@ mn10200_frame_chain (struct frame_info *fi)
{
/* Our caller does not have a frame pointer. So his frame starts
at the base of our frame (fi->frame) + <his size> + 4 (saved pc). */
- ret = fi->frame + -dummy_frame->stack_size + 4;
+ ret = get_frame_base (fi) + -dummy_frame->stack_size + 4;
}
do_cleanups (old_chain);
return ret;
@@ -689,7 +689,9 @@ mn10200_pop_frame (struct frame_info *frame)
{
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
@@ -858,7 +860,7 @@ CORE_ADDR
mn10200_frame_saved_pc (struct frame_info *fi)
{
/* The saved PC will always be at the base of the current frame. */
- return (read_memory_integer (fi->frame, REGISTER_SIZE) & 0xffffff);
+ return (read_memory_integer (get_frame_base (fi), REGISTER_SIZE) & 0xffffff);
}
/* Function: init_extra_frame_info
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index f185fdf..0753492 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -233,59 +233,59 @@ set_movm_offsets (struct frame_info *fi, int movm_args)
/* The `other' bit leaves a blank area of four bytes at the
beginning of its block of saved registers, making it 32 bytes
long in total. */
- get_frame_saved_regs (fi)[LAR_REGNUM] = fi->frame + offset + 4;
- get_frame_saved_regs (fi)[LIR_REGNUM] = fi->frame + offset + 8;
- get_frame_saved_regs (fi)[MDR_REGNUM] = fi->frame + offset + 12;
- get_frame_saved_regs (fi)[A0_REGNUM + 1] = fi->frame + offset + 16;
- get_frame_saved_regs (fi)[A0_REGNUM] = fi->frame + offset + 20;
- get_frame_saved_regs (fi)[D0_REGNUM + 1] = fi->frame + offset + 24;
- get_frame_saved_regs (fi)[D0_REGNUM] = fi->frame + offset + 28;
+ get_frame_saved_regs (fi)[LAR_REGNUM] = get_frame_base (fi) + offset + 4;
+ get_frame_saved_regs (fi)[LIR_REGNUM] = get_frame_base (fi) + offset + 8;
+ get_frame_saved_regs (fi)[MDR_REGNUM] = get_frame_base (fi) + offset + 12;
+ get_frame_saved_regs (fi)[A0_REGNUM + 1] = get_frame_base (fi) + offset + 16;
+ get_frame_saved_regs (fi)[A0_REGNUM] = get_frame_base (fi) + offset + 20;
+ get_frame_saved_regs (fi)[D0_REGNUM + 1] = get_frame_base (fi) + offset + 24;
+ get_frame_saved_regs (fi)[D0_REGNUM] = get_frame_base (fi) + offset + 28;
offset += 32;
}
if (movm_args & movm_a3_bit)
{
- get_frame_saved_regs (fi)[A3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A3_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (movm_args & movm_a2_bit)
{
- get_frame_saved_regs (fi)[A2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A2_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (movm_args & movm_d3_bit)
{
- get_frame_saved_regs (fi)[D3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D3_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (movm_args & movm_d2_bit)
{
- get_frame_saved_regs (fi)[D2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D2_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (AM33_MODE)
{
if (movm_args & movm_exother_bit)
{
- get_frame_saved_regs (fi)[MCVF_REGNUM] = fi->frame + offset;
- get_frame_saved_regs (fi)[MCRL_REGNUM] = fi->frame + offset + 4;
- get_frame_saved_regs (fi)[MCRH_REGNUM] = fi->frame + offset + 8;
- get_frame_saved_regs (fi)[MDRQ_REGNUM] = fi->frame + offset + 12;
- get_frame_saved_regs (fi)[E0_REGNUM + 1] = fi->frame + offset + 16;
- get_frame_saved_regs (fi)[E0_REGNUM + 0] = fi->frame + offset + 20;
+ get_frame_saved_regs (fi)[MCVF_REGNUM] = get_frame_base (fi) + offset;
+ get_frame_saved_regs (fi)[MCRL_REGNUM] = get_frame_base (fi) + offset + 4;
+ get_frame_saved_regs (fi)[MCRH_REGNUM] = get_frame_base (fi) + offset + 8;
+ get_frame_saved_regs (fi)[MDRQ_REGNUM] = get_frame_base (fi) + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 1] = get_frame_base (fi) + offset + 16;
+ get_frame_saved_regs (fi)[E0_REGNUM + 0] = get_frame_base (fi) + offset + 20;
offset += 24;
}
if (movm_args & movm_exreg1_bit)
{
- get_frame_saved_regs (fi)[E0_REGNUM + 7] = fi->frame + offset;
- get_frame_saved_regs (fi)[E0_REGNUM + 6] = fi->frame + offset + 4;
- get_frame_saved_regs (fi)[E0_REGNUM + 5] = fi->frame + offset + 8;
- get_frame_saved_regs (fi)[E0_REGNUM + 4] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 7] = get_frame_base (fi) + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 6] = get_frame_base (fi) + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 5] = get_frame_base (fi) + offset + 8;
+ get_frame_saved_regs (fi)[E0_REGNUM + 4] = get_frame_base (fi) + offset + 12;
offset += 16;
}
if (movm_args & movm_exreg0_bit)
{
- get_frame_saved_regs (fi)[E0_REGNUM + 3] = fi->frame + offset;
- get_frame_saved_regs (fi)[E0_REGNUM + 2] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 3] = get_frame_base (fi) + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 2] = get_frame_base (fi) + offset + 4;
offset += 8;
}
}
@@ -686,7 +686,7 @@ mn10300_frame_chain (struct frame_info *fi)
/* The easiest way to get that info is to analyze our caller's frame.
So we set up a dummy frame and call mn10300_analyze_prologue to
find stuff for us. */
- dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), fi->frame);
+ dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
if (dummy->extra_info->status & MY_FRAME_IN_FP)
{
@@ -704,7 +704,7 @@ mn10300_frame_chain (struct frame_info *fi)
/* Our caller does not have a frame pointer. So his frame starts
at the base of our frame (fi->frame) + register save space
+ <his size>. */
- return fi->frame + adjust + -dummy->extra_info->stack_size;
+ return get_frame_base (fi) + adjust + -dummy->extra_info->stack_size;
}
}
@@ -877,7 +877,7 @@ mn10300_frame_saved_pc (struct frame_info *fi)
{
int adjust = saved_regs_size (fi);
- return (read_memory_integer (fi->frame + adjust, REGISTER_SIZE));
+ return (read_memory_integer (get_frame_base (fi) + adjust, REGISTER_SIZE));
}
/* Function: mn10300_init_extra_frame_info
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index f9fe294..357028b 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -311,7 +311,7 @@ ns32k_frame_chain (struct frame_info *frame)
if (inside_entry_file (get_frame_pc (frame)))
return 0;
- return (read_memory_integer (frame->frame, 4));
+ return (read_memory_integer (get_frame_base (frame), 4));
}
@@ -345,14 +345,14 @@ ns32k_frame_saved_pc (struct frame_info *frame)
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return (ns32k_sigtramp_saved_pc (frame)); /* XXXJRT */
- return (read_memory_integer (frame->frame + 4, 4));
+ return (read_memory_integer (get_frame_base (frame) + 4, 4));
}
static CORE_ADDR
ns32k_frame_args_address (struct frame_info *frame)
{
if (ns32k_get_enter_addr (get_frame_pc (frame)) > 1)
- return (frame->frame);
+ return (get_frame_base (frame));
return (read_register (SP_REGNUM) - 4);
}
@@ -360,7 +360,7 @@ ns32k_frame_args_address (struct frame_info *frame)
static CORE_ADDR
ns32k_frame_locals_address (struct frame_info *frame)
{
- return (frame->frame);
+ return (get_frame_base (frame));
}
/* Code to initialize the addresses of the saved registers of frame described
@@ -385,7 +385,7 @@ ns32k_frame_init_saved_regs (struct frame_info *frame)
{
regmask = read_memory_integer (enter_addr + 1, 1) & 0xff;
localcount = ns32k_localcount (enter_addr);
- next_addr = frame->frame + localcount;
+ next_addr = get_frame_base (frame) + localcount;
for (regnum = 0; regnum < 8; regnum++)
{
@@ -393,9 +393,9 @@ ns32k_frame_init_saved_regs (struct frame_info *frame)
get_frame_saved_regs (frame)[regnum] = next_addr -= 4;
}
- get_frame_saved_regs (frame)[SP_REGNUM] = frame->frame + 4;
- get_frame_saved_regs (frame)[PC_REGNUM] = frame->frame + 4;
- get_frame_saved_regs (frame)[FP_REGNUM] = read_memory_integer (frame->frame, 4);
+ get_frame_saved_regs (frame)[SP_REGNUM] = get_frame_base (frame) + 4;
+ get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 4;
+ get_frame_saved_regs (frame)[FP_REGNUM] = read_memory_integer (get_frame_base (frame), 4);
}
else if (enter_addr == 1)
{
@@ -428,7 +428,7 @@ ns32k_pop_frame (void)
CORE_ADDR fp;
int regnum;
- fp = frame->frame;
+ fp = get_frame_base (frame);
FRAME_INIT_SAVED_REGS (frame);
for (regnum = 0; regnum < 8; regnum++)
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 390a1a8..bccc026 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -285,9 +285,9 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
save_link_regidx = subtract_sp_regidx = 0;
if (fextra_info)
{
- if (fi && fi->frame)
+ if (fi && get_frame_base (fi))
{
- orig_sp = fi->frame;
+ orig_sp = get_frame_base (fi);
if (! init_extra_info && fextra_info->initialised)
orig_sp += fextra_info->stack_bought;
saved_regs = get_frame_saved_regs (fi);
@@ -829,11 +829,10 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
if (sighandler_fi)
{
if (s390_frameless_function_invocation (sighandler_fi))
- orig_sp = sighandler_fi->frame;
+ orig_sp = get_frame_base (sighandler_fi);
else
orig_sp = ADDR_BITS_REMOVE ((CORE_ADDR)
- read_memory_integer (sighandler_fi->
- frame,
+ read_memory_integer (get_frame_base (sighandler_fi),
S390_GPR_SIZE));
if (orig_sp && sigcaller_pc)
{
@@ -944,7 +943,7 @@ s390_frame_args_address (struct frame_info *fi)
{
/* Apparently gdb already knows gdb_args_offset itself */
- return fi->frame;
+ return get_frame_base (fi);
}
@@ -954,8 +953,10 @@ s390_frame_saved_pc_nofix (struct frame_info *fi)
if (fi->extra_info && fi->extra_info->saved_pc_valid)
return fi->extra_info->saved_pc;
- if (deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, S390_PC_REGNUM);
+ if (deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), S390_PC_REGNUM);
s390_frame_init_saved_regs (fi);
if (fi->extra_info)
@@ -1008,8 +1009,10 @@ s390_frame_chain (struct frame_info *thisframe)
{
CORE_ADDR prev_fp = 0;
- if (deprecated_generic_find_dummy_frame (get_frame_pc (thisframe), thisframe->frame))
- return deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
+ if (deprecated_generic_find_dummy_frame (get_frame_pc (thisframe),
+ get_frame_base (thisframe)))
+ return deprecated_read_register_dummy (get_frame_pc (thisframe),
+ get_frame_base (thisframe),
S390_SP_REGNUM);
else
{
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index ed655ea..d676366 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -929,8 +929,10 @@ gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info)
static CORE_ADDR
sh_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame; /* dummy frame same as caller's frame */
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return get_frame_base (frame); /* dummy frame same as caller's frame */
if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, 4);
else
@@ -967,8 +969,10 @@ translate_insn_rn (int rn, int media_mode)
static CORE_ADDR
sh64_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame; /* dummy frame same as caller's frame */
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return get_frame_base (frame); /* dummy frame same as caller's frame */
if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
{
int media_mode = pc_is_isa32 (get_frame_pc (frame));
@@ -992,10 +996,12 @@ static CORE_ADDR
sh_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
/* When the caller requests PR from the dummy frame, we return PC because
that's where the previous routine appears to have done a call from. */
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
@@ -1014,10 +1020,12 @@ sh64_get_saved_pr (struct frame_info *fi, int pr_regnum)
int media_mode = 0;
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
/* When the caller requests PR from the dummy frame, we return PC because
that's where the previous routine appears to have done a call from. */
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, pr_regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), pr_regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
@@ -1054,7 +1062,8 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+ get_frame_base (fi));
if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
@@ -1141,7 +1150,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
if (rn == FP_REGNUM)
have_fp = 1;
- get_frame_saved_regs (fi)[rn] = fi->frame - where[rn] + depth - 4;
+ get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - where[rn] + depth - 4;
}
else
{
@@ -1155,7 +1164,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
}
else
{
- get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame - 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
@@ -1393,7 +1402,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
int insn_size;
int gdb_register_number;
int register_number;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (get_frame_saved_regs (fi) == NULL)
@@ -1554,7 +1563,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
/* Watch out! saved_regs is only for the real registers, and
doesn't include space for the pseudo registers. */
- get_frame_saved_regs (fi)[register_number]= fi->frame - where[rn] + depth;
+ get_frame_saved_regs (fi)[register_number]= get_frame_base (fi) - where[rn] + depth;
}
else
@@ -1578,7 +1587,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
get_frame_saved_regs (fi)[sp_regnum] = read_memory_integer (get_frame_saved_regs (fi)[fp_regnum], size);
}
else
- get_frame_saved_regs (fi)[sp_regnum] = fi->frame;
+ get_frame_saved_regs (fi)[sp_regnum] = get_frame_base (fi);
fi->extra_info->f_offset = depth - where[fp_regnum];
}
@@ -1594,7 +1603,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (get_frame_saved_regs (fi) == NULL)
@@ -1693,7 +1702,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
if (rn == FP_REGNUM)
have_fp = 1;
- get_frame_saved_regs (fi)[rn] = fi->frame - where[rn] + depth - 4;
+ get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - where[rn] + depth - 4;
}
else
{
@@ -1708,7 +1717,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
}
else
{
- get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame - 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
@@ -1726,14 +1735,15 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (fi->next)
deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
SP_REGNUM));
fi->extra_info->return_pc = deprecated_read_register_dummy (get_frame_pc (fi),
- fi->frame,
+ get_frame_base (fi),
PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
fi->extra_info->leaf_function = 0;
@@ -1757,14 +1767,15 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (fi->next)
deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
- SP_REGNUM));
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
fi->extra_info->return_pc =
- deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, PC_REGNUM);
+ deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
fi->extra_info->leaf_function = 0;
return;
@@ -1814,13 +1825,15 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
while (frame && ((frame = frame->next) != NULL))
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
memcpy (raw_buffer,
- (deprecated_generic_find_dummy_frame (get_frame_pc (frame), frame->frame)
+ (deprecated_generic_find_dummy_frame (get_frame_pc (frame), get_frame_base (frame))
+ REGISTER_BYTE (regnum)),
REGISTER_RAW_SIZE (regnum));
return;
@@ -1908,7 +1921,9 @@ sh_pop_frame (void)
register CORE_ADDR fp;
register int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
@@ -1938,7 +1953,9 @@ sh64_pop_frame (void)
int media_mode = pc_is_isa32 (get_frame_pc (frame));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 8ef36d6..e272155 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -297,8 +297,8 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
fi->extra_info->bottom =
(fi->next ?
- (fi->frame == fi->next->frame ? fi->next->extra_info->bottom :
- fi->next->frame) : read_sp ());
+ (get_frame_base (fi) == get_frame_base (fi->next) ? fi->next->extra_info->bottom :
+ get_frame_base (fi->next)) : read_sp ());
/* If fi->next is NULL, then we already set ->frame by passing read_fp()
to create_new_frame. */
@@ -326,8 +326,8 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
get_saved_register (buf, 0, 0, fi, FP_REGNUM, 0);
deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (FP_REGNUM)));
- if (GDB_TARGET_IS_SPARC64 && (fi->frame & 1))
- deprecated_update_frame_base_hack (fi, fi->frame + 2047);
+ if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
}
}
@@ -367,12 +367,12 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0);
deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (I7_REGNUM)));
- if (GDB_TARGET_IS_SPARC64 && (fi->frame & 1))
- deprecated_update_frame_base_hack (fi, fi->frame + 2047);
+ if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
/* Record where the fp got saved. */
fi->extra_info->fp_addr =
- fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
/* Also try to collect where the pc got saved to. */
fi->extra_info->pc_addr = 0;
@@ -382,7 +382,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
&& X_OP3 (insn) == 4
&& X_RS1 (insn) == 14)
fi->extra_info->pc_addr =
- fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
}
}
else
@@ -415,10 +415,10 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
}
}
}
- if (fi->next && fi->frame == 0)
+ if (fi->next && get_frame_base (fi) == 0)
{
/* Kludge to cause init_prev_frame_info to destroy the new frame. */
- deprecated_update_frame_base_hack (fi, fi->next->frame);
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
deprecated_update_frame_pc_hack (fi, get_frame_pc (fi->next));
}
}
@@ -673,7 +673,7 @@ examine_prologue (CORE_ADDR start_pc, int frameless_p, struct frame_info *fi,
{
if (saved_regs && X_I (insn))
saved_regs[X_RD (insn)] =
- fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
}
else
break;
@@ -851,7 +851,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
The window registers are saved on the stack, just like in a
normal frame. */
if (regnum >= G1_REGNUM && regnum < G1_REGNUM + 7)
- addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
+ addr = get_frame_base (frame1) + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE);
else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
/* NOTE: cagney/2002-05-04: The call to get_prev_frame()
@@ -872,18 +872,18 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
+ (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_L0);
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
- addr = frame1->frame + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
+ addr = get_frame_base (frame1) + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 16 * SPARC_INTREG_SIZE);
else if (SPARC_HAS_FPU &&
regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32)
- addr = frame1->frame + (regnum - FP0_REGNUM) * 4
+ addr = get_frame_base (frame1) + (regnum - FP0_REGNUM) * 4
- (FP_REGISTER_BYTES);
else if (GDB_TARGET_IS_SPARC64 && SPARC_HAS_FPU &&
regnum >= FP0_REGNUM + 32 && regnum < FP_MAX_REGNUM)
- addr = frame1->frame + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8
+ addr = get_frame_base (frame1) + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8
- (FP_REGISTER_BYTES);
else if (regnum >= Y_REGNUM && regnum < NUM_REGS)
- addr = frame1->frame + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
+ addr = get_frame_base (frame1) + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE);
}
else if (frame1->extra_info->flat)
@@ -1284,7 +1284,7 @@ sparc_pop_frame (void)
read_memory_integer (fsr[O0_REGNUM + 7],
SPARC_INTREG_SIZE));
- write_sp (frame->frame);
+ write_sp (get_frame_base (frame));
}
else if (fsr[I0_REGNUM])
{
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 1a28b74..07b4c0f 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -801,8 +801,10 @@ CORE_ADDR
v850_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
else if (get_frame_saved_regs (fi)[regnum] != 0)
return read_memory_unsigned_integer (get_frame_saved_regs (fi)[regnum],
v850_register_raw_size (regnum));
@@ -842,7 +844,7 @@ v850_frame_chain (struct frame_info *fi)
if (pi.framereg == E_FP_RAW_REGNUM)
return v850_find_callers_reg (fi, pi.framereg);
- return fi->frame - pi.frameoffset;
+ return get_frame_base (fi) - pi.frameoffset;
}
/* Function: skip_prologue
@@ -884,7 +886,9 @@ v850_pop_frame (void)
struct frame_info *frame = get_current_frame ();
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
@@ -1010,8 +1014,10 @@ v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
CORE_ADDR
v850_frame_saved_pc (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, E_PC_REGNUM);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), E_PC_REGNUM);
else
return v850_find_callers_reg (fi, E_RP_REGNUM);
}
@@ -1112,7 +1118,8 @@ v850_frame_init_saved_regs (struct frame_info *fi)
/* The call dummy doesn't save any registers on the stack, so we
can return now. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
return;
/* Find the beginning of this function, so we can analyze its
@@ -1128,7 +1135,7 @@ v850_frame_init_saved_regs (struct frame_info *fi)
for (pifsr = pifsrs; pifsr->framereg; pifsr++)
{
- get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + fi->frame;
+ get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + get_frame_base (fi);
if (pifsr->framereg == E_SP_REGNUM)
get_frame_saved_regs (fi)[pifsr->reg] += pi.frameoffset;
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index b915b66..3c223c5 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -135,9 +135,9 @@ vax_frame_init_saved_regs (struct frame_info *frame)
frame_saved_regs_zalloc (frame);
- regmask = read_memory_integer (frame->frame + 4, 4) >> 16;
+ regmask = read_memory_integer (get_frame_base (frame) + 4, 4) >> 16;
- next_addr = frame->frame + 16;
+ next_addr = get_frame_base (frame) + 16;
/* regmask's low bit is for register 0, which is the first one
what would be pushed. */
@@ -152,10 +152,10 @@ vax_frame_init_saved_regs (struct frame_info *frame)
get_frame_saved_regs (frame)[SP_REGNUM] +=
4 + (4 * read_memory_integer (next_addr + 4, 4));
- get_frame_saved_regs (frame)[PC_REGNUM] = frame->frame + 16;
- get_frame_saved_regs (frame)[FP_REGNUM] = frame->frame + 12;
- get_frame_saved_regs (frame)[VAX_AP_REGNUM] = frame->frame + 8;
- get_frame_saved_regs (frame)[PS_REGNUM] = frame->frame + 4;
+ get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 16;
+ get_frame_saved_regs (frame)[FP_REGNUM] = get_frame_base (frame) + 12;
+ get_frame_saved_regs (frame)[VAX_AP_REGNUM] = get_frame_base (frame) + 8;
+ get_frame_saved_regs (frame)[PS_REGNUM] = get_frame_base (frame) + 4;
}
/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp. */
@@ -190,7 +190,7 @@ vax_frame_saved_pc (struct frame_info *frame)
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return (vax_sigtramp_saved_pc (frame)); /* XXXJRT */
- return (read_memory_integer (frame->frame + 16, 4));
+ return (read_memory_integer (get_frame_base (frame) + 16, 4));
}
CORE_ADDR
@@ -206,7 +206,7 @@ vax_frame_args_address_correct (struct frame_info *frame)
we don't know the address of the arglist) if we don't know what frame
this frame calls. */
if (frame->next)
- return (read_memory_integer (frame->next->frame + 8, 4));
+ return (read_memory_integer (get_frame_base (frame->next) + 8, 4));
return (0);
}
@@ -218,7 +218,7 @@ vax_frame_args_address (struct frame_info *frame)
just say "I don't know". This is sometimes wrong for functions
that aren't on top of the stack, but c'est la vie. */
if (frame->next)
- return (read_memory_integer (frame->next->frame + 8, 4));
+ return (read_memory_integer (get_frame_base (frame->next) + 8, 4));
return (read_register (VAX_AP_REGNUM));
}
@@ -226,7 +226,7 @@ vax_frame_args_address (struct frame_info *frame)
static CORE_ADDR
vax_frame_locals_address (struct frame_info *frame)
{
- return (frame->frame);
+ return (get_frame_base (frame));
}
static int
@@ -243,7 +243,7 @@ vax_frame_chain (struct frame_info *frame)
if (inside_entry_file (get_frame_pc (frame)))
return (0);
- return (read_memory_integer (frame->frame + 12, 4));
+ return (read_memory_integer (get_frame_base (frame) + 12, 4));
}
static void
diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c
index fa43db2..0413f86 100644
--- a/gdb/x86-64-linux-tdep.c
+++ b/gdb/x86-64-linux-tdep.c
@@ -95,7 +95,7 @@ x86_64_linux_sigcontext_addr (struct frame_info *frame)
/* If this isn't the top frame, the next frame must be for the
signal handler itself. The sigcontext structure is part of
the user context. */
- return frame->next->frame + LINUX_SIGINFO_SIZE +
+ return get_frame_base (frame->next) + LINUX_SIGINFO_SIZE +
LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
@@ -164,10 +164,10 @@ x86_64_linux_frame_chain (struct frame_info *fi)
if (fp)
return fp;
else
- addr = fi->frame;
+ addr = get_frame_base (fi);
}
else
- addr = fi->next->frame;
+ addr = get_frame_base (fi->next);
addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 4fb3ca2..5e9a28a 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -333,7 +333,8 @@ xstormy16_pop_frame (void)
if (fi == NULL)
return; /* paranoia */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
generic_pop_dummy_frame ();
}
@@ -466,7 +467,8 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
if (fi)
{
/* In a call dummy, don't touch the frame. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
return start_addr;
/* Grab the frame-relative values of SP and FP, needed below.
@@ -756,9 +758,11 @@ xstormy16_frame_saved_pc (struct frame_info *fi)
{
CORE_ADDR saved_pc;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
- saved_pc = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
+ saved_pc = deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi),
E_PC_REGNUM);
}
else
@@ -816,15 +820,16 @@ xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi)
static CORE_ADDR
xstormy16_frame_chain (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
/* Call dummy's frame is the same as caller's. */
- return fi->frame;
+ return get_frame_base (fi);
}
else
{
/* Return computed offset from this frame's fp. */
- return fi->frame - fi->extra_info->framesize;
+ return get_frame_base (fi) - fi->extra_info->framesize;
}
}
@@ -833,7 +838,7 @@ xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
return chain < 0x8000 && FRAME_SAVED_PC (thisframe) >= 0x8000 &&
(thisframe->extra_info->frameless_p ||
- thisframe->frame - thisframe->extra_info->framesize == chain);
+ get_frame_base (thisframe) - thisframe->extra_info->framesize == chain);
}
/* Function: xstormy16_saved_pc_after_call