aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog37
-rw-r--r--gdb/ada-lang.c17
-rw-r--r--gdb/alpha-tdep.c18
-rw-r--r--gdb/arm-tdep.c17
-rw-r--r--gdb/blockframe.c6
-rw-r--r--gdb/breakpoint.h5
-rw-r--r--gdb/cris-tdep.c9
-rw-r--r--gdb/frame.c83
-rw-r--r--gdb/frame.h40
-rw-r--r--gdb/hppa-tdep.c16
-rw-r--r--gdb/i386-interix-tdep.c18
-rw-r--r--gdb/i386-tdep.c23
-rw-r--r--gdb/ia64-tdep.c18
-rw-r--r--gdb/m68k-tdep.c12
-rw-r--r--gdb/m68klinux-nat.c2
-rw-r--r--gdb/mips-tdep.c16
-rw-r--r--gdb/ns32k-tdep.c2
-rw-r--r--gdb/ppc-linux-tdep.c25
-rw-r--r--gdb/rs6000-tdep.c12
-rw-r--r--gdb/s390-tdep.c4
-rw-r--r--gdb/sparc-tdep.c6
-rw-r--r--gdb/stack.c16
-rw-r--r--gdb/tui/ChangeLog5
-rw-r--r--gdb/tui/tuiStack.c2
-rw-r--r--gdb/vax-tdep.c2
-rw-r--r--gdb/x86-64-linux-tdep.c8
26 files changed, 286 insertions, 133 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 736ac67..f9231cf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
* Makefile.in (buildsym.o): Add dependency for gdb_assert.h.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1e526eb..c21a325 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5032,16 +5032,19 @@ find_printable_frame (struct frame_info *fi, int level)
for (; fi != NULL; level += 1, fi = get_prev_frame (fi))
{
- /* 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
- containing the call, never the next line. But if the next frame is
- a signal_handler_caller or a dummy frame, then the next frame was
- not entered as the result of a call, and we want to get the line
- containing fi->pc. */
+ /* If fi is not the innermost frame, that normally means that
+ fi->pc points at the return instruction (which is *after* the
+ call instruction), and we want to get the line containing the
+ call (because the call is where the user thinks the program
+ is). However, if the next frame is either a SIGTRAMP_FRAME
+ 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 =
find_pc_line (fi->pc,
fi->next != NULL
- && !fi->next->signal_handler_caller
+ && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
&& !deprecated_frame_in_dummy (fi->next));
if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
{
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 02eca3d..0f1c274 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -377,7 +377,7 @@ alpha_find_saved_regs (struct frame_info *frame)
#define SIGFRAME_REGSAVE_OFF (4 * 8)
#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 8 + 8)
#endif
- if (frame->signal_handler_caller)
+ if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
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
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;
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;
/* We have to get the saved pc from the sigcontext
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;
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);
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);
else
return read_register (pcreg);
@@ -955,7 +955,7 @@ alpha_frame_chain (struct frame_info *frame)
&& PROC_FRAME_OFFSET (proc_desc) == 0
/* The previous frame from a sigtramp frame might be frameless
and have frame size zero. */
- && !frame->signal_handler_caller)
+ && !(get_frame_type (frame) == SIGTRAMP_FRAME))
return alpha_frame_past_sigtramp_frame (frame, saved_pc);
else
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;
/* Do not set the saved registers for a sigtramp frame,
- alpha_find_saved_registers will do that for us.
- We can't use frame->signal_handler_caller, it is not yet set. */
+ alpha_find_saved_registers will do that for us. We can't
+ 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,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
if (!PC_IN_SIGTRAMP (frame->pc, name))
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 2adce63..a7f84ed 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1117,19 +1117,24 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+ fi->next->extra_info->framesize);
/* Determine whether or not we're in a sigtramp frame.
- Unfortunately, it isn't sufficient to test
- fi->signal_handler_caller because this value is sometimes set
- after invoking INIT_EXTRA_FRAME_INFO. So we test *both*
- fi->signal_handler_caller and PC_IN_SIGTRAMP to determine if we
- need to use the sigcontext addresses for the saved registers.
+ Unfortunately, it isn't sufficient to test (get_frame_type (fi)
+ == SIGTRAMP_FRAME) because this value is sometimes set after
+ invoking INIT_EXTRA_FRAME_INFO. So we test *both*
+ (get_frame_type (fi) == SIGTRAMP_FRAME) and PC_IN_SIGTRAMP to
+ 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
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
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 ()
- && (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++)
fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 9a519a4..da88497 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -210,7 +210,11 @@ frame_address_in_block (struct frame_info *frame)
instruction. Unfortunately, this is not straightforward to do, so
we just use the address minus one, which is a good enough
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;
return pc;
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 3abdca7..0b59a0d 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -532,11 +532,6 @@ extern int breakpoint_inserted_here_p (CORE_ADDR);
implements a functional superset of this function. The only reason
it hasn't been removed is because some architectures still don't
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 breakpoint_thread_match (CORE_ADDR, ptid_t);
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 046c08b..d3325f0 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -392,7 +392,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
CORE_ADDR frame
CORE_ADDR pc
- int signal_handler_caller
+ enum frame_type type;
CORE_ADDR return_pc
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
register PC in the next frame.
- The variable signal_handler_caller is non-zero when the frame is
- associated with the call of a signal handler.
+ The variable `type' indicates the frame's type: normal, SIGTRAMP
+ (associated with a signal handler), dummy (associated with a dummy
+ frame).
The variable return_pc contains the address where execution should be
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
cris_frameless_function_invocation (struct frame_info *fi)
{
- if (fi->signal_handler_caller)
+ if ((get_frame_type (fi) == SIGTRAMP_FRAME))
return 0;
else
return frameless_look_for_prologue (fi);
diff --git a/gdb/frame.c b/gdb/frame.c
index cd0c379..616977e 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -675,7 +675,7 @@ struct frame_info *
create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
{
struct frame_info *fi;
- char *name;
+ enum frame_type type;
fi = (struct frame_info *)
obstack_alloc (&frame_cache_obstack,
@@ -686,8 +686,27 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
fi->frame = addr;
fi->pc = pc;
- find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- fi->signal_handler_caller = PC_IN_SIGTRAMP (fi->pc, name);
+ /* NOTE: cagney/2002-11-18: The code segments, found in
+ 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 ())
INIT_EXTRA_FRAME_INFO (0, fi);
@@ -746,7 +765,6 @@ get_prev_frame (struct frame_info *next_frame)
CORE_ADDR address = 0;
struct frame_info *prev;
int fromleaf;
- char *name;
/* Return the inner-most frame, when the caller passes in NULL. */
/* 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->frame = address;
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
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,
&prev->pc_unwind);
- find_pc_partial_function (prev->pc, &name,
- (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (PC_IN_SIGTRAMP (prev->pc, name))
- prev->signal_handler_caller = 1;
+ /* NOTE: cagney/2002-11-18: The code segments, found in
+ 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 (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;
}
@@ -958,6 +1007,24 @@ get_frame_pc (struct frame_info *frame)
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
/* XXX - deprecated. This is a compatibility function for targets
that do not yet implement FRAME_INIT_SAVED_REGS. */
diff --git a/gdb/frame.h b/gdb/frame.h
index 1872f4f..269f11e 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -93,6 +93,35 @@ extern void get_frame_id (struct frame_info *fi, struct frame_id *id);
for an invalid frame). */
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
(up, older) frame is returned. If VALUEP is NULL, don't
fetch/compute the value. Instead just return the location of the
@@ -227,15 +256,8 @@ struct frame_info
moment leave this as speculation. */
int level;
- /* Nonzero if this is a frame associated with calling a signal handler.
-
- 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;
+ /* The frame's type. */
+ enum frame_type type;
/* 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.
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index a3f9561..2c1fac0 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -891,7 +891,7 @@ hppa_frame_saved_pc (struct frame_info *frame)
#ifdef FRAME_SAVED_PC_IN_SIGTRAMP
/* Deal with signal handler caller frames too. */
- if (frame->signal_handler_caller)
+ if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
CORE_ADDR 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
in the registers may not correspond to anything useful). */
if (frame->next
- && (frame->next->signal_handler_caller
+ && ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|| pc_in_interrupt_handler (frame->next->pc)))
{
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. */
if (rp_offset == 0
&& frame->next
- && (frame->next->signal_handler_caller
+ && ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
|| pc_in_interrupt_handler (frame->next->pc)))
{
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,
TARGET_PTR_BIT / 8);
#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);
}
@@ -1215,7 +1215,7 @@ frame_chain (struct frame_info *frame)
}
if (u->Save_SP
- || tmp_frame->signal_handler_caller
+ || (get_frame_type (tmp_frame) == SIGTRAMP_FRAME)
|| pc_in_interrupt_handler (tmp_frame->pc))
break;
@@ -1240,7 +1240,7 @@ frame_chain (struct frame_info *frame)
/* We may have walked down the chain into a function with a frame
pointer. */
if (u->Save_SP
- && !tmp_frame->signal_handler_caller
+ && !(get_frame_type (tmp_frame) == SIGTRAMP_FRAME)
&& !pc_in_interrupt_handler (tmp_frame->pc))
{
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,
then its not valid. */
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))
return 1;
@@ -3888,7 +3888,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
#ifdef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
/* 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);
return;
diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c
index ff310ec..7dce6b0 100644
--- a/gdb/i386-interix-tdep.c
+++ b/gdb/i386-interix-tdep.c
@@ -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
handler caller, this will return valid, which is fine. If not,
it'll make the correct test. */
- return (thisframe->signal_handler_caller
+ return ((get_frame_type (thisframe) == SIGTRAMP_FRAME)
|| (chain != 0
&& !inside_entry_file (read_memory_integer
(thisframe->frame + 4, 4))));
}
-/* We want to find the previous frame, which on Interix is tricky when signals
- are involved; set frame->frame appropriately, and also get the pc
- and tweak signal_handler_caller; this replaces a boatload of nested
- macros, as well. */
+/* We want to find the previous frame, which on Interix is tricky when
+ signals are involved; set frame->frame appropriately, and also get
+ the pc and tweak tye frame's type; this replaces a boatload of
+ nested macros, as well. */
static void
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? */
ra = SAVED_PC_AFTER_CALL (frame);
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,
putting one more return address on the stack. (XP only,
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. */
ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
if (ra >= null_start && ra < null_end)
- frame->signal_handler_caller = 1;
+ deprecated_set_frame_type (frame, SIGTRAMP_FRAME);
}
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);
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
if we're dealing with a signal handler caller (And if that fails,
return 0). */
- if (fi->signal_handler_caller)
+ if ((get_frame_type (fi) == SIGTRAMP_FRAME))
return fi->next ? fi->next->pc : 0;
else
return read_memory_integer (fi->frame + 4, 4);
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 579652f..d1336a0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -472,17 +472,16 @@ i386_get_frame_setup (CORE_ADDR pc)
frame -- that is, the frame which was in progress when the signal
trampoline was entered. GDB mostly treats this frame pointer value
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
- PC_IN_SIGTRAMP.
+ testing for get_frame_type() == SIGTRAMP_FRAME, which is set based
+ on PC_IN_SIGTRAMP.
When a signal trampoline is invoked from a frameless function, we
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
- this case by seeing whether the next frame has
- SIGNAL_HANDLER_CALLER set, and, if it does, checking whether the
- current frame is actually frameless. In this case, we need to get
- the PC by looking at the SP register value stored in the signal
- context.
+ this case by seeing whether the next frame is a SIGTRAMP_FRAME,
+ and, if it does, checking whether the current frame is actually
+ frameless. In this case, we need to get the PC by looking at the
+ SP register value stored in the signal context.
This should work in most cases except in horrible situations where
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
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)
|| 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))
return frame->frame;
- if (frame->signal_handler_caller
+ if (get_frame_type (frame) == SIGTRAMP_FRAME
|| i386_frameless_signal_p (frame))
return frame->frame;
@@ -530,7 +529,7 @@ i386_frame_chain (struct frame_info *frame)
static int
i386_frameless_function_invocation (struct frame_info *frame)
{
- if (frame->signal_handler_caller)
+ if (get_frame_type (frame) == SIGTRAMP_FRAME)
return 0;
return frameless_look_for_prologue (frame);
@@ -575,7 +574,7 @@ i386_frame_saved_pc (struct frame_info *frame)
return pc;
}
- if (frame->signal_handler_caller)
+ if (get_frame_type (frame) == SIGTRAMP_FRAME)
return i386_sigtramp_saved_pc (frame);
if (i386_frameless_signal_p (frame))
@@ -592,7 +591,7 @@ i386_frame_saved_pc (struct frame_info *frame)
static CORE_ADDR
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 read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 59c7c73..eea313b 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -328,9 +328,9 @@ read_sigcontext_register (struct frame_info *frame, int regnum)
if (frame == NULL)
internal_error (__FILE__, __LINE__,
"read_sigcontext_register: NULL frame");
- if (!frame->signal_handler_caller)
+ if (!(get_frame_type (frame) == SIGTRAMP_FRAME))
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)
internal_error (__FILE__, __LINE__,
"read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
@@ -703,7 +703,7 @@ rse_address_add(CORE_ADDR addr, int nslots)
CORE_ADDR
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);
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
return frame->frame;
@@ -720,7 +720,7 @@ ia64_frame_chain (struct frame_info *frame)
CORE_ADDR
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);
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
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])
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);
else /* either frameless, or not far enough along in the prologue... */
return ia64_saved_pc_after_call (frame);
@@ -1163,7 +1163,7 @@ ia64_frame_init_saved_regs (struct frame_info *frame)
if (frame->saved_regs)
return;
- if (frame->signal_handler_caller && SIGCONTEXT_REGISTER_ADDRESS)
+ if ((get_frame_type (frame) == SIGTRAMP_FRAME) && SIGCONTEXT_REGISTER_ADDRESS)
{
int regno;
@@ -1493,7 +1493,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
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);
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)
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);
else if (frn->next
&& 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->sol = (cfm >> 7) & 0x7f;
if (frame->next == 0
- || frame->next->signal_handler_caller
+ || (get_frame_type (frame->next) == SIGTRAMP_FRAME)
|| next_frame_is_call_dummy)
frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof);
else
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index d27d177..250f681 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -270,7 +270,7 @@ m68k_store_return_value (struct type *type, char *valbuf)
static CORE_ADDR
m68k_frame_chain (struct frame_info *thisframe)
{
- if (thisframe->signal_handler_caller)
+ if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
return thisframe->frame;
else if (!inside_entry_file ((thisframe)->pc))
return read_memory_integer ((thisframe)->frame, 4);
@@ -285,7 +285,7 @@ m68k_frame_chain (struct frame_info *thisframe)
static int
m68k_frameless_function_invocation (struct frame_info *fi)
{
- if (fi->signal_handler_caller)
+ if ((get_frame_type (fi) == SIGTRAMP_FRAME))
return 0;
else
return frameless_look_for_prologue (fi);
@@ -294,7 +294,7 @@ m68k_frameless_function_invocation (struct frame_info *fi)
static CORE_ADDR
m68k_frame_saved_pc (struct frame_info *frame)
{
- if (frame->signal_handler_caller)
+ if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
if (frame->next)
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
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;
else if (frameless_look_for_prologue (frame_info))
{
/* 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;
else
return frame_info->frame + 4;
@@ -759,7 +759,7 @@ lose:;
frame_info->saved_regs[PC_REGNUM] = (frame_info)->frame + 4;
#ifdef SIG_SP_FP_OFFSET
/* 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->next->frame + SIG_SP_FP_OFFSET;
#endif
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index add1490..b2d3a6f 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -685,7 +685,7 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame)
CORE_ADDR
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 read_memory_integer (frame->frame + 4, 4);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 739e058..73d06a4 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -1423,7 +1423,7 @@ mips_find_saved_regs (struct frame_info *fci)
/* FIXME! Is this correct?? */
#define SIGFRAME_REG_SIZE MIPS_REGSIZE
#endif
- if (fci->signal_handler_caller)
+ if ((get_frame_type (fci) == SIGTRAMP_FRAME))
{
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.
This assumes that all register saves in a function happen before
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. */
&& !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;
/* We have to get the saved pc from the sigcontext
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);
if (USE_GENERIC_DUMMY_FRAMES
@@ -2451,7 +2451,7 @@ mips_frame_chain (struct frame_info *frame)
&& PROC_FRAME_OFFSET (proc_desc) == 0
/* The previous frame from a sigtramp frame might be frameless
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
register value saved as part of the dummy frame call. */
&& !(USE_GENERIC_DUMMY_FRAMES
@@ -2502,8 +2502,12 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
char *name;
/* Do not set the saved registers for a sigtramp frame,
- mips_find_saved_registers will do that for us.
- We can't use fci->signal_handler_caller, it is not yet set. */
+ mips_find_saved_registers will do that for us. We can't
+ 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,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
if (!PC_IN_SIGTRAMP (fci->pc, name))
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 89bdee9..0a0e8e2 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -342,7 +342,7 @@ ns32k_sigtramp_saved_pc (struct frame_info *frame)
static CORE_ADDR
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 (read_memory_integer (frame->frame + 4, 4));
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 6adfe29..de68702 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -143,10 +143,15 @@ static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc);
behavior is ever fixed.)
PC_IN_SIGTRAMP is called from blockframe.c as well in order to set
- the signal_handler_caller flag. Because of our strange definition
- of in_sigtramp below, we can't rely on signal_handler_caller
+ the frame's type (if a SIGTRAMP_FRAME). Because of our strange
+ 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
- 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
ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
@@ -318,14 +323,14 @@ ppc_linux_skip_trampoline_code (CORE_ADDR pc)
CORE_ADDR
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 =
read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
/* return the NIP in the regs array */
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 =
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
at trampoline code */
if (ppc_linux_at_sigtramp_return_path (fi->pc))
- fi->signal_handler_caller = 1;
+ deprecated_set_frame_type (fi, SIGTRAMP_FRAME);
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
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;
int i;
@@ -405,7 +412,7 @@ CORE_ADDR
ppc_linux_frame_chain (struct frame_info *thisframe)
{
/* 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);
else
return rs6000_frame_chain (thisframe);
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 0c7f389..57de083 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -175,7 +175,7 @@ rs6000_init_extra_frame_info (int fromleaf, struct frame_info *fi)
/* and this is a special signal frame. */
/* (fi->pc will be some low address in the kernel, */
/* 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,
@@ -1477,7 +1477,7 @@ rs6000_frameless_function_invocation (struct frame_info *fi)
/* Don't even think about framelessness except on the innermost frame
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;
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);
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);
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 (fi->next->signal_handler_caller)
+ if ((get_frame_type (fi->next) == SIGTRAMP_FRAME))
return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
wordsize);
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 ())
return 0;
- if (thisframe->signal_handler_caller)
+ if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET,
wordsize);
else if (thisframe->next != NULL
- && thisframe->next->signal_handler_caller
+ && (get_frame_type (thisframe->next) == SIGTRAMP_FRAME)
&& FRAMELESS_FUNCTION_INVOCATION (thisframe))
/* A frameless function interrupted by a signal did not change the
frame pointer. */
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 62e658b..f028ac1 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1001,8 +1001,8 @@ s390_frame_saved_pc (struct frame_info *fi)
-/* We want backtraces out of signal handlers so we don't
- set thisframe->signal_handler_caller to 1 */
+/* We want backtraces out of signal handlers so we don't set
+ (get_frame_type (thisframe) == SIGTRAMP_FRAME) to 1 */
CORE_ADDR
s390_frame_chain (struct frame_info *thisframe)
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index af43c9f..479c82b 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -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
it later. */
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))
&& frameless_look_for_prologue (fi->next))
{
@@ -451,7 +451,7 @@ sparc_frame_saved_pc (struct frame_info *frame)
CORE_ADDR addr;
buf = alloca (MAX_REGISTER_RAW_SIZE);
- if (frame->signal_handler_caller)
+ if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
/* This is the signal trampoline frame.
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 ||
(frame->next != NULL &&
- (frame->next->signal_handler_caller ||
+ ((get_frame_type (frame->next) == SIGTRAMP_FRAME) ||
deprecated_frame_in_dummy (frame->next)) &&
frameless_look_for_prologue (frame)))
{
diff --git a/gdb/stack.c b/gdb/stack.c
index ba7edd5..f98c98e 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -367,7 +367,7 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
annotate_frame_end ();
return;
}
- if (fi->signal_handler_caller)
+ if ((get_frame_type (fi) == SIGTRAMP_FRAME))
{
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
- points to *after* the call instruction, and we want to get the line
- containing the call, never the next line. But if the next frame is
- a signal_handler_caller or a dummy frame, then the next frame was
- not entered as the result of a call, and we want to get the line
- containing fi->pc. */
+ points to *after* the call instruction, and we want to get the
+ line containing the call, never the next line. But if the next
+ frame is a SIGTRAMP_FRAME or a DUMMY_FRAME, then the next frame
+ was not entered as the result of a call, and we want to get the
+ line containing fi->pc. */
sal =
find_pc_line (fi->pc,
fi->next != NULL
- && !fi->next->signal_handler_caller
+ && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
&& !deprecated_frame_in_dummy (fi->next));
location_print = (source == LOCATION
@@ -793,7 +793,7 @@ frame_info (char *addr_exp, int from_tty)
sal = find_pc_line (fi->pc,
fi->next != NULL
- && !fi->next->signal_handler_caller
+ && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
&& !deprecated_frame_in_dummy (fi->next));
func = get_frame_function (fi);
s = find_pc_symtab (fi->pc);
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index df138d0..1217960 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -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>
* tuiStack.c (tuiShowFrameInfo): Replace frame_in_dummy with
diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c
index 506cdab..333d95f 100644
--- a/gdb/tui/tuiStack.c
+++ b/gdb/tui/tuiStack.c
@@ -351,7 +351,7 @@ tuiShowFrameInfo (struct frame_info *fi)
sal = find_pc_line (fi->pc,
(fi->next != (struct frame_info *) NULL &&
- !fi->next->signal_handler_caller &&
+ !(get_frame_type (fi->next) == SIGTRAMP_FRAME) &&
!deprecated_frame_in_dummy (fi->next)));
sourceAlreadyDisplayed = sal.symtab != 0
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index b76c4f8..ad65074 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -186,7 +186,7 @@ vax_sigtramp_saved_pc (struct frame_info *frame)
static CORE_ADDR
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 (read_memory_integer (frame->frame + 16, 4));
diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c
index b8385a6..19ee19c 100644
--- a/gdb/x86-64-linux-tdep.c
+++ b/gdb/x86-64-linux-tdep.c
@@ -125,7 +125,7 @@ x86_64_linux_sigtramp_saved_pc (struct frame_info *frame)
CORE_ADDR
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 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
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 cfi_get_ra (frame);
}
@@ -157,7 +157,7 @@ x86_64_linux_frame_chain (struct frame_info *fi)
ULONGEST addr;
CORE_ADDR fp, pc;
- if (!fi->signal_handler_caller)
+ if (!(get_frame_type (fi) == SIGTRAMP_FRAME))
{
fp = cfi_frame_chain (fi);
if (fp)
@@ -180,7 +180,7 @@ x86_64_init_frame_pc (int fromleaf, struct frame_info *fi)
{
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
+ LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;