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 SIGTRAMP_START SIGTRAMP_END


Hello,

The attached deprecates SIGTRAMP_START and SIGTRAMP_END. These were made obsolete by PC_IN_SIGTRAMP (which in turn has been made obsolete by signal trampoline frame sniffers).

Note that blockframe.c:find_pc_partial_function contains what I consider to be broken references to these macros -- typically it is only possible to determine the location of a signal trampoline by doing a detailed analysis of the inferior (i.e., unwinding frames and examining instructions) yet that function is ment to work with just static information. I've added a comment explaining this.

comments?

I'll look to commit this in a week.

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

	* gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): Deprecate.
	* gdbarch.h, gdbarch.c: Re-generate.
	* i386obsd-tdep.c (i386obsd_init_abi): Update.
	* i386nbsd-tdep.c (i386nbsd_init_abi): Update.
	* i386bsd-tdep.c (i386bsd_init_abi): Update.
	* config/vax/tm-vaxbsd.h (DEPRECATED_SIGTRAMP_END) 
	(DEPRECATED_SIGTRAMP_START): Update.
	* config/m68k/tm-nbsd.h (DEPRECATED_SIGTRAMP_END) 
	(DEPRECATED_SIGTRAMP_START): Update.
	* blockframe.c (find_pc_sect_partial_function): Update.
	* arch-utils.c (legacy_pc_in_sigtramp): Update.

