* gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Delete.
* gdbarch.h, gdbarch.c: Re-generate.
* frame.h (deprecated_pc_in_call_dummy): Delete "sp" and "fp"
parameters.
* dummy-frame.c (deprecated_pc_in_call_dummy): Update.
* arm-tdep.c (arm_pc_is_thumb_dummy): Call
deprecated_pc_in_call_dummy instead of
DEPRECATED_PC_IN_CALL_DUMMY.
(arm_skip_prologue): Ditto.
* xstormy16-tdep.c (xstormy16_pop_frame, xstormy16_scan_prologue)
(xstormy16_frame_saved_pc, xstormy16_frame_chain): Ditto.
* v850-tdep.c (v850_find_callers_reg, v850_frame_chain)
(v850_pop_frame, v850_frame_saved_pc, v850_frame_init_saved_regs):
Ditto.
* sh64-tdep.c (sh64_frame_chain, sh64_get_saved_pr)
(sh64_init_extra_frame_info, sh64_get_saved_register)
(sh64_pop_frame): Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* mcore-tdep.c (mcore_find_callers_reg, mcore_frame_saved_pc)
(mcore_pop_frame, mcore_init_extra_frame_info): Ditto.
* h8300-tdep.c (h8300_frame_chain, h8300_frame_saved_pc)
(h8300_pop_frame): Ditto.
* blockframe.c (legacy_inside_entry_func)
(legacy_frame_chain_valid): Ditto.
* frame.c (frame_type_from_pc, legacy_get_prev_frame): Update call
to deprecated_pc_in_call_dummy.
+2004-06-10 Andrew Cagney <cagney@gnu.org>
+
+ * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * frame.h (deprecated_pc_in_call_dummy): Delete "sp" and "fp"
+ parameters.
+ * dummy-frame.c (deprecated_pc_in_call_dummy): Update.
+ * arm-tdep.c (arm_pc_is_thumb_dummy): Call
+ deprecated_pc_in_call_dummy instead of
+ DEPRECATED_PC_IN_CALL_DUMMY.
+ (arm_skip_prologue): Ditto.
+ * xstormy16-tdep.c (xstormy16_pop_frame, xstormy16_scan_prologue)
+ (xstormy16_frame_saved_pc, xstormy16_frame_chain): Ditto.
+ * v850-tdep.c (v850_find_callers_reg, v850_frame_chain)
+ (v850_pop_frame, v850_frame_saved_pc, v850_frame_init_saved_regs):
+ Ditto.
+ * sh64-tdep.c (sh64_frame_chain, sh64_get_saved_pr)
+ (sh64_init_extra_frame_info, sh64_get_saved_register)
+ (sh64_pop_frame): Ditto.
+ * mips-tdep.c (non_heuristic_proc_desc): Ditto.
+ * mcore-tdep.c (mcore_find_callers_reg, mcore_frame_saved_pc)
+ (mcore_pop_frame, mcore_init_extra_frame_info): Ditto.
+ * h8300-tdep.c (h8300_frame_chain, h8300_frame_saved_pc)
+ (h8300_pop_frame): Ditto.
+ * blockframe.c (legacy_inside_entry_func)
+ (legacy_frame_chain_valid): Ditto.
+ * frame.c (frame_type_from_pc, legacy_get_prev_frame): Update call
+ to deprecated_pc_in_call_dummy.
+
2004-06-09 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh (REGISTER_TO_VALUE, VALUE_TO_REGISTER): Do not
frame location (true if we have not pushed large data structures or
gone too many levels deep) and that our 1024 is not enough to consider
code regions as part of the stack (true for most practical purposes). */
- if (DEPRECATED_PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024))
+ if (deprecated_pc_in_call_dummy (memaddr))
return caller_is_thumb;
else
return 0;
struct symtab_and_line sal;
/* If we're in a dummy frame, don't even try to skip the prologue. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
+ if (deprecated_pc_in_call_dummy (pc))
return pc;
/* See what the symbol table says. */
{
/* Do not stop backtracing if the program counter is in the call
dummy at the entry point. */
- /* FIXME: This won't always work with zeros for the last two
- arguments. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
+ if (deprecated_pc_in_call_dummy (pc))
return 0;
}
legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
{
/* Don't prune CALL_DUMMY frames. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return 1;
/* If the new frame pointer is zero, then it isn't valid. */
return deprecated_grub_regcache_for_registers (regcache);
}
-/* Function: pc_in_call_dummy (pc, sp, fp)
+/* Function: pc_in_call_dummy (pc)
Return true if the PC falls in a dummy frame created by gdb for an
inferior call. The code below which allows DECR_PC_AFTER_BREAK is
subtracted out. */
int
-deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
+deprecated_pc_in_call_dummy (CORE_ADDR pc)
{
return pc_in_dummy_frame (pc);
}
{
/* NOTE: cagney/2004-05-08: Eliminating this function depends on all
architectures being forced to use the frame-unwind code. */
- if (deprecated_pc_in_call_dummy (pc, 0, 0))
+ if (deprecated_pc_in_call_dummy (pc))
return DUMMY_FRAME;
else
return NORMAL_FRAME;
has previously set it. This is really somewhat bogus. The
initialization, as seen in create_new_frame(), should occur
before the INIT function has been called. */
- if (deprecated_pc_in_call_dummy (get_frame_pc (prev), 0, 0))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (prev)))
prev->type = DUMMY_FRAME;
if (prev->type == NORMAL_FRAME)
extern void generic_push_dummy_frame (void);
extern void deprecated_pop_dummy_frame (void);
-extern int deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp,
- CORE_ADDR fp);
+extern int deprecated_pc_in_call_dummy (CORE_ADDR pc);
/* NOTE: cagney/2002-06-26: Targets should no longer use this
function. Instead, the contents of a dummy frame register can be
gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
gdbarch_cannot_store_register_ftype *cannot_store_register;
gdbarch_get_longjmp_target_ftype *get_longjmp_target;
- gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy;
gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
int believe_pcc_promotion;
gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
0, /* cannot_fetch_register */
0, /* cannot_store_register */
0, /* get_longjmp_target */
- deprecated_pc_in_call_dummy, /* deprecated_pc_in_call_dummy */
0, /* deprecated_init_frame_pc */
0, /* believe_pcc_promotion */
0, /* deprecated_get_saved_register */
current_gdbarch->register_sim_regno = legacy_register_sim_regno;
current_gdbarch->cannot_fetch_register = cannot_register_not;
current_gdbarch->cannot_store_register = cannot_register_not;
- current_gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
current_gdbarch->convert_register_p = generic_convert_register_p;
current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
/* Skip verify of cannot_store_register, invalid_p == 0 */
/* Skip verify of get_longjmp_target, has predicate */
- /* Skip verify of deprecated_pc_in_call_dummy, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
/* Skip verify of deprecated_get_saved_register, has predicate */
/* Skip verify of convert_register_p, invalid_p == 0 */
"gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
#endif
-#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_PC_IN_CALL_DUMMY_P()",
- XSTRING (DEPRECATED_PC_IN_CALL_DUMMY_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY_P() = %d\n",
- DEPRECATED_PC_IN_CALL_DUMMY_P ());
-#endif
-#ifdef DEPRECATED_PC_IN_CALL_DUMMY
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)",
- XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address)));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_pc_in_call_dummy
- /*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
-#endif
#ifdef DEPRECATED_POP_FRAME_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
gdbarch->get_longjmp_target = get_longjmp_target;
}
-int
-gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy;
-}
-
-int
-gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_pc_in_call_dummy != NULL);
- /* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy, allow call. */
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n");
- return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address);
-}
-
-void
-set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch,
- gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy)
-{
- gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
-}
-
int
gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch)
{
#define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
#endif
-/* NOTE: cagney/2002-11-24: This function with predicate has a valid
- (callable) initial value. As a consequence, even when the predicate
- is false, the corresponding function works. This simplifies the
- migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
- doesn't need to be modified. */
-
-#if defined (DEPRECATED_PC_IN_CALL_DUMMY)
-/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */
-#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch))
-#endif
-
-typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
-extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
-extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY)
-#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
-#endif
-#if !defined (DEPRECATED_PC_IN_CALL_DUMMY)
-#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
-#endif
-
#if defined (DEPRECATED_INIT_FRAME_PC)
/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */
#if !defined (DEPRECATED_INIT_FRAME_PC_P)
f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
# setjmp/longjmp support.
F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc
-# NOTE: cagney/2002-11-24: This function with predicate has a valid
-# (callable) initial value. As a consequence, even when the predicate
-# is false, the corresponding function works. This simplifies the
-# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
-# doesn't need to be modified.
-F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::deprecated_pc_in_call_dummy:deprecated_pc_in_call_dummy
F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
#
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
static CORE_ADDR
h8300_frame_chain (struct frame_info *thisframe)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe),
- get_frame_base (thisframe),
- get_frame_base (thisframe)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (thisframe)))
{ /* initialize the from_pc now */
get_frame_extra_info (thisframe)->from_pc =
deprecated_read_register_dummy (get_frame_pc (thisframe),
static CORE_ADDR
h8300_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
return deprecated_read_register_dummy (get_frame_pc (frame),
get_frame_base (frame),
E_PC_REGNUM);
unsigned regno;
struct frame_info *frame = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
{
deprecated_pop_dummy_frame ();
}
{
for (; fi != NULL; fi = get_next_frame (fi))
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), regnum);
else if (deprecated_get_frame_saved_regs (fi)[regnum] != 0)
mcore_frame_saved_pc (struct frame_info * fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), PC_REGNUM);
else
int rn;
struct frame_info *fi = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
deprecated_pop_dummy_frame ();
else
{
get_frame_extra_info (fi)->status = 0;
get_frame_extra_info (fi)->framesize = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
{
/* We need to setup fi->frame here because call_function_by_hand
gets it wrong by assuming it's always FP. */
struct obj_section *sec;
struct mips_objfile_private *priv;
- if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
+ if (deprecated_pc_in_call_dummy (pc))
return NULL;
find_pc_partial_function (pc, NULL, &startaddr, NULL);
static CORE_ADDR
sh64_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
return get_frame_base (frame); /* dummy frame same as caller's frame */
if (get_frame_pc (frame))
{
int media_mode = 0;
for (; fi; fi = get_next_frame (fi))
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (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. */
if (get_next_frame (fi))
deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
{
/* We need to setup fi->frame here because call_function_by_hand
gets it wrong by assuming it's always FP. */
while (frame && ((frame = get_next_frame (frame)) != NULL))
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
{
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
int media_mode = pc_is_isa32 (get_frame_pc (frame));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
deprecated_pop_dummy_frame ();
else
{
v850_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = get_next_frame (fi))
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), regnum);
else if (deprecated_get_frame_saved_regs (fi)[regnum] != 0)
callers_pc = DEPRECATED_FRAME_SAVED_PC (fi);
/* If caller is a call-dummy, then our FP bears no relation to his FP! */
fp = v850_find_callers_reg (fi, E_FP_RAW_REGNUM);
- if (DEPRECATED_PC_IN_CALL_DUMMY (callers_pc, fp, fp))
+ if (deprecated_pc_in_call_dummy (callers_pc))
return fp; /* caller is call-dummy: return oldest value of FP */
/* Caller is NOT a call-dummy, so everything else should just work.
struct frame_info *frame = get_current_frame ();
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
deprecated_pop_dummy_frame ();
else
{
static CORE_ADDR
v850_frame_saved_pc (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), E_PC_REGNUM);
else
/* 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), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return;
/* Find the beginning of this function, so we can analyze its
if (fi == NULL)
return; /* paranoia */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
{
deprecated_pop_dummy_frame ();
}
if (fi)
{
/* In a call dummy, don't touch the frame. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
return start_addr;
/* Grab the frame-relative values of SP and FP, needed below.
{
CORE_ADDR saved_pc;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
{
saved_pc = deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi),
static CORE_ADDR
xstormy16_frame_chain (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
+ if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
{
/* Call dummy's frame is the same as caller's. */
return get_frame_base (fi);