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]

[patch/rfc] Deprecate PC_IN_SIGTRAMP


Hello,

Per hints in my last few posts, the architecture methods such as:
	PC_IN_SIGTRAMP
	PC_IN_DUMMY_FRAME
been made obsolete by the frame method:
	get_frame_type
Consequently, this patch deprecates PC_IN_SIGTRAMP.

I should note that architecture code is certainly free to have a local pc_in_sigtramp like function, its just that it isn't needed by core-GDB, and hence doesn't need to be in the architecture vector.

Ref: [wip/rfc] signal trampoline frames
http://sources.redhat.com/ml/gdb-patches/2004-03/msg00353.html
which will provide a simpler way of implementing signal trampolines.

Ref: [patch/rfc] Use frame_type for sigtramp test in infrun.c
http://sources.redhat.com/ml/gdb-patches/2004-03/msg00357.html
which eliminates the last few PC_IN_SIGTRAMP calls (well at least for non-legacy architectures).


comments?

I'll look to commit this in a week,
Andrew
Index: doc/ChangeLog
2004-03-16  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Deprecate
	references to PC_IN_SIGTRAMP.

2004-03-16  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (PC_IN_SIGTRAMP): Change to a function with
	predicate, deprecate.
	* gdbarch.h, gdbarch.c: Re-generate.
	* ppc-linux-tdep.c: Update comment.
	* m68k-tdep.c (m68k_sigtramp_frame_sniffer): Update.
	* infrun.c (pc_in_sigtramp): Update.
	* ia64-tdep.c (ia64_sigtramp_frame_sniffer): Update.
	* i386-tdep.c (i386_sigtramp_frame_sniffer): Update.
	* i386-linux-tdep.c: Update.
	* frv-tdep.c (frv_sigtramp_frame_sniffer): Update.
	* frame.c (frame_type_from_pc, legacy_get_prev_frame): Update.
	* breakpoint.c (bpstat_what): Update.
	* blockframe.c (find_pc_partial_function): Update.
	* arm-tdep.c (arm_sigtramp_unwind_sniffer): Update.
	* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Update.
	* alpha-tdep.c (alpha_sigtramp_frame_sniffer): Update.
	
Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.127
diff -u -r1.127 alpha-tdep.c
--- alpha-tdep.c	16 Feb 2004 21:49:21 -0000	1.127
+++ alpha-tdep.c	16 Mar 2004 21:17:40 -0000
@@ -870,7 +870,7 @@
 
   /* Otherwise we should be in a signal frame.  */
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (PC_IN_SIGTRAMP (pc, name))
+  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
     return &alpha_sigtramp_frame_unwind;
 
   return NULL;
