From bd064b9335dc38fa5039943c2f43aab94db345cd Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 26 Jan 2004 09:18:47 +0000 Subject: [PATCH] Fix problem where kgdb misses trap frames. Reported by: iedowse --- gnu/usr.bin/binutils/gdb/Makefile | 12 +++++------ gnu/usr.bin/binutils/gdb/fbsd-kgdb-alpha.h | 3 +++ gnu/usr.bin/binutils/gdb/fbsd-kgdb-arm.h | 2 ++ gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h | 22 ++++++-------------- gnu/usr.bin/binutils/gdb/fbsd-kgdb-ia64.h | 2 ++ gnu/usr.bin/binutils/gdb/fbsd-kgdb-powerpc.h | 2 ++ gnu/usr.bin/binutils/gdb/fbsd-kgdb-sparc64.h | 3 +++ 7 files changed, 24 insertions(+), 22 deletions(-) diff --git a/gnu/usr.bin/binutils/gdb/Makefile b/gnu/usr.bin/binutils/gdb/Makefile index 20d3c090577..a7e08787a14 100644 --- a/gnu/usr.bin/binutils/gdb/Makefile +++ b/gnu/usr.bin/binutils/gdb/Makefile @@ -7,6 +7,7 @@ GDBDIR= ${.CURDIR}/../../../../contrib/gdb .PATH: ${GDBDIR}/gdb ${GDBDIR}/gdb/cli ${GDBDIR}/gdb/mi .PATH: ${SRCDIR}/opcodes ${SRCDIR}/binutils +# For FSF GDB files, use their CPU (arch) name; for our files use ours. .if ${TARGET_ARCH} == "sparc64" GDB_CPU= sparc .elif ${TARGET_ARCH} == "amd64" @@ -118,19 +119,18 @@ init.c: ${XSRCS} .PRECIOUS: init.c -nm.h: - echo '#include "${GDB_CPU}/nm-fbsd.h"' >${.TARGET} - echo '#include "fbsd-kgdb.h"' >>${.TARGET} +tm.h: + ln -sf ${.CURDIR}/fbsd-kgdb-${TARGET_ARCH}.h ${.TARGET} -.for H in tm-fbsd xm-${GDB_CPU} +.for H in nm-fbsd xm-${GDB_CPU} ${H:C/-.*$//}.h: ln -sf \ - ${.CURDIR}/../../../../contrib/gdb/gdb/config/${GDB_CPU}/${H}.h \ + ${GDBDIR}/gdb/config/${GDB_CPU}/${H}.h \ ${.TARGET} .endfor GDB_VERSION= "5.2.1 (FreeBSD)" -gdbversion.c: +gdbversion.c: Makefile @echo '#include "version.h"' > ${.TARGET} @echo 'const char version[] = ${GDB_VERSION};' >>${.TARGET} @echo 'const char host_name[] = "${MACHINE_ARCH}-undermydesk-freebsd";' >>${.TARGET} diff --git a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-alpha.h b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-alpha.h index 90dbc146332..6b5cf20a852 100644 --- a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-alpha.h +++ b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-alpha.h @@ -3,6 +3,9 @@ #ifndef FBSD_KGDB_ALPHA_H #define FBSD_KGDB_ALPHA_H +#include "alpha/tm-fbsd.h" +#include "fbsd-kgdb.h" + #undef FRAME_SAVED_PC #define FRAME_SAVED_PC(FRAME) \ (kernel_debugging ? fbsd_kern_frame_saved_pc(FRAME) : \ diff --git a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-arm.h b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-arm.h index 1d7afed7c02..5896125f03c 100644 --- a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-arm.h +++ b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-arm.h @@ -3,4 +3,6 @@ #ifndef FBSD_KGDB_ARM_H #define FBSD_KGDB_ARM_H +#include "fbsd-kgdb.h" + #endif /* FBSD_KGDB_ARM_H */ diff --git a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h index a2d655d2f1b..3196316d83b 100644 --- a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h +++ b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h @@ -3,29 +3,19 @@ #ifndef FBSD_KGDB_I386_H #define FBSD_KGDB_I386_H -/* 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. */ +#include "i386/tm-fbsd.h" +#include "fbsd-kgdb.h" -#undef SIGTRAMP_START -#define SIGTRAMP_START(pc) 0xbfbfdfd8 -#undef SIGTRAMP_END -#define SIGTRAMP_END(pc) 0xbfbfdff0 - - /* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */ - -extern CORE_ADDR fbsd_kern_frame_saved_pc(struct frame_info *fr); - #undef FRAME_SAVED_PC #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)) + ? fbsd_kern_frame_saved_pc (FRAME) \ + : i386bsd_frame_saved_pc (FRAME)) +extern CORE_ADDR fbsd_kern_frame_saved_pc(struct frame_info *fr); /* Offset to saved PC in sigcontext, from . */ +/* DEO:XXX where is this really from??? */ #define SIGCONTEXT_PC_OFFSET 20 #endif /* FBSD_KGDB_I386_H */ diff --git a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-ia64.h b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-ia64.h index 3a795759026..8f198fdfa1b 100644 --- a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-ia64.h +++ b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-ia64.h @@ -3,4 +3,6 @@ #ifndef FBSD_KGDB_IA64_H #define FBSD_KGDB_IA64_H +#include "fbsd-kgdb.h" + #endif /* FBSD_KGDB_IA64_H */ diff --git a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-powerpc.h b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-powerpc.h index 64b2bc7cc8d..c6821e109e5 100644 --- a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-powerpc.h +++ b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-powerpc.h @@ -3,4 +3,6 @@ #ifndef FBSD_KGDB_POWERPC_H #define FBSD_KGDB_POWERPC_H +#include "fbsd-kgdb.h" + #endif /* FBSD_KGDB_POWERPC_H */ diff --git a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-sparc64.h b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-sparc64.h index 4b37697101f..56fd480deff 100644 --- a/gnu/usr.bin/binutils/gdb/fbsd-kgdb-sparc64.h +++ b/gnu/usr.bin/binutils/gdb/fbsd-kgdb-sparc64.h @@ -3,4 +3,7 @@ #ifndef FBSD_KGDB_SPARC64_H #define FBSD_KGDB_SPARC64_H +#include "sparc/tm-fbsd.h" +#include "fbsd-kgdb.h" + #endif /* FBSD_KGDB_SPARC64_H */