This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[obish] Delete SIGTRAMP_PC_OFFSET
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 15 Feb 2004 17:05:18 -0500
- Subject: [obish] Delete SIGTRAMP_PC_OFFSET
Noticed this when checking out PC_IN_SIGTRAMP. Only ns32k and vax make
use of the value and then in architecture specific code. The other
definitions, all in tm*.h files, are doing little :-(
this eliminates all references,
committed,
Andrew
2004-02-15 Andrew Cagney <cagney@redhat.com>
* config/mips/tm-nbsd.h (SIGCONTEXT_PC_OFFSET): Delete macro.
* config/i386/tm-i386bsd.h (SIGCONTEXT_PC_OFFSET): Delete macro.
* config/arm/tm-linux.h (SIGCONTEXT_PC_OFFSET): Delete macro.
* config/vax/tm-vaxbsd.h (SIGCONTEXT_PC_OFFSET): Delete macro.
* vax-tdep.c (vax_sigtramp_saved_pc): Inline only reference.
* config/ns32k/tm-nbsd.h (SIGCONTEXT_PC_OFFSET): Delete macro.
* ns32k-tdep.c (ns32k_sigtramp_saved_pc): Inline only reference.
Index: ns32k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ns32k-tdep.c,v
retrieving revision 1.66
diff -u -r1.66 ns32k-tdep.c
--- ns32k-tdep.c 3 Feb 2004 03:44:26 -0000 1.66
+++ ns32k-tdep.c 15 Feb 2004 22:01:08 -0000
@@ -331,9 +331,10 @@
sigcontext_addr = read_memory_typed_address
(read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr);
- /* Don't cause a memory_error when accessing sigcontext in case the stack
+ /* Offset to saved PC in sigcontext, from <machine/signal.h>. Don't
+ cause a memory_error when accessing sigcontext in case the stack
layout has changed or the stack is corrupt. */
- target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes);
+ target_read_memory (sigcontext_addr + 20, buf, ptrbytes);
return extract_typed_address (buf, builtin_type_void_func_ptr);
}
Index: vax-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.c,v
retrieving revision 1.68
diff -u -r1.68 vax-tdep.c
--- vax-tdep.c 3 Feb 2004 03:44:26 -0000 1.68
+++ vax-tdep.c 15 Feb 2004 22:01:08 -0000
@@ -141,9 +141,10 @@
sigcontext_addr = read_memory_typed_address
(read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr);
- /* Don't cause a memory_error when accessing sigcontext in case the stack
+ /* Offset to saved PC in sigcontext, from <sys/signal.h>. Don't
+ cause a memory_error when accessing sigcontext in case the stack
layout has changed or the stack is corrupt. */
- target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes);
+ target_read_memory (sigcontext_addr + 12, buf, ptrbytes);
return extract_typed_address (buf, builtin_type_void_func_ptr);
}
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.20
diff -u -r1.20 tm-linux.h
--- config/arm/tm-linux.h 15 Nov 2003 14:02:58 -0000 1.20
+++ config/arm/tm-linux.h 15 Feb 2004 22:01:08 -0000
@@ -26,9 +26,6 @@
#include "config/tm-linux.h"
-/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
-#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
-
/* We've multi-arched this. */
#undef IN_SOLIB_CALL_TRAMPOLINE
Index: config/i386/tm-i386bsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386bsd.h,v
retrieving revision 1.2
diff -u -r1.2 tm-i386bsd.h
--- config/i386/tm-i386bsd.h 6 Mar 2001 08:21:29 -0000 1.2
+++ config/i386/tm-i386bsd.h 15 Feb 2004 22:01:08 -0000
@@ -37,9 +37,4 @@
#define SIGTRAMP_START(pc) 0xfdbfdfc0
#define SIGTRAMP_END(pc) 0xfdbfe000
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
-
-/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
-#define SIGCONTEXT_PC_OFFSET 20
-
#endif /* ifndef TM_I386BSD_H */
Index: config/mips/tm-nbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-nbsd.h,v
retrieving revision 1.2
diff -u -r1.2 tm-nbsd.h
--- config/mips/tm-nbsd.h 20 Aug 2002 13:17:55 -0000 1.2
+++ config/mips/tm-nbsd.h 15 Feb 2004 22:01:08 -0000
@@ -22,9 +22,6 @@
#ifndef TM_NBSD_H
#define TM_NBSD_H
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
-#define SIGCONTEXT_PC_OFFSET 8
-
#include "mips/tm-mips.h"
#include "solib.h"
Index: config/ns32k/tm-nbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ns32k/tm-nbsd.h,v
retrieving revision 1.7
diff -u -r1.7 tm-nbsd.h
--- config/ns32k/tm-nbsd.h 27 May 2002 01:05:16 -0000 1.7
+++ config/ns32k/tm-nbsd.h 15 Feb 2004 22:01:08 -0000
@@ -29,9 +29,4 @@
#include "ns32k/tm-ns32k.h"
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
-
-/* Offset to saved PC in sigcontext, from <machine/signal.h>. */
-#define SIGCONTEXT_PC_OFFSET 20
-
#endif /* TM_NBSD_H */
Index: config/vax/tm-vaxbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/vax/tm-vaxbsd.h,v
retrieving revision 1.1
diff -u -r1.1 tm-vaxbsd.h
--- config/vax/tm-vaxbsd.h 26 Jun 2002 17:39:30 -0000 1.1
+++ config/vax/tm-vaxbsd.h 15 Feb 2004 22:01:08 -0000
@@ -34,8 +34,4 @@
#define SIGTRAMP_START(pc) STACK_END_ADDR
#define SIGTRAMP_END(pc) 0x80000000
-/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
-/* XXXJRT should go away */
-#define SIGCONTEXT_PC_OFFSET 12
-
#endif /* TM_VAXBSD_H */