Index: doc/ChangeLog
2004-03-16  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Deprecate
	references to SIGTRAMP_START and SIGTRAMP_END.

Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.112
diff -u -r1.112 arch-utils.c
--- arch-utils.c	16 Feb 2004 21:49:21 -0000	1.112
+++ arch-utils.c	16 Mar 2004 20:58:23 -0000
@@ -299,8 +299,9 @@
 legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)
 {
 #if !defined (IN_SIGTRAMP)
-  if (SIGTRAMP_START_P ())
-    return (pc) >= SIGTRAMP_START (pc) && (pc) < SIGTRAMP_END (pc);
+  if (DEPRECATED_SIGTRAMP_START_P ())
+    return ((pc) >= DEPRECATED_SIGTRAMP_START (pc)
+	    && (pc) < DEPRECATED_SIGTRAMP_END (pc));
   else
     return name && strcmp ("_sigtramp", name) == 0;
 #else
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 20:58:23 -0000
@@ -382,10 +382,16 @@
 
   /* 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))
+  /* NOTE: cagney/2004-03-16: Determining if the PC is in a signal
+     trampoline typically depends on the detailed analysis of dynamic
+     information obtained from the inferior yet this function is
+     expected to work using static information obtained from the
+     symbol table.  */
+  if (DEPRECATED_SIGTRAMP_START_P ()
+      && PC_IN_SIGTRAMP (mapped_pc, (char *) NULL))
     {
-      cache_pc_function_low = SIGTRAMP_START (mapped_pc);
-      cache_pc_function_high = SIGTRAMP_END (mapped_pc);
+      cache_pc_function_low = DEPRECATED_SIGTRAMP_START (mapped_pc);
+      cache_pc_function_high = DEPRECATED_SIGTRAMP_END (mapped_pc);
       cache_pc_function_name = "<sigtramp>";
       cache_pc_function_section = section;
       goto return_cached_value;
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 20:58:26 -0000
@@ -739,13 +739,18 @@
 # 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.
-#
+
 # 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.
+# Some code also depends on DEPRECATED_SIGTRAMP_START and
+# DEPRECATED_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
-F:2:SIGTRAMP_START:CORE_ADDR:sigtramp_start:CORE_ADDR pc:pc
-F:2:SIGTRAMP_END:CORE_ADDR:sigtramp_end:CORE_ADDR pc:pc
+
+# NOTE: cagney/2004-03-16: DEPRECATED_SIGTRAMP_START and
+# DEPRECATED_SIGTRAMP_END have been superseeded by signal trampoline
+# frame sniffers.
+F:2:DEPRECATED_SIGTRAMP_START:CORE_ADDR:deprecated_sigtramp_start:CORE_ADDR pc:pc
+F:2:DEPRECATED_SIGTRAMP_END:CORE_ADDR:deprecated_sigtramp_end:CORE_ADDR pc:pc
 # A target might have problems with watchpoints as soon as the stack
 # frame of the current function has been destroyed.  This mostly happens
 # as the first action in a funtion's epilogue.  in_function_epilogue_p()
Index: i386bsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-tdep.c,v
retrieving revision 1.21
diff -u -r1.21 i386bsd-tdep.c
--- i386bsd-tdep.c	5 Mar 2004 21:01:56 -0000	1.21
+++ i386bsd-tdep.c	16 Mar 2004 20:58:26 -0000
@@ -115,8 +115,8 @@
   set_gdbarch_pc_in_sigtramp (gdbarch, i386bsd_pc_in_sigtramp);
 
   /* Allow the recognition of sigtramps as a function named <sigtramp>.  */
-  set_gdbarch_sigtramp_start (gdbarch, i386bsd_sigtramp_start);
-  set_gdbarch_sigtramp_end (gdbarch, i386bsd_sigtramp_end);
+  set_gdbarch_deprecated_sigtramp_start (gdbarch, i386bsd_sigtramp_start);
+  set_gdbarch_deprecated_sigtramp_end (gdbarch, i386bsd_sigtramp_end);
 
   /* Assume SunOS-style shared libraries.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch,
Index: i386nbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386nbsd-tdep.c,v
retrieving revision 1.20
diff -u -r1.20 i386nbsd-tdep.c
--- i386nbsd-tdep.c	5 Mar 2004 20:58:00 -0000	1.20
+++ i386nbsd-tdep.c	16 Mar 2004 20:58:26 -0000
@@ -229,8 +229,8 @@
   /* FIXME: kettenis/20020906: We should probably provide
      NetBSD-specific versions of these functions if we want to
      recognize signal trampolines that live on the stack.  */
-  set_gdbarch_sigtramp_start (gdbarch, NULL);
-  set_gdbarch_sigtramp_end (gdbarch, NULL);
+  set_gdbarch_deprecated_sigtramp_start (gdbarch, NULL);
+  set_gdbarch_deprecated_sigtramp_end (gdbarch, NULL);
 
   /* NetBSD uses -freg-struct-return by default.  */
   tdep->struct_return = reg_struct_return;
Index: i386obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-tdep.c,v
retrieving revision 1.11
diff -u -r1.11 i386obsd-tdep.c
--- i386obsd-tdep.c	5 Mar 2004 20:58:00 -0000	1.11
+++ i386obsd-tdep.c	16 Mar 2004 20:58:26 -0000
@@ -216,8 +216,8 @@
   tdep->sigtramp_start = i386obsd_sigtramp_start_addr;
   tdep->sigtramp_end = i386obsd_sigtramp_end_addr;
   set_gdbarch_pc_in_sigtramp (gdbarch, i386obsd_pc_in_sigtramp);
-  set_gdbarch_sigtramp_start (gdbarch, i386obsd_sigtramp_start);
-  set_gdbarch_sigtramp_end (gdbarch, i386obsd_sigtramp_end);
+  set_gdbarch_deprecated_sigtramp_start (gdbarch, i386obsd_sigtramp_start);
+  set_gdbarch_deprecated_sigtramp_end (gdbarch, i386obsd_sigtramp_end);
 
   /* OpenBSD has a `struct sigcontext' that's different from the
      original 4.3 BSD.  */
Index: config/m68k/tm-nbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/tm-nbsd.h,v
retrieving revision 1.5
diff -u -r1.5 tm-nbsd.h
--- config/m68k/tm-nbsd.h	22 May 2002 03:59:54 -0000	1.5
+++ config/m68k/tm-nbsd.h	16 Mar 2004 20:58:26 -0000
@@ -33,8 +33,8 @@
 #define STACK_END_ADDR USRSTACK
 
 /* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR.  */
-#define SIGTRAMP_START(pc) (STACK_END_ADDR - 32)
-#define SIGTRAMP_END(pc) (STACK_END_ADDR)
+#define DEPRECATED_SIGTRAMP_START(pc) (STACK_END_ADDR - 32)
+#define DEPRECATED_SIGTRAMP_END(pc) (STACK_END_ADDR)
 
 #include "m68k/tm-m68k.h"
 
Index: config/vax/tm-vaxbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/vax/tm-vaxbsd.h,v
retrieving revision 1.3
diff -u -r1.3 tm-vaxbsd.h
--- config/vax/tm-vaxbsd.h	15 Feb 2004 22:14:45 -0000	1.3
+++ config/vax/tm-vaxbsd.h	16 Mar 2004 20:58:26 -0000
@@ -29,7 +29,7 @@
 /* On the VAX, sigtramp is in the u area.  Can't check the exact
    addresses because for cross-debugging we don't have VAX include
    files around.  This should be close enough.  */
-#define SIGTRAMP_START(pc)	STACK_END_ADDR
-#define SIGTRAMP_END(pc)	0x80000000
+#define DEPRECATED_SIGTRAMP_START(pc)	STACK_END_ADDR
+#define DEPRECATED_SIGTRAMP_END(pc)	0x80000000
 
 #endif /* TM_VAXBSD_H */
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 20:58:30 -0000
@@ -3411,10 +3411,10 @@
 the stack frame of the function already has been destroyed up to the
 final `return from function call' instruction.
 
-@item SIGTRAMP_START (@var{pc})
-@findex SIGTRAMP_START
-@itemx SIGTRAMP_END (@var{pc})
-@findex SIGTRAMP_END
+@item DEPRECATED_SIGTRAMP_START (@var{pc})
+@findex DEPRECATED_SIGTRAMP_START
+@itemx DEPRECATED_SIGTRAMP_END (@var{pc})
+@findex DEPRECATED_SIGTRAMP_END
 Define these to be the start and end address of the @code{sigtramp} for the
 given @var{pc}.  On machines where the address is just a compile time
 constant, the macro expansion will typically just ignore the supplied

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