This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch rfc] signal_handler_caller -> get_frame_type()


FYI, I've checked this in. For reference, the final patch is attached (it needed a little updating). One more case of code randomly manipulating a frame, `fixed'.

Andrew

-- Many sections of code want to know the type of a frame. Is it a dummy?  Is it a signal handler trampoline? Is it ...?  At present they use deprecated_frame_is_dummy() and frame->signal_handler_caller.

This patch introduces a new method - get_frame_type() - that returns the frame's `type'.  At present it defines three different frame types:

* normal
* dummy
* sigtramp

All the ->signal_handler_caller tests have been (mindlessly) replaced by (get_frame_type() == SIGTRAMP_FRAME).

Follow-on changes would include replacing deprecated_frame_is_dummy() with (get_frame_type() == DUMMY_FRAME), and even (get_frame_type() == NORMAL_FRAME).


-- Sections of code were tweaking ->signal_handler_caller in the frame init function (instead of waiting for get_prev_frame() to do it for them).

The patch adds the method deprecated_set_frame_type() so that those functions can continue to do the tweak.

The real problem (as the comments point out) is that get_prev_frame() is setting the frame's type very late.  It should initialized much earlier, however that will involve making a call to frame_pc_unwind() (nee, FRAME_SAFED_PC() before FRAME_CHAIN() - knowing how fragile the frame code is, that is pretty scary so I'll be doing it as a separate change.


Comments?  Especially on the word `type'.  Is it going to get confused with the language `type'.

I'll look to commit this later this week.
Andrew



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.
	
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.12
diff -u -r1.12 ada-lang.c
--- ada-lang.c	11 Nov 2002 00:55:34 -0000	1.12
+++ ada-lang.c	18 Nov 2002 22:16:49 -0000
@@ -5032,16 +5032,19 @@
 
   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))
 	{
Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.40
diff -u -r1.40 alpha-tdep.c
--- alpha-tdep.c	14 Nov 2002 00:25:02 -0000	1.40
+++ alpha-tdep.c	18 Nov 2002 22:16:50 -0000
@@ -377,7 +377,7 @@
 #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 @@
     {
       /* 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_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 @@
   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 @@
       && 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 @@
 	  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))
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.75
diff -u -r1.75 arm-tdep.c
--- arm-tdep.c	14 Nov 2002 00:25:02 -0000	1.75
+++ arm-tdep.c	18 Nov 2002 22:16:50 -0000
@@ -1117,19 +1117,24 @@
 	  + 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);
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.50
diff -u -r1.50 blockframe.c
--- blockframe.c	15 Nov 2002 23:24:21 -0000	1.50
+++ blockframe.c	18 Nov 2002 22:16:50 -0000
@@ -210,7 +210,11 @@
      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;
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.14
diff -u -r1.14 breakpoint.h
--- breakpoint.h	10 Nov 2002 15:36:26 -0000	1.14
+++ breakpoint.h	18 Nov 2002 22:16:50 -0000
@@ -532,11 +532,6 @@
    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);
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.26
diff -u -r1.26 cris-tdep.c
--- cris-tdep.c	14 Nov 2002 00:25:02 -0000	1.26
+++ cris-tdep.c	18 Nov 2002 22:16:50 -0000
@@ -392,7 +392,7 @@
 
    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 @@
    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 @@
 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);
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.27
diff -u -r1.27 frame.c
--- frame.c	16 Nov 2002 01:00:06 -0000	1.27
+++ frame.c	18 Nov 2002 22:16:51 -0000
@@ -675,7 +675,7 @@
 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 @@
 
   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 @@
   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 @@
   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 @@
   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;
 }
@@ -956,6 +1005,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
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.34
diff -u -r1.34 frame.h
--- frame.h	16 Nov 2002 01:00:06 -0000	1.34
+++ frame.h	18 Nov 2002 22:16:51 -0000
@@ -93,6 +93,35 @@
    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 @@
        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.
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.33
diff -u -r1.33 hppa-tdep.c
--- hppa-tdep.c	14 Nov 2002 00:25:02 -0000	1.33
+++ hppa-tdep.c	18 Nov 2002 22:16:51 -0000
@@ -891,7 +891,7 @@
 
 #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 @@
          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 @@
          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_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 @@
 	}
 
       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 @@
       /* 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 @@
      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 @@
 
 #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;
Index: i386-interix-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-interix-tdep.c,v
retrieving revision 1.1
diff -u -r1.1 i386-interix-tdep.c
--- i386-interix-tdep.c	1 Nov 2002 22:08:44 -0000	1.1
+++ i386-interix-tdep.c	18 Nov 2002 22:16:51 -0000
@@ -131,16 +131,16 @@
      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 @@
              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 @@
              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 @@
   /* 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);
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.95
diff -u -r1.95 i386-tdep.c
--- i386-tdep.c	16 Nov 2002 01:00:06 -0000	1.95
+++ i386-tdep.c	18 Nov 2002 22:16:52 -0000
@@ -472,17 +472,16 @@
    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 @@
 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 @@
   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 @@
 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 @@
       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 @@
 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);
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.37
diff -u -r1.37 ia64-tdep.c
--- ia64-tdep.c	14 Nov 2002 20:37:28 -0000	1.37
+++ ia64-tdep.c	18 Nov 2002 22:16:52 -0000
@@ -328,9 +328,9 @@
   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 @@
 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 @@
 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 @@
 
       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 @@
   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 @@
       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 @@
 
       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 @@
   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
Index: m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.26
diff -u -r1.26 m68k-tdep.c
--- m68k-tdep.c	14 Nov 2002 20:37:28 -0000	1.26
+++ m68k-tdep.c	18 Nov 2002 22:16:52 -0000
@@ -270,7 +270,7 @@
 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 @@
 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 @@
 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 @@
 {
   /* 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 @@
   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
Index: m68klinux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/m68klinux-nat.c,v
retrieving revision 1.12
diff -u -r1.12 m68klinux-nat.c
--- m68klinux-nat.c	11 Jul 2002 13:50:49 -0000	1.12
+++ m68klinux-nat.c	18 Nov 2002 22:16:52 -0000
@@ -685,7 +685,7 @@
 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);
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.133
diff -u -r1.133 mips-tdep.c
--- mips-tdep.c	14 Nov 2002 00:25:03 -0000	1.133
+++ mips-tdep.c	18 Nov 2002 22:16:53 -0000
@@ -1423,7 +1423,7 @@
 /* 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 @@
 				   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_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 @@
       && 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 @@
 	  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))
Index: ns32k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ns32k-tdep.c,v
retrieving revision 1.20
diff -u -r1.20 ns32k-tdep.c
--- ns32k-tdep.c	15 Nov 2002 23:24:21 -0000	1.20
+++ ns32k-tdep.c	18 Nov 2002 22:16:53 -0000
@@ -342,7 +342,7 @@
 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));
Index: ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.19
diff -u -r1.19 ppc-linux-tdep.c
--- ppc-linux-tdep.c	30 Jul 2002 19:03:49 -0000	1.19
+++ ppc-linux-tdep.c	18 Nov 2002 22:16:53 -0000
@@ -143,10 +143,15 @@
    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 @@
 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 @@
          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 @@
 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 @@
 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);
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.92
diff -u -r1.92 rs6000-tdep.c
--- rs6000-tdep.c	16 Nov 2002 01:00:06 -0000	1.92
+++ rs6000-tdep.c	18 Nov 2002 22:16:53 -0000
@@ -175,7 +175,7 @@
     /* 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 @@
 
   /* 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 @@
   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 @@
 
   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 @@
       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.  */
Index: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.55
diff -u -r1.55 s390-tdep.c
--- s390-tdep.c	16 Nov 2002 01:00:06 -0000	1.55
+++ s390-tdep.c	18 Nov 2002 22:16:53 -0000
@@ -1001,8 +1001,8 @@
 
 
 
-/* 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)
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.44
diff -u -r1.44 sparc-tdep.c
--- sparc-tdep.c	14 Nov 2002 20:37:29 -0000	1.44
+++ sparc-tdep.c	18 Nov 2002 22:16:54 -0000
@@ -314,7 +314,7 @@
       /* 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 @@
   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 @@
     }
   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)))
     {
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.48
diff -u -r1.48 stack.c
--- stack.c	15 Nov 2002 22:16:25 -0000	1.48
+++ stack.c	18 Nov 2002 22:16:54 -0000
@@ -367,7 +367,7 @@
       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 @@
     }
 
   /* 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 @@
 
   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);
Index: vax-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.c,v
retrieving revision 1.21
diff -u -r1.21 vax-tdep.c
--- vax-tdep.c	15 Nov 2002 23:24:21 -0000	1.21
+++ vax-tdep.c	18 Nov 2002 22:16:54 -0000
@@ -186,7 +186,7 @@
 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));
Index: x86-64-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-linux-tdep.c,v
retrieving revision 1.8
diff -u -r1.8 x86-64-linux-tdep.c
--- x86-64-linux-tdep.c	26 Oct 2002 17:04:37 -0000	1.8
+++ x86-64-linux-tdep.c	18 Nov 2002 22:16:54 -0000
@@ -125,7 +125,7 @@
 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 @@
 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 @@
   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 @@
 {
   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;
Index: tui/tuiStack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiStack.c,v
retrieving revision 1.22
diff -u -r1.22 tuiStack.c
--- tui/tuiStack.c	10 Nov 2002 15:36:26 -0000	1.22
+++ tui/tuiStack.c	18 Nov 2002 22:16:54 -0000
@@ -351,7 +351,7 @@
 
       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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]