Index: amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.4
diff -u -r1.4 amd64-tdep.c
--- amd64-tdep.c	14 Mar 2004 21:38:55 -0000	1.4
+++ amd64-tdep.c	16 Mar 2004 21:17:40 -0000
@@ -968,7 +968,7 @@
   char *name;
 
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (PC_IN_SIGTRAMP (pc, name))
+  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
     {
       gdb_assert (gdbarch_tdep (current_gdbarch)->sigcontext_addr);
 
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.167
diff -u -r1.167 arm-tdep.c
--- arm-tdep.c	9 Mar 2004 17:08:25 -0000	1.167
+++ arm-tdep.c	16 Mar 2004 21:17:41 -0000
@@ -1144,13 +1144,13 @@
 static const struct frame_unwind *
 arm_sigtramp_unwind_sniffer (struct frame_info *next_frame)
 {
-  /* 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.  */
+  /* Note: If an ARM DEPRECATED_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 DEPRECATED_PC_IN_SIGTRAMP.  */
 
   if (SIGCONTEXT_REGISTER_ADDRESS_P ()
-      && PC_IN_SIGTRAMP (frame_pc_unwind (next_frame), (char *) 0))
+      && DEPRECATED_PC_IN_SIGTRAMP (frame_pc_unwind (next_frame), (char *) 0))
     return &arm_sigtramp_unwind;
 
   return NULL;
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.93
diff -u -r1.93 blockframe.c
--- blockframe.c	16 Mar 2004 20:25:24 -0000	1.93
+++ blockframe.c	16 Mar 2004 21:17:41 -0000
@@ -382,7 +382,8 @@
 
   /* If sigtramp is in the u area, it counts as a function (especially
      important for step_1).  */
-  if (SIGTRAMP_START_P () && PC_IN_SIGTRAMP (mapped_pc, (char *) NULL))
+  if (SIGTRAMP_START_P ()
+      && DEPRECATED_PC_IN_SIGTRAMP (mapped_pc, (char *) NULL))
     {
       cache_pc_function_low = SIGTRAMP_START (mapped_pc);
       cache_pc_function_high = SIGTRAMP_END (mapped_pc);
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.163
diff -u -r1.163 breakpoint.c
--- breakpoint.c	15 Mar 2004 21:58:31 -0000	1.163
+++ breakpoint.c	16 Mar 2004 21:17:44 -0000
@@ -3016,7 +3016,8 @@
 
   /* step_resume entries: a step resume breakpoint overrides another
      breakpoint of signal handling (see comment in wait_for_inferior
-     at first PC_IN_SIGTRAMP where we set the step_resume breakpoint).  */
+     at first DEPRECATED_PC_IN_SIGTRAMP where we set the step_resume
+     breakpoint).  */
   /* We handle the through_sigtramp_breakpoint the same way; having both
      one of those and a step_resume_breakpoint is probably very rare (?).  */
 
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.162
diff -u -r1.162 frame.c
--- frame.c	16 Feb 2004 21:49:21 -0000	1.162
+++ frame.c	16 Mar 2004 21:17:44 -0000
@@ -1163,7 +1163,7 @@
     {
       char *name;
       find_pc_partial_function (pc, &name, NULL, NULL);
-      if (PC_IN_SIGTRAMP (pc, name))
+      if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
 	return SIGTRAMP_FRAME;
       else
 	return NORMAL_FRAME;
@@ -1697,7 +1697,7 @@
 	 22).  */
       char *name;
       find_pc_partial_function (get_frame_pc (prev), &name, NULL, NULL);
-      if (PC_IN_SIGTRAMP (get_frame_pc (prev), name))
+      if (DEPRECATED_PC_IN_SIGTRAMP (get_frame_pc (prev), 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
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.119
diff -u -r1.119 frame.h
--- frame.h	16 Feb 2004 21:49:21 -0000	1.119
+++ frame.h	16 Mar 2004 21:17:45 -0000
@@ -360,7 +360,7 @@
 
 /* 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
+   DEPRECATED_PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and
    DEPRECATED_PC_IN_CALL_DUMMY() indicates a DUMMY_FRAME.  I suspect
    the real problem here is that get_prev_frame() only sets
    initialized after DEPRECATED_INIT_EXTRA_FRAME_INFO as been called.
Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.79
diff -u -r1.79 frv-tdep.c
--- frv-tdep.c	15 Mar 2004 19:42:24 -0000	1.79
+++ frv-tdep.c	16 Mar 2004 21:17:45 -0000
@@ -1448,7 +1448,7 @@
     return NULL;
 
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (PC_IN_SIGTRAMP (pc, name))
+  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
     return &frv_sigtramp_frame_unwind;
 
   return NULL;
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.302
diff -u -r1.302 gdbarch.sh
--- gdbarch.sh	15 Mar 2004 20:38:08 -0000	1.302
+++ gdbarch.sh	16 Mar 2004 21:17:47 -0000
@@ -736,14 +736,17 @@
 # no name, assume we are not in sigtramp).
 #
 # FIXME: cagney/2002-04-21: The function find_pc_partial_function
-# calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
-# This means PC_IN_SIGTRAMP function can't be implemented by doing its
-# own local NAME lookup.
+# calls find_pc_sect_partial_function() which calls
+# DEPRECATED_PC_IN_SIGTRAMP.  This means DEPRECATED_PC_IN_SIGTRAMP
+# function can't be implemented by doing its own local NAME lookup.
 #
-# FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
-# Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
-# does not.
-f:2:PC_IN_SIGTRAMP:int:pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp::0
+# FIXME: cagney/2002-04-21: DEPRECATED_PC_IN_SIGTRAMP is something of
+# a mess.  Some code also depends on SIGTRAMP_START and SIGTRAMP_END
+# but other does not.
+#
+# NOTE: cagney/2004-03-16: DEPRECATED_PC_IN_SIGTRAMP has been made
+# obsolete by signal trampoline frame unwind sniffers.
+F::DEPRECATED_PC_IN_SIGTRAMP:int:deprecated_pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp
 F:2:SIGTRAMP_START:CORE_ADDR:sigtramp_start:CORE_ADDR pc:pc
 F:2:SIGTRAMP_END:CORE_ADDR:sigtramp_end:CORE_ADDR pc:pc
 # A target might have problems with watchpoints as soon as the stack
Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.36
diff -u -r1.36 i386-linux-tdep.c
--- i386-linux-tdep.c	15 Mar 2004 22:38:21 -0000	1.36
+++ i386-linux-tdep.c	16 Mar 2004 21:17:48 -0000
@@ -87,9 +87,9 @@
 
    It kind of sucks that we have to read memory from the process in
    order to identify a signal trampoline, but there doesn't seem to be
-   any other way.  The PC_IN_SIGTRAMP macro in tm-linux.h arranges to
-   only call us if no function name could be identified, which should
-   be the case since the code is on the stack.
+   any other way.  The DEPRECATED_PC_IN_SIGTRAMP macro in tm-linux.h
+   arranges to only call us if no function name could be identified,
+   which should be the case since the code is on the stack.
 
    Detection of signal trampolines for handlers that set the
    SA_RESTORER flag is in general not possible.  Unfortunately this is
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.180
diff -u -r1.180 i386-tdep.c
--- i386-tdep.c	17 Jan 2004 22:45:44 -0000	1.180
+++ i386-tdep.c	16 Mar 2004 21:17:48 -0000
@@ -1019,7 +1019,7 @@
     return NULL;
 
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (PC_IN_SIGTRAMP (pc, name))
+  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
     return &i386_sigtramp_frame_unwind;
 
   return NULL;
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.117
diff -u -r1.117 ia64-tdep.c
--- ia64-tdep.c	24 Feb 2004 22:35:01 -0000	1.117
+++ ia64-tdep.c	16 Mar 2004 21:17:49 -0000
@@ -2048,7 +2048,7 @@
   CORE_ADDR pc = frame_pc_unwind (next_frame);
 
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (PC_IN_SIGTRAMP (pc, name))
+  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
     return &ia64_sigtramp_frame_unwind;
 
   return NULL;
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.140
diff -u -r1.140 infrun.c
--- infrun.c	15 Mar 2004 17:12:50 -0000	1.140
+++ infrun.c	16 Mar 2004 21:17:51 -0000
@@ -1203,8 +1203,8 @@
   inferior_ptid = ecs->ptid;
 }
 
-/* Wrapper for PC_IN_SIGTRAMP that takes care of the need to find the
-   function's name.
+/* Wrapper for DEPRECATED_PC_IN_SIGTRAMP that takes care of the need
+   to find the function's name.
 
    In a classic example of "left hand VS right hand", "infrun.c" was
    trying to improve GDB's performance by caching the result of calls
@@ -1233,7 +1233,7 @@
 {
   char *name;
   find_pc_partial_function (pc, &name, NULL, NULL);
-  return PC_IN_SIGTRAMP (pc, name);
+  return DEPRECATED_PC_IN_SIGTRAMP (pc, name);
 }
 
 /* Handle the inferior event in the cases when we just stepped
Index: m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.80
diff -u -r1.80 m68k-tdep.c
--- m68k-tdep.c	16 Feb 2004 21:49:22 -0000	1.80
+++ m68k-tdep.c	16 Mar 2004 21:17:51 -0000
@@ -839,7 +839,7 @@
     return NULL;
 
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (PC_IN_SIGTRAMP (pc, name))
+  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
     return &m68k_sigtramp_frame_unwind;
 
   return NULL;
Index: ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.51
diff -u -r1.51 ppc-linux-tdep.c
--- ppc-linux-tdep.c	15 Mar 2004 21:35:25 -0000	1.51
+++ ppc-linux-tdep.c	16 Mar 2004 21:17:51 -0000
@@ -112,8 +112,8 @@
 /* Determine if pc is in a signal trampoline...
 
    Ha!  That's not what this does at all.  wait_for_inferior in
-   infrun.c calls PC_IN_SIGTRAMP in order to detect entry into a
-   signal trampoline just after delivery of a signal.  But on
+   infrun.c calls DEPRECATED_PC_IN_SIGTRAMP in order to detect entry
+   into a signal trampoline just after delivery of a signal.  But on
    GNU/Linux, signal trampolines are used for the return path only.
    The kernel sets things up so that the signal handler is called
    directly.
@@ -148,11 +148,11 @@
    first instruction long after the fact, just in case the observed
    behavior is ever fixed.)
 
-   PC_IN_SIGTRAMP is called from blockframe.c as well in order to set
-   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().
+   DEPRECATED_PC_IN_SIGTRAMP is called from blockframe.c as well in
+   order to set 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().
 
    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
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.190
diff -u -r1.190 gdbint.texinfo
--- doc/gdbint.texinfo	26 Feb 2004 20:52:08 -0000	1.190
+++ doc/gdbint.texinfo	16 Mar 2004 21:17:56 -0000
@@ -3636,8 +3636,8 @@
 @findex PCC_SOL_BROKEN
 (Used only in the Convex target.)
 
-@item PC_IN_SIGTRAMP (@var{pc}, @var{name})
-@findex PC_IN_SIGTRAMP
+@item DEPRECATED_PC_IN_SIGTRAMP (@var{pc}, @var{name})
+@findex DEPRECATED_PC_IN_SIGTRAMP
 @cindex sigtramp
 The @dfn{sigtramp} is a routine that the kernel calls (which then calls
 the signal handler).  On most machines it is a library routine that is

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