2002-11-18 Andrew Cagney <ac131313@redhat.com>
* frame.h (enum frame_type): Define. (get_frame_type): Declare. (struct frame_info): Add field `type'. Delete field signal_handler_caller. (deprecated_set_frame_signal_handler_caller): Declare. * frame.c (get_frame_type): New function. (deprecated_set_frame_type): New function. (create_new_frame): Set the frame's type. (get_prev_frame): Similar. * sparc-tdep.c: Use get_frame_type instead of signal_handler_caller. * s390-tdep.c: Ditto. * m68klinux-nat.c: Ditto. * ns32k-tdep.c: Ditto. * x86-64-linux-tdep.c: Ditto. * vax-tdep.c: Ditto. * rs6000-tdep.c: Ditto. * ppc-linux-tdep.c: Ditto. * i386-interix-tdep.c: Ditto. * mips-tdep.c: Ditto. * m68k-tdep.c: Ditto. * hppa-tdep.c: Ditto. * ia64-tdep.c: Ditto. * cris-tdep.c: Ditto. * arm-tdep.c: Ditto. * alpha-tdep.c: Ditto. * i386-tdep.c: Ditto. * stack.c: Ditto. * ada-lang.c: Ditto. * blockframe.c: Update. * i386-interix-tdep.c (i386_interix_back_one_frame): Use deprecated_set_frame_type instead of signal_handler_caller. * ppc-linux-tdep.c (ppc_linux_init_extra_frame_info): Ditto. * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. * breakpoint.h: Delete FIXME suggesting get_frame_type. Index: tui/ChangeLog 2002-11-18 Andrew Cagney <ac131313@redhat.com> * tuiStack.c (tuiShowFrameInfo): Use get_frame_type instead of signal_handler_caller.
This commit is contained in:
parent
bf4ae8b20c
commit
5a203e4405
26 changed files with 286 additions and 133 deletions
|
@ -1,3 +1,40 @@
|
||||||
|
2002-11-18 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
|
* frame.h (enum frame_type): Define.
|
||||||
|
(get_frame_type): Declare.
|
||||||
|
(struct frame_info): Add field `type'. Delete field
|
||||||
|
signal_handler_caller.
|
||||||
|
(deprecated_set_frame_signal_handler_caller): Declare.
|
||||||
|
* frame.c (get_frame_type): New function.
|
||||||
|
(deprecated_set_frame_type): New function.
|
||||||
|
(create_new_frame): Set the frame's type.
|
||||||
|
(get_prev_frame): Similar.
|
||||||
|
* sparc-tdep.c: Use get_frame_type instead of signal_handler_caller.
|
||||||
|
* s390-tdep.c: Ditto.
|
||||||
|
* m68klinux-nat.c: Ditto.
|
||||||
|
* ns32k-tdep.c: Ditto.
|
||||||
|
* x86-64-linux-tdep.c: Ditto.
|
||||||
|
* vax-tdep.c: Ditto.
|
||||||
|
* rs6000-tdep.c: Ditto.
|
||||||
|
* ppc-linux-tdep.c: Ditto.
|
||||||
|
* i386-interix-tdep.c: Ditto.
|
||||||
|
* mips-tdep.c: Ditto.
|
||||||
|
* m68k-tdep.c: Ditto.
|
||||||
|
* hppa-tdep.c: Ditto.
|
||||||
|
* ia64-tdep.c: Ditto.
|
||||||
|
* cris-tdep.c: Ditto.
|
||||||
|
* arm-tdep.c: Ditto.
|
||||||
|
* alpha-tdep.c: Ditto.
|
||||||
|
* i386-tdep.c: Ditto.
|
||||||
|
* stack.c: Ditto.
|
||||||
|
* ada-lang.c: Ditto.
|
||||||
|
* blockframe.c: Update.
|
||||||
|
* i386-interix-tdep.c (i386_interix_back_one_frame): Use
|
||||||
|
deprecated_set_frame_type instead of signal_handler_caller.
|
||||||
|
* ppc-linux-tdep.c (ppc_linux_init_extra_frame_info): Ditto.
|
||||||
|
* rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto.
|
||||||
|
* breakpoint.h: Delete FIXME suggesting get_frame_type.
|
||||||
|
|
||||||
2002-11-18 Klee Dienes <kdienes@apple.com>
|
2002-11-18 Klee Dienes <kdienes@apple.com>
|
||||||
|
|
||||||
* Makefile.in (buildsym.o): Add dependency for gdb_assert.h.
|
* Makefile.in (buildsym.o): Add dependency for gdb_assert.h.
|
||||||
|
|
|
@ -5032,16 +5032,19 @@ find_printable_frame (struct frame_info *fi, int level)
|
||||||
|
|
||||||
for (; fi != NULL; level += 1, fi = get_prev_frame (fi))
|
for (; fi != NULL; level += 1, fi = get_prev_frame (fi))
|
||||||
{
|
{
|
||||||
/* If fi is not the innermost frame, that normally means that fi->pc
|
/* If fi is not the innermost frame, that normally means that
|
||||||
points to *after* the call instruction, and we want to get the line
|
fi->pc points at the return instruction (which is *after* the
|
||||||
containing the call, never the next line. But if the next frame is
|
call instruction), and we want to get the line containing the
|
||||||
a signal_handler_caller or a dummy frame, then the next frame was
|
call (because the call is where the user thinks the program
|
||||||
not entered as the result of a call, and we want to get the line
|
is). However, if the next frame is either a SIGTRAMP_FRAME
|
||||||
containing fi->pc. */
|
or a DUMMY_FRAME, then the next frame will contain a saved
|
||||||
|
interrupt PC and such a PC indicates the current (rather than
|
||||||
|
next) instruction/line, consequently, for such cases, want to
|
||||||
|
get the line containing fi->pc. */
|
||||||
sal =
|
sal =
|
||||||
find_pc_line (fi->pc,
|
find_pc_line (fi->pc,
|
||||||
fi->next != NULL
|
fi->next != NULL
|
||||||
&& !fi->next->signal_handler_caller
|
&& !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
|
||||||
&& !deprecated_frame_in_dummy (fi->next));
|
&& !deprecated_frame_in_dummy (fi->next));
|
||||||
if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
|
if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
|
||||||
{
|
{
|
||||||
|
|
|
@ -377,7 +377,7 @@ alpha_find_saved_regs (struct frame_info *frame)
|
||||||
#define SIGFRAME_REGSAVE_OFF (4 * 8)
|
#define SIGFRAME_REGSAVE_OFF (4 * 8)
|
||||||
#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 8 + 8)
|
#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 8 + 8)
|
||||||
#endif
|
#endif
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
CORE_ADDR sigcontext_addr;
|
CORE_ADDR sigcontext_addr;
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
|
||||||
{
|
{
|
||||||
/* We have to get the saved sp from the sigcontext
|
/* We have to get the saved sp from the sigcontext
|
||||||
if it is a signal handler frame. */
|
if it is a signal handler frame. */
|
||||||
if (regno == SP_REGNUM && !fi->signal_handler_caller)
|
if (regno == SP_REGNUM && !(get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
return fi->frame;
|
return fi->frame;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -490,7 +490,7 @@ alpha_frame_saved_pc (struct frame_info *frame)
|
||||||
alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
|
alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
|
||||||
/* We have to get the saved pc from the sigcontext
|
/* We have to get the saved pc from the sigcontext
|
||||||
if it is a signal handler frame. */
|
if it is a signal handler frame. */
|
||||||
int pcreg = frame->signal_handler_caller ? PC_REGNUM
|
int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM
|
||||||
: frame->extra_info->pc_reg;
|
: frame->extra_info->pc_reg;
|
||||||
|
|
||||||
if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
|
if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
|
||||||
|
@ -515,7 +515,7 @@ alpha_saved_pc_after_call (struct frame_info *frame)
|
||||||
proc_desc = find_proc_desc (pc, frame->next);
|
proc_desc = find_proc_desc (pc, frame->next);
|
||||||
pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
|
pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
|
||||||
|
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return alpha_frame_saved_pc (frame);
|
return alpha_frame_saved_pc (frame);
|
||||||
else
|
else
|
||||||
return read_register (pcreg);
|
return read_register (pcreg);
|
||||||
|
@ -955,7 +955,7 @@ alpha_frame_chain (struct frame_info *frame)
|
||||||
&& PROC_FRAME_OFFSET (proc_desc) == 0
|
&& PROC_FRAME_OFFSET (proc_desc) == 0
|
||||||
/* The previous frame from a sigtramp frame might be frameless
|
/* The previous frame from a sigtramp frame might be frameless
|
||||||
and have frame size zero. */
|
and have frame size zero. */
|
||||||
&& !frame->signal_handler_caller)
|
&& !(get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return alpha_frame_past_sigtramp_frame (frame, saved_pc);
|
return alpha_frame_past_sigtramp_frame (frame, saved_pc);
|
||||||
else
|
else
|
||||||
return read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc))
|
return read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc))
|
||||||
|
@ -1018,8 +1018,12 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame)
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
/* Do not set the saved registers for a sigtramp frame,
|
/* Do not set the saved registers for a sigtramp frame,
|
||||||
alpha_find_saved_registers will do that for us.
|
alpha_find_saved_registers will do that for us. We can't
|
||||||
We can't use frame->signal_handler_caller, it is not yet set. */
|
use (get_frame_type (frame) == SIGTRAMP_FRAME), it is not
|
||||||
|
yet set. */
|
||||||
|
/* FIXME: cagney/2002-11-18: This problem will go away once
|
||||||
|
frame.c:get_prev_frame() is modified to set the frame's
|
||||||
|
type before calling functions like this. */
|
||||||
find_pc_partial_function (frame->pc, &name,
|
find_pc_partial_function (frame->pc, &name,
|
||||||
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
|
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
|
||||||
if (!PC_IN_SIGTRAMP (frame->pc, name))
|
if (!PC_IN_SIGTRAMP (frame->pc, name))
|
||||||
|
|
|
@ -1117,19 +1117,24 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
|
||||||
+ fi->next->extra_info->framesize);
|
+ fi->next->extra_info->framesize);
|
||||||
|
|
||||||
/* Determine whether or not we're in a sigtramp frame.
|
/* Determine whether or not we're in a sigtramp frame.
|
||||||
Unfortunately, it isn't sufficient to test
|
Unfortunately, it isn't sufficient to test (get_frame_type (fi)
|
||||||
fi->signal_handler_caller because this value is sometimes set
|
== SIGTRAMP_FRAME) because this value is sometimes set after
|
||||||
after invoking INIT_EXTRA_FRAME_INFO. So we test *both*
|
invoking INIT_EXTRA_FRAME_INFO. So we test *both*
|
||||||
fi->signal_handler_caller and PC_IN_SIGTRAMP to determine if we
|
(get_frame_type (fi) == SIGTRAMP_FRAME) and PC_IN_SIGTRAMP to
|
||||||
need to use the sigcontext addresses for the saved registers.
|
determine if we need to use the sigcontext addresses for the
|
||||||
|
saved registers.
|
||||||
|
|
||||||
Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare
|
Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare
|
||||||
against the name of the function, the code below will have to be
|
against the name of the function, the code below will have to be
|
||||||
changed to first fetch the name of the function and then pass
|
changed to first fetch the name of the function and then pass
|
||||||
this name to PC_IN_SIGTRAMP. */
|
this name to PC_IN_SIGTRAMP. */
|
||||||
|
|
||||||
|
/* FIXME: cagney/2002-11-18: This problem will go away once
|
||||||
|
frame.c:get_prev_frame() is modified to set the frame's type
|
||||||
|
before calling functions like this. */
|
||||||
|
|
||||||
if (SIGCONTEXT_REGISTER_ADDRESS_P ()
|
if (SIGCONTEXT_REGISTER_ADDRESS_P ()
|
||||||
&& (fi->signal_handler_caller || PC_IN_SIGTRAMP (fi->pc, (char *)0)))
|
&& ((get_frame_type (fi) == SIGTRAMP_FRAME) || PC_IN_SIGTRAMP (fi->pc, (char *)0)))
|
||||||
{
|
{
|
||||||
for (reg = 0; reg < NUM_REGS; reg++)
|
for (reg = 0; reg < NUM_REGS; reg++)
|
||||||
fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);
|
fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);
|
||||||
|
|
|
@ -210,7 +210,11 @@ frame_address_in_block (struct frame_info *frame)
|
||||||
instruction. Unfortunately, this is not straightforward to do, so
|
instruction. Unfortunately, this is not straightforward to do, so
|
||||||
we just use the address minus one, which is a good enough
|
we just use the address minus one, which is a good enough
|
||||||
approximation. */
|
approximation. */
|
||||||
if (frame->next != 0 && frame->next->signal_handler_caller == 0)
|
/* FIXME: cagney/2002-11-10: Should this instead test for
|
||||||
|
NORMAL_FRAME? A dummy frame (in fact all the abnormal frames)
|
||||||
|
save the PC value in the block. */
|
||||||
|
if (frame->next != 0
|
||||||
|
&& get_frame_type (frame->next) != SIGTRAMP_FRAME)
|
||||||
--pc;
|
--pc;
|
||||||
|
|
||||||
return pc;
|
return pc;
|
||||||
|
|
|
@ -532,11 +532,6 @@ extern int breakpoint_inserted_here_p (CORE_ADDR);
|
||||||
implements a functional superset of this function. The only reason
|
implements a functional superset of this function. The only reason
|
||||||
it hasn't been removed is because some architectures still don't
|
it hasn't been removed is because some architectures still don't
|
||||||
use the new framework. Once they have been fixed, this can go. */
|
use the new framework. Once they have been fixed, this can go. */
|
||||||
/* FIXME: cagney/2002-11-10: There should be a function (hmm,
|
|
||||||
something like, enum { NORMAL_FRAME, DUMMY_FRAME, SIGTRAMP_FRAME }
|
|
||||||
get_frame_type() ...) that the caller can use to determine the
|
|
||||||
frame's type. This could replace this function, PC_IN_CALL_DUMMY,
|
|
||||||
and fi->signal_handler_caller. */
|
|
||||||
extern int deprecated_frame_in_dummy (struct frame_info *);
|
extern int deprecated_frame_in_dummy (struct frame_info *);
|
||||||
|
|
||||||
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
|
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
|
||||||
|
|
|
@ -392,7 +392,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
|
||||||
|
|
||||||
CORE_ADDR frame
|
CORE_ADDR frame
|
||||||
CORE_ADDR pc
|
CORE_ADDR pc
|
||||||
int signal_handler_caller
|
enum frame_type type;
|
||||||
CORE_ADDR return_pc
|
CORE_ADDR return_pc
|
||||||
int leaf_function
|
int leaf_function
|
||||||
|
|
||||||
|
@ -405,8 +405,9 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
|
||||||
of the register PC. All other frames contain the content of the
|
of the register PC. All other frames contain the content of the
|
||||||
register PC in the next frame.
|
register PC in the next frame.
|
||||||
|
|
||||||
The variable signal_handler_caller is non-zero when the frame is
|
The variable `type' indicates the frame's type: normal, SIGTRAMP
|
||||||
associated with the call of a signal handler.
|
(associated with a signal handler), dummy (associated with a dummy
|
||||||
|
frame).
|
||||||
|
|
||||||
The variable return_pc contains the address where execution should be
|
The variable return_pc contains the address where execution should be
|
||||||
resumed when the present frame has finished, the return address.
|
resumed when the present frame has finished, the return address.
|
||||||
|
@ -1140,7 +1141,7 @@ cris_abi_v2_reg_struct_has_addr (int gcc_p, struct type *type)
|
||||||
int
|
int
|
||||||
cris_frameless_function_invocation (struct frame_info *fi)
|
cris_frameless_function_invocation (struct frame_info *fi)
|
||||||
{
|
{
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return frameless_look_for_prologue (fi);
|
return frameless_look_for_prologue (fi);
|
||||||
|
|
83
gdb/frame.c
83
gdb/frame.c
|
@ -675,7 +675,7 @@ struct frame_info *
|
||||||
create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
|
create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
struct frame_info *fi;
|
struct frame_info *fi;
|
||||||
char *name;
|
enum frame_type type;
|
||||||
|
|
||||||
fi = (struct frame_info *)
|
fi = (struct frame_info *)
|
||||||
obstack_alloc (&frame_cache_obstack,
|
obstack_alloc (&frame_cache_obstack,
|
||||||
|
@ -686,8 +686,27 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
|
||||||
|
|
||||||
fi->frame = addr;
|
fi->frame = addr;
|
||||||
fi->pc = pc;
|
fi->pc = pc;
|
||||||
find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
|
/* NOTE: cagney/2002-11-18: The code segments, found in
|
||||||
fi->signal_handler_caller = PC_IN_SIGTRAMP (fi->pc, name);
|
create_new_frame and get_prev_frame(), that initializes the
|
||||||
|
frames type is subtly different. The latter only updates ->type
|
||||||
|
when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME. This stops
|
||||||
|
get_prev_frame() overriding the frame's type when the INIT code
|
||||||
|
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 (USE_GENERIC_DUMMY_FRAMES && PC_IN_CALL_DUMMY (fi->pc, 0, 0))
|
||||||
|
/* NOTE: cagney/2002-11-11: Does this even occure? */
|
||||||
|
type = DUMMY_FRAME;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
find_pc_partial_function (pc, &name, NULL, NULL);
|
||||||
|
if (PC_IN_SIGTRAMP (fi->pc, name))
|
||||||
|
type = SIGTRAMP_FRAME;
|
||||||
|
else
|
||||||
|
type = NORMAL_FRAME;
|
||||||
|
}
|
||||||
|
fi->type = type;
|
||||||
|
|
||||||
if (INIT_EXTRA_FRAME_INFO_P ())
|
if (INIT_EXTRA_FRAME_INFO_P ())
|
||||||
INIT_EXTRA_FRAME_INFO (0, fi);
|
INIT_EXTRA_FRAME_INFO (0, fi);
|
||||||
|
@ -746,7 +765,6 @@ get_prev_frame (struct frame_info *next_frame)
|
||||||
CORE_ADDR address = 0;
|
CORE_ADDR address = 0;
|
||||||
struct frame_info *prev;
|
struct frame_info *prev;
|
||||||
int fromleaf;
|
int fromleaf;
|
||||||
char *name;
|
|
||||||
|
|
||||||
/* Return the inner-most frame, when the caller passes in NULL. */
|
/* Return the inner-most frame, when the caller passes in NULL. */
|
||||||
/* NOTE: cagney/2002-11-09: Not sure how this would happen. The
|
/* NOTE: cagney/2002-11-09: Not sure how this would happen. The
|
||||||
|
@ -845,6 +863,11 @@ get_prev_frame (struct frame_info *next_frame)
|
||||||
prev->next = next_frame;
|
prev->next = next_frame;
|
||||||
prev->frame = address;
|
prev->frame = address;
|
||||||
prev->level = next_frame->level + 1;
|
prev->level = next_frame->level + 1;
|
||||||
|
/* FIXME: cagney/2002-11-18: Should be setting the frame's type
|
||||||
|
here, before anything else, and not last. Various INIT functions
|
||||||
|
are full of work-arounds for the frames type not being set
|
||||||
|
correctly from the word go. Ulgh! */
|
||||||
|
prev->type = NORMAL_FRAME;
|
||||||
|
|
||||||
/* This change should not be needed, FIXME! We should determine
|
/* This change should not be needed, FIXME! We should determine
|
||||||
whether any targets *need* INIT_FRAME_PC to happen after
|
whether any targets *need* INIT_FRAME_PC to happen after
|
||||||
|
@ -944,10 +967,36 @@ get_prev_frame (struct frame_info *next_frame)
|
||||||
set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind,
|
set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind,
|
||||||
&prev->pc_unwind);
|
&prev->pc_unwind);
|
||||||
|
|
||||||
find_pc_partial_function (prev->pc, &name,
|
/* NOTE: cagney/2002-11-18: The code segments, found in
|
||||||
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
|
create_new_frame and get_prev_frame(), that initializes the
|
||||||
if (PC_IN_SIGTRAMP (prev->pc, name))
|
frames type is subtly different. The latter only updates ->type
|
||||||
prev->signal_handler_caller = 1;
|
when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME. This stops
|
||||||
|
get_prev_frame() overriding the frame's type when the INIT code
|
||||||
|
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 (USE_GENERIC_DUMMY_FRAMES
|
||||||
|
&& PC_IN_CALL_DUMMY (prev->pc, 0, 0))
|
||||||
|
prev->type = DUMMY_FRAME;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* FIXME: cagney/2002-11-10: This should be moved to before the
|
||||||
|
INIT code above so that the INIT code knows what the frame's
|
||||||
|
type is (in fact, for a [generic] dummy-frame, the type can
|
||||||
|
be set and then the entire initialization can be skipped.
|
||||||
|
Unforunatly, its the INIT code that sets the PC (Hmm, catch
|
||||||
|
22). */
|
||||||
|
char *name;
|
||||||
|
find_pc_partial_function (prev->pc, &name, NULL, NULL);
|
||||||
|
if (PC_IN_SIGTRAMP (prev->pc, name))
|
||||||
|
prev->type = SIGTRAMP_FRAME;
|
||||||
|
/* FIXME: cagney/2002-11-11: Leave prev->type alone. Some
|
||||||
|
architectures are forcing the frame's type in INIT so we
|
||||||
|
don't want to override it here. Remember, NORMAL_FRAME == 0,
|
||||||
|
so it all works (just :-/). Once this initialization is
|
||||||
|
moved to the start of this function, all this nastness will
|
||||||
|
go away. */
|
||||||
|
}
|
||||||
|
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
|
@ -958,6 +1007,24 @@ get_frame_pc (struct frame_info *frame)
|
||||||
return frame->pc;
|
return frame->pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum frame_type
|
||||||
|
get_frame_type (struct frame_info *frame)
|
||||||
|
{
|
||||||
|
/* Some targets still don't use [generic] dummy frames. Catch them
|
||||||
|
here. */
|
||||||
|
if (!USE_GENERIC_DUMMY_FRAMES
|
||||||
|
&& deprecated_frame_in_dummy (frame))
|
||||||
|
return DUMMY_FRAME;
|
||||||
|
return frame->type;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
deprecated_set_frame_type (struct frame_info *frame, enum frame_type type)
|
||||||
|
{
|
||||||
|
/* Arrrg! See comment in "frame.h". */
|
||||||
|
frame->type = type;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef FRAME_FIND_SAVED_REGS
|
#ifdef FRAME_FIND_SAVED_REGS
|
||||||
/* XXX - deprecated. This is a compatibility function for targets
|
/* XXX - deprecated. This is a compatibility function for targets
|
||||||
that do not yet implement FRAME_INIT_SAVED_REGS. */
|
that do not yet implement FRAME_INIT_SAVED_REGS. */
|
||||||
|
|
40
gdb/frame.h
40
gdb/frame.h
|
@ -93,6 +93,35 @@ extern void get_frame_id (struct frame_info *fi, struct frame_id *id);
|
||||||
for an invalid frame). */
|
for an invalid frame). */
|
||||||
extern int frame_relative_level (struct frame_info *fi);
|
extern int frame_relative_level (struct frame_info *fi);
|
||||||
|
|
||||||
|
/* Return the frame's type. Some are real, some are signal
|
||||||
|
trampolines, and some are completly artificial (dummy). */
|
||||||
|
|
||||||
|
enum frame_type
|
||||||
|
{
|
||||||
|
/* A true stack frame, created by the target program during normal
|
||||||
|
execution. */
|
||||||
|
NORMAL_FRAME,
|
||||||
|
/* A fake frame, created by GDB when performing an inferior function
|
||||||
|
call. */
|
||||||
|
DUMMY_FRAME,
|
||||||
|
/* In a signal handler, various OSs handle this in various ways.
|
||||||
|
The main thing is that the frame may be far from normal. */
|
||||||
|
SIGTRAMP_FRAME
|
||||||
|
};
|
||||||
|
extern enum frame_type get_frame_type (struct frame_info *);
|
||||||
|
|
||||||
|
/* FIXME: cagney/2002-11-10: Some targets want to directly mark a
|
||||||
|
frame as being of a specific type. This shouldn't be necessary.
|
||||||
|
PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and PC_IN_CALL_DUMMY()
|
||||||
|
indicates a DUMMY_FRAME. I suspect the real problem here is that
|
||||||
|
get_prev_frame() only sets initialized after INIT_EXTRA_FRAME_INFO
|
||||||
|
as been called. Consequently, some targets found that the frame's
|
||||||
|
type was wrong and tried to fix it. The correct fix is to modify
|
||||||
|
get_prev_frame() so that it initializes the frame's type before
|
||||||
|
calling any other functions. */
|
||||||
|
extern void deprecated_set_frame_type (struct frame_info *,
|
||||||
|
enum frame_type type);
|
||||||
|
|
||||||
/* Unwind the stack frame so that the value of REGNUM, in the previous
|
/* Unwind the stack frame so that the value of REGNUM, in the previous
|
||||||
(up, older) frame is returned. If VALUEP is NULL, don't
|
(up, older) frame is returned. If VALUEP is NULL, don't
|
||||||
fetch/compute the value. Instead just return the location of the
|
fetch/compute the value. Instead just return the location of the
|
||||||
|
@ -227,15 +256,8 @@ struct frame_info
|
||||||
moment leave this as speculation. */
|
moment leave this as speculation. */
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
/* Nonzero if this is a frame associated with calling a signal handler.
|
/* The frame's type. */
|
||||||
|
enum frame_type type;
|
||||||
Set by machine-dependent code. On some machines, if
|
|
||||||
the machine-dependent code fails to check for this, the backtrace
|
|
||||||
will look relatively normal. For example, on the i386
|
|
||||||
#3 0x158728 in sighold ()
|
|
||||||
On other machines (e.g. rs6000), the machine-dependent code better
|
|
||||||
set this to prevent us from trying to print it like a normal frame. */
|
|
||||||
int signal_handler_caller;
|
|
||||||
|
|
||||||
/* For each register, address of where it was saved on entry to
|
/* For each register, address of where it was saved on entry to
|
||||||
the frame, or zero if it was not saved on entry to this frame.
|
the frame, or zero if it was not saved on entry to this frame.
|
||||||
|
|
|
@ -891,7 +891,7 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
|
|
||||||
#ifdef FRAME_SAVED_PC_IN_SIGTRAMP
|
#ifdef FRAME_SAVED_PC_IN_SIGTRAMP
|
||||||
/* Deal with signal handler caller frames too. */
|
/* Deal with signal handler caller frames too. */
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
CORE_ADDR rp;
|
CORE_ADDR rp;
|
||||||
FRAME_SAVED_PC_IN_SIGTRAMP (frame, &rp);
|
FRAME_SAVED_PC_IN_SIGTRAMP (frame, &rp);
|
||||||
|
@ -910,7 +910,7 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
register area to get the return pointer (the values
|
register area to get the return pointer (the values
|
||||||
in the registers may not correspond to anything useful). */
|
in the registers may not correspond to anything useful). */
|
||||||
if (frame->next
|
if (frame->next
|
||||||
&& (frame->next->signal_handler_caller
|
&& ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
||||||
|| pc_in_interrupt_handler (frame->next->pc)))
|
|| pc_in_interrupt_handler (frame->next->pc)))
|
||||||
{
|
{
|
||||||
struct frame_saved_regs saved_regs;
|
struct frame_saved_regs saved_regs;
|
||||||
|
@ -950,7 +950,7 @@ hppa_frame_saved_pc (struct frame_info *frame)
|
||||||
information out of the saved register info. */
|
information out of the saved register info. */
|
||||||
if (rp_offset == 0
|
if (rp_offset == 0
|
||||||
&& frame->next
|
&& frame->next
|
||||||
&& (frame->next->signal_handler_caller
|
&& ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
||||||
|| pc_in_interrupt_handler (frame->next->pc)))
|
|| pc_in_interrupt_handler (frame->next->pc)))
|
||||||
{
|
{
|
||||||
struct frame_saved_regs saved_regs;
|
struct frame_saved_regs saved_regs;
|
||||||
|
@ -1144,7 +1144,7 @@ frame_chain (struct frame_info *frame)
|
||||||
frame_base = read_memory_integer (frame->frame + SP_REGNUM * 4,
|
frame_base = read_memory_integer (frame->frame + SP_REGNUM * 4,
|
||||||
TARGET_PTR_BIT / 8);
|
TARGET_PTR_BIT / 8);
|
||||||
#ifdef FRAME_BASE_BEFORE_SIGTRAMP
|
#ifdef FRAME_BASE_BEFORE_SIGTRAMP
|
||||||
else if (frame->signal_handler_caller)
|
else if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
FRAME_BASE_BEFORE_SIGTRAMP (frame, &frame_base);
|
FRAME_BASE_BEFORE_SIGTRAMP (frame, &frame_base);
|
||||||
}
|
}
|
||||||
|
@ -1215,7 +1215,7 @@ frame_chain (struct frame_info *frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->Save_SP
|
if (u->Save_SP
|
||||||
|| tmp_frame->signal_handler_caller
|
|| (get_frame_type (tmp_frame) == SIGTRAMP_FRAME)
|
||||||
|| pc_in_interrupt_handler (tmp_frame->pc))
|
|| pc_in_interrupt_handler (tmp_frame->pc))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1240,7 +1240,7 @@ frame_chain (struct frame_info *frame)
|
||||||
/* We may have walked down the chain into a function with a frame
|
/* We may have walked down the chain into a function with a frame
|
||||||
pointer. */
|
pointer. */
|
||||||
if (u->Save_SP
|
if (u->Save_SP
|
||||||
&& !tmp_frame->signal_handler_caller
|
&& !(get_frame_type (tmp_frame) == SIGTRAMP_FRAME)
|
||||||
&& !pc_in_interrupt_handler (tmp_frame->pc))
|
&& !pc_in_interrupt_handler (tmp_frame->pc))
|
||||||
{
|
{
|
||||||
return read_memory_integer (tmp_frame->frame, TARGET_PTR_BIT / 8);
|
return read_memory_integer (tmp_frame->frame, TARGET_PTR_BIT / 8);
|
||||||
|
@ -1388,7 +1388,7 @@ hppa_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
|
||||||
and doesn't "call" an interrupt routine or signal handler caller,
|
and doesn't "call" an interrupt routine or signal handler caller,
|
||||||
then its not valid. */
|
then its not valid. */
|
||||||
if (u->Save_SP || u->Total_frame_size || u->stub_unwind.stub_type != 0
|
if (u->Save_SP || u->Total_frame_size || u->stub_unwind.stub_type != 0
|
||||||
|| (thisframe->next && thisframe->next->signal_handler_caller)
|
|| (thisframe->next && (get_frame_type (thisframe->next) == SIGTRAMP_FRAME))
|
||||||
|| (next_u && next_u->HP_UX_interrupt_marker))
|
|| (next_u && next_u->HP_UX_interrupt_marker))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -3888,7 +3888,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
|
||||||
|
|
||||||
#ifdef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
|
#ifdef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
|
||||||
/* Handle signal handler callers. */
|
/* Handle signal handler callers. */
|
||||||
if (frame_info->signal_handler_caller)
|
if ((get_frame_type (frame_info) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
FRAME_FIND_SAVED_REGS_IN_SIGTRAMP (frame_info, frame_saved_regs);
|
FRAME_FIND_SAVED_REGS_IN_SIGTRAMP (frame_info, frame_saved_regs);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -131,16 +131,16 @@ i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
|
||||||
be a signal handler caller). If we're dealing with a signal
|
be a signal handler caller). If we're dealing with a signal
|
||||||
handler caller, this will return valid, which is fine. If not,
|
handler caller, this will return valid, which is fine. If not,
|
||||||
it'll make the correct test. */
|
it'll make the correct test. */
|
||||||
return (thisframe->signal_handler_caller
|
return ((get_frame_type (thisframe) == SIGTRAMP_FRAME)
|
||||||
|| (chain != 0
|
|| (chain != 0
|
||||||
&& !inside_entry_file (read_memory_integer
|
&& !inside_entry_file (read_memory_integer
|
||||||
(thisframe->frame + 4, 4))));
|
(thisframe->frame + 4, 4))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We want to find the previous frame, which on Interix is tricky when signals
|
/* We want to find the previous frame, which on Interix is tricky when
|
||||||
are involved; set frame->frame appropriately, and also get the pc
|
signals are involved; set frame->frame appropriately, and also get
|
||||||
and tweak signal_handler_caller; this replaces a boatload of nested
|
the pc and tweak tye frame's type; this replaces a boatload of
|
||||||
macros, as well. */
|
nested macros, as well. */
|
||||||
static void
|
static void
|
||||||
i386_interix_back_one_frame (int fromleaf, struct frame_info *frame)
|
i386_interix_back_one_frame (int fromleaf, struct frame_info *frame)
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ i386_interix_back_one_frame (int fromleaf, struct frame_info *frame)
|
||||||
NullApi or something else? */
|
NullApi or something else? */
|
||||||
ra = SAVED_PC_AFTER_CALL (frame);
|
ra = SAVED_PC_AFTER_CALL (frame);
|
||||||
if (ra >= null_start && ra < null_end)
|
if (ra >= null_start && ra < null_end)
|
||||||
frame->signal_handler_caller = 1;
|
deprecated_set_frame_type (frame, SIGTRAMP_FRAME);
|
||||||
/* There might also be an indirect call to the mini-frame,
|
/* There might also be an indirect call to the mini-frame,
|
||||||
putting one more return address on the stack. (XP only,
|
putting one more return address on the stack. (XP only,
|
||||||
I think?) This can't (reasonably) return the address of the
|
I think?) This can't (reasonably) return the address of the
|
||||||
|
@ -177,12 +177,12 @@ i386_interix_back_one_frame (int fromleaf, struct frame_info *frame)
|
||||||
is safe. */
|
is safe. */
|
||||||
ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
|
ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
|
||||||
if (ra >= null_start && ra < null_end)
|
if (ra >= null_start && ra < null_end)
|
||||||
frame->signal_handler_caller = 1;
|
deprecated_set_frame_type (frame, SIGTRAMP_FRAME);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!frame->next->signal_handler_caller)
|
if (!(get_frame_type (frame->next) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
frame->pc = read_memory_integer (frame->next->frame + 4, 4);
|
frame->pc = read_memory_integer (frame->next->frame + 4, 4);
|
||||||
return;
|
return;
|
||||||
|
@ -316,7 +316,7 @@ i386_interix_frame_saved_pc (struct frame_info *fi)
|
||||||
/* Assume that we've already unwound enough to have the caller's address
|
/* Assume that we've already unwound enough to have the caller's address
|
||||||
if we're dealing with a signal handler caller (And if that fails,
|
if we're dealing with a signal handler caller (And if that fails,
|
||||||
return 0). */
|
return 0). */
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
return fi->next ? fi->next->pc : 0;
|
return fi->next ? fi->next->pc : 0;
|
||||||
else
|
else
|
||||||
return read_memory_integer (fi->frame + 4, 4);
|
return read_memory_integer (fi->frame + 4, 4);
|
||||||
|
|
|
@ -472,17 +472,16 @@ i386_get_frame_setup (CORE_ADDR pc)
|
||||||
frame -- that is, the frame which was in progress when the signal
|
frame -- that is, the frame which was in progress when the signal
|
||||||
trampoline was entered. GDB mostly treats this frame pointer value
|
trampoline was entered. GDB mostly treats this frame pointer value
|
||||||
as a magic cookie. We detect the case of a signal trampoline by
|
as a magic cookie. We detect the case of a signal trampoline by
|
||||||
looking at the SIGNAL_HANDLER_CALLER field, which is set based on
|
testing for get_frame_type() == SIGTRAMP_FRAME, which is set based
|
||||||
PC_IN_SIGTRAMP.
|
on PC_IN_SIGTRAMP.
|
||||||
|
|
||||||
When a signal trampoline is invoked from a frameless function, we
|
When a signal trampoline is invoked from a frameless function, we
|
||||||
essentially have two frameless functions in a row. In this case,
|
essentially have two frameless functions in a row. In this case,
|
||||||
we use the same magic cookie for three frames in a row. We detect
|
we use the same magic cookie for three frames in a row. We detect
|
||||||
this case by seeing whether the next frame has
|
this case by seeing whether the next frame is a SIGTRAMP_FRAME,
|
||||||
SIGNAL_HANDLER_CALLER set, and, if it does, checking whether the
|
and, if it does, checking whether the current frame is actually
|
||||||
current frame is actually frameless. In this case, we need to get
|
frameless. In this case, we need to get the PC by looking at the
|
||||||
the PC by looking at the SP register value stored in the signal
|
SP register value stored in the signal context.
|
||||||
context.
|
|
||||||
|
|
||||||
This should work in most cases except in horrible situations where
|
This should work in most cases except in horrible situations where
|
||||||
a signal occurs just as we enter a function but before the frame
|
a signal occurs just as we enter a function but before the frame
|
||||||
|
@ -498,7 +497,7 @@ i386_get_frame_setup (CORE_ADDR pc)
|
||||||
int
|
int
|
||||||
i386_frameless_signal_p (struct frame_info *frame)
|
i386_frameless_signal_p (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
return (frame->next && frame->next->signal_handler_caller
|
return (frame->next && get_frame_type (frame->next) == SIGTRAMP_FRAME
|
||||||
&& (frameless_look_for_prologue (frame)
|
&& (frameless_look_for_prologue (frame)
|
||||||
|| frame->pc == get_pc_function_start (frame->pc)));
|
|| frame->pc == get_pc_function_start (frame->pc)));
|
||||||
}
|
}
|
||||||
|
@ -513,7 +512,7 @@ i386_frame_chain (struct frame_info *frame)
|
||||||
if (PC_IN_CALL_DUMMY (frame->pc, 0, 0))
|
if (PC_IN_CALL_DUMMY (frame->pc, 0, 0))
|
||||||
return frame->frame;
|
return frame->frame;
|
||||||
|
|
||||||
if (frame->signal_handler_caller
|
if (get_frame_type (frame) == SIGTRAMP_FRAME
|
||||||
|| i386_frameless_signal_p (frame))
|
|| i386_frameless_signal_p (frame))
|
||||||
return frame->frame;
|
return frame->frame;
|
||||||
|
|
||||||
|
@ -530,7 +529,7 @@ i386_frame_chain (struct frame_info *frame)
|
||||||
static int
|
static int
|
||||||
i386_frameless_function_invocation (struct frame_info *frame)
|
i386_frameless_function_invocation (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if (get_frame_type (frame) == SIGTRAMP_FRAME)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return frameless_look_for_prologue (frame);
|
return frameless_look_for_prologue (frame);
|
||||||
|
@ -575,7 +574,7 @@ i386_frame_saved_pc (struct frame_info *frame)
|
||||||
return pc;
|
return pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame->signal_handler_caller)
|
if (get_frame_type (frame) == SIGTRAMP_FRAME)
|
||||||
return i386_sigtramp_saved_pc (frame);
|
return i386_sigtramp_saved_pc (frame);
|
||||||
|
|
||||||
if (i386_frameless_signal_p (frame))
|
if (i386_frameless_signal_p (frame))
|
||||||
|
@ -592,7 +591,7 @@ i386_frame_saved_pc (struct frame_info *frame)
|
||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
i386_saved_pc_after_call (struct frame_info *frame)
|
i386_saved_pc_after_call (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if (get_frame_type (frame) == SIGTRAMP_FRAME)
|
||||||
return i386_sigtramp_saved_pc (frame);
|
return i386_sigtramp_saved_pc (frame);
|
||||||
|
|
||||||
return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
|
return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
|
||||||
|
|
|
@ -328,9 +328,9 @@ read_sigcontext_register (struct frame_info *frame, int regnum)
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
"read_sigcontext_register: NULL frame");
|
"read_sigcontext_register: NULL frame");
|
||||||
if (!frame->signal_handler_caller)
|
if (!(get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
"read_sigcontext_register: frame not a signal_handler_caller");
|
"read_sigcontext_register: frame not a signal trampoline");
|
||||||
if (SIGCONTEXT_REGISTER_ADDRESS == 0)
|
if (SIGCONTEXT_REGISTER_ADDRESS == 0)
|
||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
"read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
|
"read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
|
||||||
|
@ -703,7 +703,7 @@ rse_address_add(CORE_ADDR addr, int nslots)
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
ia64_frame_chain (struct frame_info *frame)
|
ia64_frame_chain (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return read_sigcontext_register (frame, sp_regnum);
|
return read_sigcontext_register (frame, sp_regnum);
|
||||||
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
|
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
|
||||||
return frame->frame;
|
return frame->frame;
|
||||||
|
@ -720,7 +720,7 @@ ia64_frame_chain (struct frame_info *frame)
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
ia64_frame_saved_pc (struct frame_info *frame)
|
ia64_frame_saved_pc (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return read_sigcontext_register (frame, pc_regnum);
|
return read_sigcontext_register (frame, pc_regnum);
|
||||||
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
|
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
|
||||||
return deprecated_read_register_dummy (frame->pc, frame->frame, pc_regnum);
|
return deprecated_read_register_dummy (frame->pc, frame->frame, pc_regnum);
|
||||||
|
@ -730,7 +730,7 @@ ia64_frame_saved_pc (struct frame_info *frame)
|
||||||
|
|
||||||
if (frame->saved_regs[IA64_VRAP_REGNUM])
|
if (frame->saved_regs[IA64_VRAP_REGNUM])
|
||||||
return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8);
|
return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8);
|
||||||
else if (frame->next && frame->next->signal_handler_caller)
|
else if (frame->next && (get_frame_type (frame->next) == SIGTRAMP_FRAME))
|
||||||
return read_sigcontext_register (frame->next, IA64_BR0_REGNUM);
|
return read_sigcontext_register (frame->next, IA64_BR0_REGNUM);
|
||||||
else /* either frameless, or not far enough along in the prologue... */
|
else /* either frameless, or not far enough along in the prologue... */
|
||||||
return ia64_saved_pc_after_call (frame);
|
return ia64_saved_pc_after_call (frame);
|
||||||
|
@ -1163,7 +1163,7 @@ ia64_frame_init_saved_regs (struct frame_info *frame)
|
||||||
if (frame->saved_regs)
|
if (frame->saved_regs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (frame->signal_handler_caller && SIGCONTEXT_REGISTER_ADDRESS)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME) && SIGCONTEXT_REGISTER_ADDRESS)
|
||||||
{
|
{
|
||||||
int regno;
|
int regno;
|
||||||
|
|
||||||
|
@ -1493,7 +1493,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
|
||||||
cfm = read_register (IA64_CFM_REGNUM);
|
cfm = read_register (IA64_CFM_REGNUM);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (frame->next->signal_handler_caller)
|
else if ((get_frame_type (frame->next) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
bsp = read_sigcontext_register (frame->next, IA64_BSP_REGNUM);
|
bsp = read_sigcontext_register (frame->next, IA64_BSP_REGNUM);
|
||||||
cfm = read_sigcontext_register (frame->next, IA64_CFM_REGNUM);
|
cfm = read_sigcontext_register (frame->next, IA64_CFM_REGNUM);
|
||||||
|
@ -1515,7 +1515,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
|
||||||
|
|
||||||
if (frn->saved_regs[IA64_CFM_REGNUM] != 0)
|
if (frn->saved_regs[IA64_CFM_REGNUM] != 0)
|
||||||
cfm = read_memory_integer (frn->saved_regs[IA64_CFM_REGNUM], 8);
|
cfm = read_memory_integer (frn->saved_regs[IA64_CFM_REGNUM], 8);
|
||||||
else if (frn->next && frn->next->signal_handler_caller)
|
else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME))
|
||||||
cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
|
cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
|
||||||
else if (frn->next
|
else if (frn->next
|
||||||
&& PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame,
|
&& PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame,
|
||||||
|
@ -1531,7 +1531,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
|
||||||
frame->extra_info->sof = cfm & 0x7f;
|
frame->extra_info->sof = cfm & 0x7f;
|
||||||
frame->extra_info->sol = (cfm >> 7) & 0x7f;
|
frame->extra_info->sol = (cfm >> 7) & 0x7f;
|
||||||
if (frame->next == 0
|
if (frame->next == 0
|
||||||
|| frame->next->signal_handler_caller
|
|| (get_frame_type (frame->next) == SIGTRAMP_FRAME)
|
||||||
|| next_frame_is_call_dummy)
|
|| next_frame_is_call_dummy)
|
||||||
frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof);
|
frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof);
|
||||||
else
|
else
|
||||||
|
|
|
@ -270,7 +270,7 @@ m68k_store_return_value (struct type *type, char *valbuf)
|
||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
m68k_frame_chain (struct frame_info *thisframe)
|
m68k_frame_chain (struct frame_info *thisframe)
|
||||||
{
|
{
|
||||||
if (thisframe->signal_handler_caller)
|
if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
|
||||||
return thisframe->frame;
|
return thisframe->frame;
|
||||||
else if (!inside_entry_file ((thisframe)->pc))
|
else if (!inside_entry_file ((thisframe)->pc))
|
||||||
return read_memory_integer ((thisframe)->frame, 4);
|
return read_memory_integer ((thisframe)->frame, 4);
|
||||||
|
@ -285,7 +285,7 @@ m68k_frame_chain (struct frame_info *thisframe)
|
||||||
static int
|
static int
|
||||||
m68k_frameless_function_invocation (struct frame_info *fi)
|
m68k_frameless_function_invocation (struct frame_info *fi)
|
||||||
{
|
{
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return frameless_look_for_prologue (fi);
|
return frameless_look_for_prologue (fi);
|
||||||
|
@ -294,7 +294,7 @@ m68k_frameless_function_invocation (struct frame_info *fi)
|
||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
m68k_frame_saved_pc (struct frame_info *frame)
|
m68k_frame_saved_pc (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
if (frame->next)
|
if (frame->next)
|
||||||
return read_memory_integer (frame->next->frame + SIG_PC_FP_OFFSET, 4);
|
return read_memory_integer (frame->next->frame + SIG_PC_FP_OFFSET, 4);
|
||||||
|
@ -343,12 +343,12 @@ delta68_frame_args_address (struct frame_info *frame_info)
|
||||||
{
|
{
|
||||||
/* we assume here that the only frameless functions are the system calls
|
/* we assume here that the only frameless functions are the system calls
|
||||||
or other functions who do not put anything on the stack. */
|
or other functions who do not put anything on the stack. */
|
||||||
if (frame_info->signal_handler_caller)
|
if ((get_frame_type (frame_info) == SIGTRAMP_FRAME))
|
||||||
return frame_info->frame + 12;
|
return frame_info->frame + 12;
|
||||||
else if (frameless_look_for_prologue (frame_info))
|
else if (frameless_look_for_prologue (frame_info))
|
||||||
{
|
{
|
||||||
/* Check for an interrupted system call */
|
/* Check for an interrupted system call */
|
||||||
if (frame_info->next && frame_info->next->signal_handler_caller)
|
if (frame_info->next && (get_frame_type (frame_info->next) == SIGTRAMP_FRAME))
|
||||||
return frame_info->next->frame + 16;
|
return frame_info->next->frame + 16;
|
||||||
else
|
else
|
||||||
return frame_info->frame + 4;
|
return frame_info->frame + 4;
|
||||||
|
@ -759,7 +759,7 @@ lose:;
|
||||||
frame_info->saved_regs[PC_REGNUM] = (frame_info)->frame + 4;
|
frame_info->saved_regs[PC_REGNUM] = (frame_info)->frame + 4;
|
||||||
#ifdef SIG_SP_FP_OFFSET
|
#ifdef SIG_SP_FP_OFFSET
|
||||||
/* Adjust saved SP_REGNUM for fake _sigtramp frames. */
|
/* Adjust saved SP_REGNUM for fake _sigtramp frames. */
|
||||||
if (frame_info->signal_handler_caller && frame_info->next)
|
if ((get_frame_type (frame_info) == SIGTRAMP_FRAME) && frame_info->next)
|
||||||
frame_info->saved_regs[SP_REGNUM] =
|
frame_info->saved_regs[SP_REGNUM] =
|
||||||
frame_info->next->frame + SIG_SP_FP_OFFSET;
|
frame_info->next->frame + SIG_SP_FP_OFFSET;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -685,7 +685,7 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame)
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
m68k_linux_frame_saved_pc (struct frame_info *frame)
|
m68k_linux_frame_saved_pc (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return m68k_linux_sigtramp_saved_pc (frame);
|
return m68k_linux_sigtramp_saved_pc (frame);
|
||||||
|
|
||||||
return read_memory_integer (frame->frame + 4, 4);
|
return read_memory_integer (frame->frame + 4, 4);
|
||||||
|
|
|
@ -1423,7 +1423,7 @@ mips_find_saved_regs (struct frame_info *fci)
|
||||||
/* FIXME! Is this correct?? */
|
/* FIXME! Is this correct?? */
|
||||||
#define SIGFRAME_REG_SIZE MIPS_REGSIZE
|
#define SIGFRAME_REG_SIZE MIPS_REGSIZE
|
||||||
#endif
|
#endif
|
||||||
if (fci->signal_handler_caller)
|
if ((get_frame_type (fci) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
|
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
|
||||||
{
|
{
|
||||||
|
@ -1456,7 +1456,7 @@ mips_find_saved_regs (struct frame_info *fci)
|
||||||
a signal, we assume that all registers have been saved.
|
a signal, we assume that all registers have been saved.
|
||||||
This assumes that all register saves in a function happen before
|
This assumes that all register saves in a function happen before
|
||||||
the first function call. */
|
the first function call. */
|
||||||
(fci->next == NULL || fci->next->signal_handler_caller)
|
(fci->next == NULL || (get_frame_type (fci->next) == SIGTRAMP_FRAME))
|
||||||
|
|
||||||
/* In a dummy frame we know exactly where things are saved. */
|
/* In a dummy frame we know exactly where things are saved. */
|
||||||
&& !PROC_DESC_IS_DUMMY (proc_desc)
|
&& !PROC_DESC_IS_DUMMY (proc_desc)
|
||||||
|
@ -1701,7 +1701,7 @@ mips_frame_saved_pc (struct frame_info *frame)
|
||||||
mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
|
mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
|
||||||
/* We have to get the saved pc from the sigcontext
|
/* We have to get the saved pc from the sigcontext
|
||||||
if it is a signal handler frame. */
|
if it is a signal handler frame. */
|
||||||
int pcreg = frame->signal_handler_caller ? PC_REGNUM
|
int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM
|
||||||
: (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM);
|
: (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM);
|
||||||
|
|
||||||
if (USE_GENERIC_DUMMY_FRAMES
|
if (USE_GENERIC_DUMMY_FRAMES
|
||||||
|
@ -2451,7 +2451,7 @@ mips_frame_chain (struct frame_info *frame)
|
||||||
&& PROC_FRAME_OFFSET (proc_desc) == 0
|
&& PROC_FRAME_OFFSET (proc_desc) == 0
|
||||||
/* The previous frame from a sigtramp frame might be frameless
|
/* The previous frame from a sigtramp frame might be frameless
|
||||||
and have frame size zero. */
|
and have frame size zero. */
|
||||||
&& !frame->signal_handler_caller
|
&& !(get_frame_type (frame) == SIGTRAMP_FRAME)
|
||||||
/* For a generic dummy frame, let get_frame_pointer() unwind a
|
/* For a generic dummy frame, let get_frame_pointer() unwind a
|
||||||
register value saved as part of the dummy frame call. */
|
register value saved as part of the dummy frame call. */
|
||||||
&& !(USE_GENERIC_DUMMY_FRAMES
|
&& !(USE_GENERIC_DUMMY_FRAMES
|
||||||
|
@ -2502,8 +2502,12 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
/* Do not set the saved registers for a sigtramp frame,
|
/* Do not set the saved registers for a sigtramp frame,
|
||||||
mips_find_saved_registers will do that for us.
|
mips_find_saved_registers will do that for us. We can't
|
||||||
We can't use fci->signal_handler_caller, it is not yet set. */
|
use (get_frame_type (fci) == SIGTRAMP_FRAME), it is not
|
||||||
|
yet set. */
|
||||||
|
/* FIXME: cagney/2002-11-18: This problem will go away once
|
||||||
|
frame.c:get_prev_frame() is modified to set the frame's
|
||||||
|
type before calling functions like this. */
|
||||||
find_pc_partial_function (fci->pc, &name,
|
find_pc_partial_function (fci->pc, &name,
|
||||||
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
|
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
|
||||||
if (!PC_IN_SIGTRAMP (fci->pc, name))
|
if (!PC_IN_SIGTRAMP (fci->pc, name))
|
||||||
|
|
|
@ -342,7 +342,7 @@ ns32k_sigtramp_saved_pc (struct frame_info *frame)
|
||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
ns32k_frame_saved_pc (struct frame_info *frame)
|
ns32k_frame_saved_pc (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return (ns32k_sigtramp_saved_pc (frame)); /* XXXJRT */
|
return (ns32k_sigtramp_saved_pc (frame)); /* XXXJRT */
|
||||||
|
|
||||||
return (read_memory_integer (frame->frame + 4, 4));
|
return (read_memory_integer (frame->frame + 4, 4));
|
||||||
|
|
|
@ -143,10 +143,15 @@ static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc);
|
||||||
behavior is ever fixed.)
|
behavior is ever fixed.)
|
||||||
|
|
||||||
PC_IN_SIGTRAMP is called from blockframe.c as well in order to set
|
PC_IN_SIGTRAMP is called from blockframe.c as well in order to set
|
||||||
the signal_handler_caller flag. Because of our strange definition
|
the frame's type (if a SIGTRAMP_FRAME). Because of our strange
|
||||||
of in_sigtramp below, we can't rely on signal_handler_caller
|
definition of in_sigtramp below, we can't rely on the frame's type
|
||||||
getting set correctly from within blockframe.c. This is why we
|
getting set correctly from within blockframe.c. This is why we
|
||||||
take pains to set it in init_extra_frame_info(). */
|
take pains to set it in init_extra_frame_info().
|
||||||
|
|
||||||
|
NOTE: cagney/2002-11-10: I suspect the real problem here is that
|
||||||
|
the get_prev_frame() only initializes the frame's type after the
|
||||||
|
call to INIT_FRAME_INFO. get_prev_frame() should be fixed, this
|
||||||
|
code shouldn't be working its way around a bug :-(. */
|
||||||
|
|
||||||
int
|
int
|
||||||
ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
|
ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
|
||||||
|
@ -318,14 +323,14 @@ ppc_linux_skip_trampoline_code (CORE_ADDR pc)
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
ppc_linux_frame_saved_pc (struct frame_info *fi)
|
ppc_linux_frame_saved_pc (struct frame_info *fi)
|
||||||
{
|
{
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
CORE_ADDR regs_addr =
|
CORE_ADDR regs_addr =
|
||||||
read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
|
read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
|
||||||
/* return the NIP in the regs array */
|
/* return the NIP in the regs array */
|
||||||
return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_NIP, 4);
|
return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_NIP, 4);
|
||||||
}
|
}
|
||||||
else if (fi->next && fi->next->signal_handler_caller)
|
else if (fi->next && (get_frame_type (fi->next) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
CORE_ADDR regs_addr =
|
CORE_ADDR regs_addr =
|
||||||
read_memory_integer (fi->next->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
|
read_memory_integer (fi->next->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
|
||||||
|
@ -347,9 +352,11 @@ ppc_linux_init_extra_frame_info (int fromleaf, struct frame_info *fi)
|
||||||
this is a signal frame by looking to see if the pc points
|
this is a signal frame by looking to see if the pc points
|
||||||
at trampoline code */
|
at trampoline code */
|
||||||
if (ppc_linux_at_sigtramp_return_path (fi->pc))
|
if (ppc_linux_at_sigtramp_return_path (fi->pc))
|
||||||
fi->signal_handler_caller = 1;
|
deprecated_set_frame_type (fi, SIGTRAMP_FRAME);
|
||||||
else
|
else
|
||||||
fi->signal_handler_caller = 0;
|
/* FIXME: cagney/2002-11-10: Is this double bogus? What
|
||||||
|
happens if the frame has previously been marked as a dummy? */
|
||||||
|
deprecated_set_frame_type (fi, NORMAL_FRAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,7 +374,7 @@ ppc_linux_frameless_function_invocation (struct frame_info *fi)
|
||||||
void
|
void
|
||||||
ppc_linux_frame_init_saved_regs (struct frame_info *fi)
|
ppc_linux_frame_init_saved_regs (struct frame_info *fi)
|
||||||
{
|
{
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
CORE_ADDR regs_addr;
|
CORE_ADDR regs_addr;
|
||||||
int i;
|
int i;
|
||||||
|
@ -405,7 +412,7 @@ CORE_ADDR
|
||||||
ppc_linux_frame_chain (struct frame_info *thisframe)
|
ppc_linux_frame_chain (struct frame_info *thisframe)
|
||||||
{
|
{
|
||||||
/* Kernel properly constructs the frame chain for the handler */
|
/* Kernel properly constructs the frame chain for the handler */
|
||||||
if (thisframe->signal_handler_caller)
|
if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
|
||||||
return read_memory_integer ((thisframe)->frame, 4);
|
return read_memory_integer ((thisframe)->frame, 4);
|
||||||
else
|
else
|
||||||
return rs6000_frame_chain (thisframe);
|
return rs6000_frame_chain (thisframe);
|
||||||
|
|
|
@ -175,7 +175,7 @@ rs6000_init_extra_frame_info (int fromleaf, struct frame_info *fi)
|
||||||
/* and this is a special signal frame. */
|
/* and this is a special signal frame. */
|
||||||
/* (fi->pc will be some low address in the kernel, */
|
/* (fi->pc will be some low address in the kernel, */
|
||||||
/* to which the signal handler returns). */
|
/* to which the signal handler returns). */
|
||||||
fi->signal_handler_caller = 1;
|
deprecated_set_frame_type (fi, SIGTRAMP_FRAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put here the code to store, into a struct frame_saved_regs,
|
/* Put here the code to store, into a struct frame_saved_regs,
|
||||||
|
@ -1477,7 +1477,7 @@ rs6000_frameless_function_invocation (struct frame_info *fi)
|
||||||
|
|
||||||
/* Don't even think about framelessness except on the innermost frame
|
/* Don't even think about framelessness except on the innermost frame
|
||||||
or if the function was interrupted by a signal. */
|
or if the function was interrupted by a signal. */
|
||||||
if (fi->next != NULL && !fi->next->signal_handler_caller)
|
if (fi->next != NULL && !(get_frame_type (fi->next) == SIGTRAMP_FRAME))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
func_start = get_pc_function_start (fi->pc);
|
func_start = get_pc_function_start (fi->pc);
|
||||||
|
@ -1511,7 +1511,7 @@ rs6000_frame_saved_pc (struct frame_info *fi)
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
||||||
int wordsize = tdep->wordsize;
|
int wordsize = tdep->wordsize;
|
||||||
|
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize);
|
return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize);
|
||||||
|
|
||||||
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
|
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
|
||||||
|
@ -1528,7 +1528,7 @@ rs6000_frame_saved_pc (struct frame_info *fi)
|
||||||
|
|
||||||
if (fdata.lr_offset == 0 && fi->next != NULL)
|
if (fdata.lr_offset == 0 && fi->next != NULL)
|
||||||
{
|
{
|
||||||
if (fi->next->signal_handler_caller)
|
if ((get_frame_type (fi->next) == SIGTRAMP_FRAME))
|
||||||
return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
|
return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
|
||||||
wordsize);
|
wordsize);
|
||||||
else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0))
|
else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0))
|
||||||
|
@ -1753,11 +1753,11 @@ rs6000_frame_chain (struct frame_info *thisframe)
|
||||||
thisframe->pc == entry_point_address ())
|
thisframe->pc == entry_point_address ())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (thisframe->signal_handler_caller)
|
if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
|
||||||
fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET,
|
fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET,
|
||||||
wordsize);
|
wordsize);
|
||||||
else if (thisframe->next != NULL
|
else if (thisframe->next != NULL
|
||||||
&& thisframe->next->signal_handler_caller
|
&& (get_frame_type (thisframe->next) == SIGTRAMP_FRAME)
|
||||||
&& FRAMELESS_FUNCTION_INVOCATION (thisframe))
|
&& FRAMELESS_FUNCTION_INVOCATION (thisframe))
|
||||||
/* A frameless function interrupted by a signal did not change the
|
/* A frameless function interrupted by a signal did not change the
|
||||||
frame pointer. */
|
frame pointer. */
|
||||||
|
|
|
@ -1001,8 +1001,8 @@ s390_frame_saved_pc (struct frame_info *fi)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* We want backtraces out of signal handlers so we don't
|
/* We want backtraces out of signal handlers so we don't set
|
||||||
set thisframe->signal_handler_caller to 1 */
|
(get_frame_type (thisframe) == SIGTRAMP_FRAME) to 1 */
|
||||||
|
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
s390_frame_chain (struct frame_info *thisframe)
|
s390_frame_chain (struct frame_info *thisframe)
|
||||||
|
|
|
@ -314,7 +314,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
|
||||||
/* Compute ->frame as if not flat. If it is flat, we'll change
|
/* Compute ->frame as if not flat. If it is flat, we'll change
|
||||||
it later. */
|
it later. */
|
||||||
if (fi->next->next != NULL
|
if (fi->next->next != NULL
|
||||||
&& (fi->next->next->signal_handler_caller
|
&& ((get_frame_type (fi->next->next) == SIGTRAMP_FRAME)
|
||||||
|| deprecated_frame_in_dummy (fi->next->next))
|
|| deprecated_frame_in_dummy (fi->next->next))
|
||||||
&& frameless_look_for_prologue (fi->next))
|
&& frameless_look_for_prologue (fi->next))
|
||||||
{
|
{
|
||||||
|
@ -451,7 +451,7 @@ sparc_frame_saved_pc (struct frame_info *frame)
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
|
|
||||||
buf = alloca (MAX_REGISTER_RAW_SIZE);
|
buf = alloca (MAX_REGISTER_RAW_SIZE);
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
/* This is the signal trampoline frame.
|
/* This is the signal trampoline frame.
|
||||||
Get the saved PC from the sigcontext structure. */
|
Get the saved PC from the sigcontext structure. */
|
||||||
|
@ -487,7 +487,7 @@ sparc_frame_saved_pc (struct frame_info *frame)
|
||||||
}
|
}
|
||||||
else if (frame->extra_info->in_prologue ||
|
else if (frame->extra_info->in_prologue ||
|
||||||
(frame->next != NULL &&
|
(frame->next != NULL &&
|
||||||
(frame->next->signal_handler_caller ||
|
((get_frame_type (frame->next) == SIGTRAMP_FRAME) ||
|
||||||
deprecated_frame_in_dummy (frame->next)) &&
|
deprecated_frame_in_dummy (frame->next)) &&
|
||||||
frameless_look_for_prologue (frame)))
|
frameless_look_for_prologue (frame)))
|
||||||
{
|
{
|
||||||
|
|
16
gdb/stack.c
16
gdb/stack.c
|
@ -367,7 +367,7 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
|
||||||
annotate_frame_end ();
|
annotate_frame_end ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fi->signal_handler_caller)
|
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
|
annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
|
||||||
|
|
||||||
|
@ -385,15 +385,15 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If fi is not the innermost frame, that normally means that fi->pc
|
/* If fi is not the innermost frame, that normally means that fi->pc
|
||||||
points to *after* the call instruction, and we want to get the line
|
points to *after* the call instruction, and we want to get the
|
||||||
containing the call, never the next line. But if the next frame is
|
line containing the call, never the next line. But if the next
|
||||||
a signal_handler_caller or a dummy frame, then the next frame was
|
frame is a SIGTRAMP_FRAME or a DUMMY_FRAME, then the next frame
|
||||||
not entered as the result of a call, and we want to get the line
|
was not entered as the result of a call, and we want to get the
|
||||||
containing fi->pc. */
|
line containing fi->pc. */
|
||||||
sal =
|
sal =
|
||||||
find_pc_line (fi->pc,
|
find_pc_line (fi->pc,
|
||||||
fi->next != NULL
|
fi->next != NULL
|
||||||
&& !fi->next->signal_handler_caller
|
&& !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
|
||||||
&& !deprecated_frame_in_dummy (fi->next));
|
&& !deprecated_frame_in_dummy (fi->next));
|
||||||
|
|
||||||
location_print = (source == LOCATION
|
location_print = (source == LOCATION
|
||||||
|
@ -793,7 +793,7 @@ frame_info (char *addr_exp, int from_tty)
|
||||||
|
|
||||||
sal = find_pc_line (fi->pc,
|
sal = find_pc_line (fi->pc,
|
||||||
fi->next != NULL
|
fi->next != NULL
|
||||||
&& !fi->next->signal_handler_caller
|
&& !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
|
||||||
&& !deprecated_frame_in_dummy (fi->next));
|
&& !deprecated_frame_in_dummy (fi->next));
|
||||||
func = get_frame_function (fi);
|
func = get_frame_function (fi);
|
||||||
s = find_pc_symtab (fi->pc);
|
s = find_pc_symtab (fi->pc);
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2002-11-18 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
|
* tuiStack.c (tuiShowFrameInfo): Use get_frame_type instead of
|
||||||
|
signal_handler_caller.
|
||||||
|
|
||||||
2002-11-10 Andrew Cagney <ac131313@redhat.com>
|
2002-11-10 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
* tuiStack.c (tuiShowFrameInfo): Replace frame_in_dummy with
|
* tuiStack.c (tuiShowFrameInfo): Replace frame_in_dummy with
|
||||||
|
|
|
@ -351,7 +351,7 @@ tuiShowFrameInfo (struct frame_info *fi)
|
||||||
|
|
||||||
sal = find_pc_line (fi->pc,
|
sal = find_pc_line (fi->pc,
|
||||||
(fi->next != (struct frame_info *) NULL &&
|
(fi->next != (struct frame_info *) NULL &&
|
||||||
!fi->next->signal_handler_caller &&
|
!(get_frame_type (fi->next) == SIGTRAMP_FRAME) &&
|
||||||
!deprecated_frame_in_dummy (fi->next)));
|
!deprecated_frame_in_dummy (fi->next)));
|
||||||
|
|
||||||
sourceAlreadyDisplayed = sal.symtab != 0
|
sourceAlreadyDisplayed = sal.symtab != 0
|
||||||
|
|
|
@ -186,7 +186,7 @@ vax_sigtramp_saved_pc (struct frame_info *frame)
|
||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
vax_frame_saved_pc (struct frame_info *frame)
|
vax_frame_saved_pc (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return (vax_sigtramp_saved_pc (frame)); /* XXXJRT */
|
return (vax_sigtramp_saved_pc (frame)); /* XXXJRT */
|
||||||
|
|
||||||
return (read_memory_integer (frame->frame + 16, 4));
|
return (read_memory_integer (frame->frame + 16, 4));
|
||||||
|
|
|
@ -125,7 +125,7 @@ x86_64_linux_sigtramp_saved_pc (struct frame_info *frame)
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
x86_64_linux_saved_pc_after_call (struct frame_info *frame)
|
x86_64_linux_saved_pc_after_call (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return x86_64_linux_sigtramp_saved_pc (frame);
|
return x86_64_linux_sigtramp_saved_pc (frame);
|
||||||
|
|
||||||
return read_memory_integer (read_register (SP_REGNUM), 8);
|
return read_memory_integer (read_register (SP_REGNUM), 8);
|
||||||
|
@ -135,7 +135,7 @@ x86_64_linux_saved_pc_after_call (struct frame_info *frame)
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
x86_64_linux_frame_saved_pc (struct frame_info *frame)
|
x86_64_linux_frame_saved_pc (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
if (frame->signal_handler_caller)
|
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
|
||||||
return x86_64_linux_sigtramp_saved_pc (frame);
|
return x86_64_linux_sigtramp_saved_pc (frame);
|
||||||
return cfi_get_ra (frame);
|
return cfi_get_ra (frame);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ x86_64_linux_frame_chain (struct frame_info *fi)
|
||||||
ULONGEST addr;
|
ULONGEST addr;
|
||||||
CORE_ADDR fp, pc;
|
CORE_ADDR fp, pc;
|
||||||
|
|
||||||
if (!fi->signal_handler_caller)
|
if (!(get_frame_type (fi) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
fp = cfi_frame_chain (fi);
|
fp = cfi_frame_chain (fi);
|
||||||
if (fp)
|
if (fp)
|
||||||
|
@ -180,7 +180,7 @@ x86_64_init_frame_pc (int fromleaf, struct frame_info *fi)
|
||||||
{
|
{
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
|
|
||||||
if (fi->next && fi->next->signal_handler_caller)
|
if (fi->next && (get_frame_type (fi->next) == SIGTRAMP_FRAME))
|
||||||
{
|
{
|
||||||
addr = fi->next->next->frame
|
addr = fi->next->next->frame
|
||||||
+ LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
|
+ LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue