summaryrefslogtreecommitdiff
path: root/devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h
diff options
context:
space:
mode:
authorMark Peek <mp@FreeBSD.org>2002-06-06 03:56:34 +0000
committerMark Peek <mp@FreeBSD.org>2002-06-06 03:56:34 +0000
commit1d9dc859cd6bfa6e8dc46bc0590c62422234d1fd (patch)
tree13ebe8be581fc3f158aebac9a91bdec7dfe3b08e /devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h
parentReflect reality...this is gdb-5.2, not gdb-5.1. (diff)
- Add support for specifying expressions in add-symbol-file (Nick Hibma)
- Add patches from src/ bits for: - kernel core debugging for i386 - thread debugging for i386 and alpha (Doug Rabson) This patch allows debugging -current kernels compiled with gcc-3.1. Reviewed by: dfr Approved by: obrien
Diffstat (limited to 'devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h')
-rw-r--r--devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h b/devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h
new file mode 100644
index 000000000000..3013085bb6f7
--- /dev/null
+++ b/devel/gdb66/files/patch-gdb_config_i386_tm-fbsd.h
@@ -0,0 +1,80 @@
+--- gdb/config/i386/tm-fbsd.h Sat Jul 28 10:03:38 2001
++++ gdb/config/i386/tm-fbsd.h Mon Jun 3 10:08:22 2002
+@@ -24,6 +24,10 @@
+ #define HAVE_I387_REGS
+ #include "i386/tm-i386.h"
+
++#ifndef _SYS_PARAM_H_
++#include <sys/param.h>
++#endif
++
+ /* FreeBSD/ELF uses stabs-in-ELF with the DWARF register numbering
+ scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
+ messes up the floating-point registers for a.out, but there is not
+@@ -41,38 +45,44 @@
+ /* Support for longjmp. */
+
+ /* Details about jmp_buf. It's supposed to be an array of integers. */
+-
+-#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
+-#define JB_PC 0 /* Array index of saved PC. */
+-
+-/* Figure out where the longjmp will land. Store the address that
+- longjmp will jump to in *ADDR, and return non-zero if successful. */
+-
++#undef NUM_REGS
++#define NUM_REGS 16
+ #define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
+-extern int get_longjmp_target (CORE_ADDR *addr);
+
+
+-/* Support for signal handlers. */
++/* On FreeBSD, sigtramp has size 0x18 and is immediately below the
++ ps_strings struct which has size 0x10 and is at the top of the
++ user stack. */
++
++#undef SIGTRAMP_START
++#undef SIGTRAMP_END
++#define SIGTRAMP_START(pc) 0xbfbfdfd8
++#define SIGTRAMP_END(pc) 0xbfbfdff0
+
+-#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
+-extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
+-
+-/* These defines allow the recognition of sigtramps as a function name
+- <sigtramp>.
+-
+- FIXME: kettenis/2001-07-13: These should be added to the target
+- vector and turned into functions when we go "multi-arch". */
+-
+-#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
+-#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
+ extern CORE_ADDR i386bsd_sigtramp_start;
+ extern CORE_ADDR i386bsd_sigtramp_end;
++extern CORE_ADDR fbsd_kern_frame_saved_pc(struct frame_info *fr);
+
+ /* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
+
+ #undef FRAME_SAVED_PC
+-#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
+-extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
++#if __FreeBSD_version >= 500032
++#define FRAME_SAVED_PC(FRAME) \
++ (kernel_debugging ? fbsd_kern_frame_saved_pc(FRAME) : \
++ (((FRAME)->signal_handler_caller \
++ ? sigtramp_saved_pc (FRAME) \
++ : read_memory_integer ((FRAME)->frame + 4, 4)) \
++ ))
++#else
++#define FRAME_SAVED_PC(FRAME) \
++ (((FRAME)->signal_handler_caller \
++ ? sigtramp_saved_pc (FRAME) \
++ : read_memory_integer ((FRAME)->frame + 4, 4)) \
++ )
++#endif
++
++/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
++#define SIGCONTEXT_PC_OFFSET 20
+
+
+ /* Shared library support. */