2004-03-22 Andrew Cagney <cagney@redhat.com>
* frame.h (deprecated_pc_in_call_dummy): Rename generic_pc_in_call_dummy. * dummy-frame.h (pc_in_dummy_frame): Delete declaration. * dummy-frame.c (deprecated_pc_in_call_dummy): Rename generic_pc_in_call_dummy. (pc_in_dummy_frame): Make static. * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Update. * gdbarch.h, gdbarch.c: Re-generate. * dummy-frame.c (dummy_frame_sniffer): Simplify. * frame.c (frame_type_from_pc): Call deprecated_pc_in_call_dummy. (legacy_get_prev_frame): Ditto. * inferior.h: Delete reference to generic_pc_in_call_dummy in comment.
This commit is contained in:
parent
4b2b3b3e62
commit
90ba813f1f
8 changed files with 35 additions and 49 deletions
|
@ -1,3 +1,19 @@
|
||||||
|
2004-03-22 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
|
* frame.h (deprecated_pc_in_call_dummy): Rename
|
||||||
|
generic_pc_in_call_dummy.
|
||||||
|
* dummy-frame.h (pc_in_dummy_frame): Delete declaration.
|
||||||
|
* dummy-frame.c (deprecated_pc_in_call_dummy): Rename
|
||||||
|
generic_pc_in_call_dummy.
|
||||||
|
(pc_in_dummy_frame): Make static.
|
||||||
|
* gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Update.
|
||||||
|
* gdbarch.h, gdbarch.c: Re-generate.
|
||||||
|
* dummy-frame.c (dummy_frame_sniffer): Simplify.
|
||||||
|
* frame.c (frame_type_from_pc): Call deprecated_pc_in_call_dummy.
|
||||||
|
(legacy_get_prev_frame): Ditto.
|
||||||
|
* inferior.h: Delete reference to generic_pc_in_call_dummy in
|
||||||
|
comment.
|
||||||
|
|
||||||
2004-03-21 Andrew Cagney <cagney@redhat.com>
|
2004-03-21 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
* inferior.h (deprecated_pc_in_call_dummy_at_entry_point): Delete
|
* inferior.h (deprecated_pc_in_call_dummy_at_entry_point): Delete
|
||||||
|
|
|
@ -36,6 +36,8 @@ static void dummy_frame_this_id (struct frame_info *next_frame,
|
||||||
void **this_prologue_cache,
|
void **this_prologue_cache,
|
||||||
struct frame_id *this_id);
|
struct frame_id *this_id);
|
||||||
|
|
||||||
|
static int pc_in_dummy_frame (CORE_ADDR pc);
|
||||||
|
|
||||||
/* Dummy frame. This saves the processor state just prior to setting
|
/* Dummy frame. This saves the processor state just prior to setting
|
||||||
up the inferior function call. Older targets save the registers
|
up the inferior function call. Older targets save the registers
|
||||||
on the target stack (but that really slows down function calls). */
|
on the target stack (but that really slows down function calls). */
|
||||||
|
@ -137,7 +139,7 @@ deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
|
||||||
subtracted out. */
|
subtracted out. */
|
||||||
|
|
||||||
int
|
int
|
||||||
generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
|
deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
|
||||||
{
|
{
|
||||||
return pc_in_dummy_frame (pc);
|
return pc_in_dummy_frame (pc);
|
||||||
}
|
}
|
||||||
|
@ -155,7 +157,7 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
|
||||||
!DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy
|
!DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy
|
||||||
targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?). */
|
targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?). */
|
||||||
|
|
||||||
int
|
static int
|
||||||
pc_in_dummy_frame (CORE_ADDR pc)
|
pc_in_dummy_frame (CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
struct dummy_frame *dummyframe;
|
struct dummy_frame *dummyframe;
|
||||||
|
@ -411,9 +413,8 @@ const struct frame_unwind *
|
||||||
dummy_frame_sniffer (struct frame_info *next_frame)
|
dummy_frame_sniffer (struct frame_info *next_frame)
|
||||||
{
|
{
|
||||||
CORE_ADDR pc = frame_pc_unwind (next_frame);
|
CORE_ADDR pc = frame_pc_unwind (next_frame);
|
||||||
if (DEPRECATED_PC_IN_CALL_DUMMY_P ()
|
gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
|
||||||
? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)
|
if (pc_in_dummy_frame (pc))
|
||||||
: pc_in_dummy_frame (pc))
|
|
||||||
return &dummy_frame_unwind;
|
return &dummy_frame_unwind;
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -50,31 +50,6 @@ struct frame_id;
|
||||||
|
|
||||||
extern const struct frame_unwind *dummy_frame_sniffer (struct frame_info *next_frame);
|
extern const struct frame_unwind *dummy_frame_sniffer (struct frame_info *next_frame);
|
||||||
|
|
||||||
/* Does the PC fall in a dummy frame?
|
|
||||||
|
|
||||||
This function is used by "frame.c" when creating a new `struct
|
|
||||||
frame_info'.
|
|
||||||
|
|
||||||
Note that there is also very similar code in breakpoint.c (where
|
|
||||||
the bpstat stop reason is computed). It is looking for a PC
|
|
||||||
falling on a dummy_frame breakpoint. Perhaphs this, and that code
|
|
||||||
should be combined?
|
|
||||||
|
|
||||||
Architecture dependant code, that has access to a frame, should not
|
|
||||||
use this function. Instead (get_frame_type() == DUMMY_FRAME)
|
|
||||||
should be used.
|
|
||||||
|
|
||||||
Hmm, but what about threads? When the dummy-frame code tries to
|
|
||||||
relocate a dummy frame's saved registers it definitly needs to
|
|
||||||
differentiate between threads (otherwize it will do things like
|
|
||||||
clean-up the wrong threads frames). However, when just trying to
|
|
||||||
identify a dummy-frame that shouldn't matter. The wost that can
|
|
||||||
happen is that a thread is marked as sitting in a dummy frame when,
|
|
||||||
in reality, its corrupted its stack, to the point that a PC is
|
|
||||||
pointing into a dummy frame. */
|
|
||||||
|
|
||||||
extern int pc_in_dummy_frame (CORE_ADDR pc);
|
|
||||||
|
|
||||||
/* Return the regcache that belongs to the dummy-frame identifed by PC
|
/* Return the regcache that belongs to the dummy-frame identifed by PC
|
||||||
and FP, or NULL if no such frame exists. */
|
and FP, or NULL if no such frame exists. */
|
||||||
/* FIXME: cagney/2002-11-08: The function only exists because of
|
/* FIXME: cagney/2002-11-08: The function only exists because of
|
||||||
|
|
10
gdb/frame.c
10
gdb/frame.c
|
@ -1154,12 +1154,8 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
|
||||||
static enum frame_type
|
static enum frame_type
|
||||||
frame_type_from_pc (CORE_ADDR pc)
|
frame_type_from_pc (CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
/* FIXME: cagney/2002-11-24: Can't yet directly call
|
|
||||||
pc_in_dummy_frame() as some architectures don't set
|
|
||||||
PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the
|
|
||||||
latter is implemented by simply calling pc_in_dummy_frame). */
|
|
||||||
if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
|
if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
|
||||||
&& DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
|
&& deprecated_pc_in_call_dummy (pc, 0, 0))
|
||||||
return DUMMY_FRAME;
|
return DUMMY_FRAME;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1688,9 +1684,7 @@ legacy_get_prev_frame (struct frame_info *this_frame)
|
||||||
initialization, as seen in create_new_frame(), should occur
|
initialization, as seen in create_new_frame(), should occur
|
||||||
before the INIT function has been called. */
|
before the INIT function has been called. */
|
||||||
if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
|
if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
|
||||||
&& (DEPRECATED_PC_IN_CALL_DUMMY_P ()
|
&& deprecated_pc_in_call_dummy (get_frame_pc (prev), 0, 0))
|
||||||
? DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (prev), 0, 0)
|
|
||||||
: pc_in_dummy_frame (get_frame_pc (prev))))
|
|
||||||
prev->type = DUMMY_FRAME;
|
prev->type = DUMMY_FRAME;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -568,8 +568,8 @@ extern void generic_push_dummy_frame (void);
|
||||||
extern void generic_pop_current_frame (void (*)(struct frame_info *));
|
extern void generic_pop_current_frame (void (*)(struct frame_info *));
|
||||||
extern void generic_pop_dummy_frame (void);
|
extern void generic_pop_dummy_frame (void);
|
||||||
|
|
||||||
extern int generic_pc_in_call_dummy (CORE_ADDR pc,
|
extern int deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp,
|
||||||
CORE_ADDR sp, CORE_ADDR fp);
|
CORE_ADDR fp);
|
||||||
|
|
||||||
/* NOTE: cagney/2002-06-26: Targets should no longer use this
|
/* NOTE: cagney/2002-06-26: Targets should no longer use this
|
||||||
function. Instead, the contents of a dummy frames registers can be
|
function. Instead, the contents of a dummy frames registers can be
|
||||||
|
|
|
@ -347,7 +347,7 @@ struct gdbarch startup_gdbarch =
|
||||||
0, /* cannot_fetch_register */
|
0, /* cannot_fetch_register */
|
||||||
0, /* cannot_store_register */
|
0, /* cannot_store_register */
|
||||||
0, /* get_longjmp_target */
|
0, /* get_longjmp_target */
|
||||||
generic_pc_in_call_dummy, /* deprecated_pc_in_call_dummy */
|
deprecated_pc_in_call_dummy, /* deprecated_pc_in_call_dummy */
|
||||||
0, /* deprecated_init_frame_pc_first */
|
0, /* deprecated_init_frame_pc_first */
|
||||||
0, /* deprecated_init_frame_pc */
|
0, /* deprecated_init_frame_pc */
|
||||||
0, /* believe_pcc_promotion */
|
0, /* believe_pcc_promotion */
|
||||||
|
@ -499,7 +499,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
|
||||||
current_gdbarch->register_sim_regno = legacy_register_sim_regno;
|
current_gdbarch->register_sim_regno = legacy_register_sim_regno;
|
||||||
current_gdbarch->cannot_fetch_register = cannot_register_not;
|
current_gdbarch->cannot_fetch_register = cannot_register_not;
|
||||||
current_gdbarch->cannot_store_register = cannot_register_not;
|
current_gdbarch->cannot_store_register = cannot_register_not;
|
||||||
current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy;
|
current_gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
|
||||||
current_gdbarch->convert_register_p = legacy_convert_register_p;
|
current_gdbarch->convert_register_p = legacy_convert_register_p;
|
||||||
current_gdbarch->register_to_value = legacy_register_to_value;
|
current_gdbarch->register_to_value = legacy_register_to_value;
|
||||||
current_gdbarch->value_to_register = legacy_value_to_register;
|
current_gdbarch->value_to_register = legacy_value_to_register;
|
||||||
|
@ -3767,7 +3767,7 @@ int
|
||||||
gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch)
|
gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch)
|
||||||
{
|
{
|
||||||
gdb_assert (gdbarch != NULL);
|
gdb_assert (gdbarch != NULL);
|
||||||
return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy;
|
return gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -3775,7 +3775,7 @@ gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE
|
||||||
{
|
{
|
||||||
gdb_assert (gdbarch != NULL);
|
gdb_assert (gdbarch != NULL);
|
||||||
gdb_assert (gdbarch->deprecated_pc_in_call_dummy != NULL);
|
gdb_assert (gdbarch->deprecated_pc_in_call_dummy != NULL);
|
||||||
/* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy, allow call. */
|
/* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy, allow call. */
|
||||||
if (gdbarch_debug >= 2)
|
if (gdbarch_debug >= 2)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n");
|
||||||
return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address);
|
return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address);
|
||||||
|
|
|
@ -562,7 +562,7 @@ F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc
|
||||||
# is false, the corresponding function works. This simplifies the
|
# is false, the corresponding function works. This simplifies the
|
||||||
# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
|
# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
|
||||||
# doesn't need to be modified.
|
# 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::generic_pc_in_call_dummy:generic_pc_in_call_dummy
|
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_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
|
F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
|
||||||
F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
|
F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
|
||||||
#
|
#
|
||||||
|
|
|
@ -454,10 +454,10 @@ extern int attach_flag;
|
||||||
|
|
||||||
/* Are we in a call dummy? */
|
/* Are we in a call dummy? */
|
||||||
|
|
||||||
/* NOTE: cagney/2002-11-24: Targets need to both switch to generic
|
/* NOTE: cagney/2002-11-24 cagney/2004-03-22: Targets need to both
|
||||||
dummy frames, and use generic_pc_in_call_dummy(). The generic
|
switch to generic dummy frames. The generic version should be able
|
||||||
version should be able to handle all cases since that code works by
|
to handle all cases since that code works by saving the address of
|
||||||
saving the address of the dummy's breakpoint (where ever it is). */
|
the dummy's breakpoint (where ever it is). */
|
||||||
|
|
||||||
extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc,
|
extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc,
|
||||||
CORE_ADDR sp,
|
CORE_ADDR sp,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue