aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gdb
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-12-15 17:44:19 +0000
committerEd Maste <emaste@FreeBSD.org>2020-12-15 17:44:19 +0000
commit1c0ea326aa6d30385a69bd1d93ee161cfbe59a5a (patch)
treeafb65135bf39bf16bb6d4021887e58c536105e68 /gnu/usr.bin/gdb
parentb1f99f9cc9787aebc5856786e5199c843679752e (diff)
Notes
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r--gnu/usr.bin/gdb/Makefile7
-rw-r--r--gnu/usr.bin/gdb/Makefile.inc73
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/Makefile24
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/init.c234
-rw-r--r--gnu/usr.bin/gdb/arch/arm/Makefile20
-rw-r--r--gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c552
-rw-r--r--gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c68
-rw-r--r--gnu/usr.bin/gdb/arch/arm/config.h562
-rw-r--r--gnu/usr.bin/gdb/arch/arm/init.c228
-rw-r--r--gnu/usr.bin/gdb/arch/arm/nm-fbsd.h35
-rw-r--r--gnu/usr.bin/gdb/arch/arm/tm-fbsd.h28
-rw-r--r--gnu/usr.bin/gdb/arch/arm/xm-fbsd.h22
-rw-r--r--gnu/usr.bin/gdb/arch/i386/Makefile23
-rw-r--r--gnu/usr.bin/gdb/arch/i386/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/i386/init.c236
-rw-r--r--gnu/usr.bin/gdb/arch/mips/Makefile16
-rw-r--r--gnu/usr.bin/gdb/arch/mips/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/mips/init.c233
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc/Makefile14
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc/init.c230
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc64/Makefile14
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc64/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/powerpc64/init.c230
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/Makefile14
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/config.h550
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/init.c232
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile20
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile.depend25
-rw-r--r--gnu/usr.bin/gdb/gdb/gdb.1376
-rw-r--r--gnu/usr.bin/gdb/gdbserver/Makefile26
-rw-r--r--gnu/usr.bin/gdb/gdbserver/Makefile.depend18
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c213
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c146
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c176
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-low.c1265
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-low.h122
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c156
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-amd64.c99
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-arm.c68
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-i386.c63
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-powerpc.c113
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile16
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile.depend27
-rw-r--r--gnu/usr.bin/gdb/kgdb/kgdb.1150
-rw-r--r--gnu/usr.bin/gdb/kgdb/kgdb.h81
-rw-r--r--gnu/usr.bin/gdb/kgdb/kld.c515
-rw-r--r--gnu/usr.bin/gdb/kgdb/kthr.c252
-rw-r--r--gnu/usr.bin/gdb/kgdb/main.c481
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt.c395
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_amd64.c212
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_arm.c286
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_i386.c418
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_mips.c253
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_powerpc.c214
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c211
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_sparc64.c218
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile80
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile.depend19
-rw-r--r--gnu/usr.bin/gdb/libgdb/fbsd-threads.c1799
61 files changed, 0 insertions, 14908 deletions
diff --git a/gnu/usr.bin/gdb/Makefile b/gnu/usr.bin/gdb/Makefile
deleted file mode 100644
index 114c335fd0fd0..0000000000000
--- a/gnu/usr.bin/gdb/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-SUBDIR= libgdb gdb kgdb
-
-.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/gdb/Makefile.inc b/gnu/usr.bin/gdb/Makefile.inc
deleted file mode 100644
index a668a487d218a..0000000000000
--- a/gnu/usr.bin/gdb/Makefile.inc
+++ /dev/null
@@ -1,73 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-
-WARNS?= 0
-
-VERSION= "6.1.1 [FreeBSD]"
-VENDOR= marcel
-
-PACKAGE= gdb
-
-BMAKE_GDB= ${.CURDIR:H}
-BMAKE_ROOT= ${BMAKE_GDB:H}
-BMAKE_BU= ${BMAKE_ROOT}/binutils
-
-CNTRB_BU= ${SRCTOP}/contrib/binutils
-CNTRB_GDB= ${SRCTOP}/contrib/gdb
-
-OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils
-OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb
-
-# These assignments duplicate much of the functionality of
-# MACHINE_CPUARCH, but there's no easy way to export make functions...
-
-.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}}
-.else
-TARGET_CPUARCH=${MACHINE_CPUARCH}
-.endif
-TARGET_ARCH?= ${MACHINE_ARCH}
-TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_CPUARCH}
-
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-GDB_CROSS_DEBUGGER=
-.endif
-
-.PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \
- ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR}
-
-CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1
-CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\"
-CFLAGS+= -I.
-CFLAGS+= -I${TARGET_SUBDIR}
-CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH}
-CFLAGS+= -I${CNTRB_GDB}/gdb
-CFLAGS+= -I${CNTRB_GDB}/gdb/config
-CFLAGS+= -I${CNTRB_BU}/include
-CFLAGS+= -I${CNTRB_GDB}/include
-CFLAGS+= -I${CNTRB_BU}/bfd
-CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
-
-# Some bits here currently rely on some of the linker-merging magic that happens
-# with -fcommon. While this is the default right now, explicitly set -fcommon
-# so that it continues to build when the default flips.
-CFCOMMONFLAG= -fcommon
-
-GENSRCS+= nm.h tm.h
-
-.if defined(GDB_CROSS_DEBUGGER)
-CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT:H:H}
-GDB_SUFFIX= -${TARGET_ARCH}
-MAN=
-.else
-BINDIR?= /usr/libexec
-MAN=
-.endif
-
-.include "${TARGET_SUBDIR}/Makefile"
-
-SRCS+= ${GENSRCS}
-CLEANFILES+= ${GENSRCS}
-
-.include "../Makefile.inc"
diff --git a/gnu/usr.bin/gdb/arch/amd64/Makefile b/gnu/usr.bin/gdb/arch/amd64/Makefile
deleted file mode 100644
index a43e894e749ce..0000000000000
--- a/gnu/usr.bin/gdb/arch/amd64/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# $FreeBSD$
-
-GENSRCS+= xm.h
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= amd64-nat.c amd64bsd-nat.c amd64fbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= amd64-tdep.c amd64fbsd-tdep.c i386-tdep.c i386bsd-tdep.c \
- i386fbsd-tdep-fixed.c i387-tdep.c
-
-nm.h:
- echo '#include "i386/nm-fbsd64.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "i386/tm-fbsd.h"' > ${.TARGET}
-
-xm.h:
- echo '#include "i386/xm-i386.h"' > ${.TARGET}
-
-# Fix source static/extern mismatch nits that GCC 4.2 warns about.
-CLEANFILES+= i386fbsd-tdep-fixed.c
-i386fbsd-tdep-fixed.c: i386fbsd-tdep.c
- sed -e '48s/^static //' ${.ALLSRC} > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/amd64/config.h b/gnu/usr.bin/gdb/arch/amd64/config.h
deleted file mode 100644
index 6908c793ece99..0000000000000
--- a/gnu/usr.bin/gdb/arch/amd64/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-#define GDB_XM_FILE config/i386/xm-i386.h
-
-/* targetfile */
-#define GDB_TM_FILE config/i386/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/i386/nm-fbsd64.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_i386_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf64_x86_64_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/amd64/init.c b/gnu/usr.bin/gdb/arch/amd64/init.c
deleted file mode 100644
index 1b296f4a94060..0000000000000
--- a/gnu/usr.bin/gdb/arch/amd64/init.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_amd64fbsd_tdep;
-extern initialize_file_ftype _initialize_i386_tdep;
-extern initialize_file_ftype _initialize_i386bsd_tdep;
-extern initialize_file_ftype _initialize_i386fbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_amd64fbsd_nat;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_amd64fbsd_tdep ();
- _initialize_i386_tdep ();
- _initialize_i386bsd_tdep ();
- _initialize_i386fbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_amd64fbsd_nat ();
- _initialize_gcore ();
- _initialize_fbsd_proc ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/Makefile b/gnu/usr.bin/gdb/arch/arm/Makefile
deleted file mode 100644
index 22aee06a7bf4f..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-GENSRCS+= xm.h
-LIBSRCS+= armfbsd-nat.c
-LIBSRCS+= arm-tdep.c armfbsd-tdep.c solib.c solib-svr4.c
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-threads.c
-.endif
-
-nm.h:
-#XXX this should be arm/nm-fbsd.h but won't until it's merged into the gdb repo
- echo '#include "nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
-#XXX this should be arm/tm-fbsd.h
- echo '#include "tm-fbsd.h"' > ${.TARGET}
-
-xm.h:
-#XXX this should be arm/xm-fbsd.h
- echo '#include "xm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c b/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c
deleted file mode 100644
index 674deffaa3f53..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/* $FreeBSD$ */
-
- /* Native-dependent code for BSD Unix running on ARM's, for GDB.
- Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-
-#ifndef FETCH_INFERIOR_REGISTERS
-#ifndef CROSS_DEBUGGER
-#error Not FETCH_INFERIOR_REGISTERS
-#endif
-#endif /* !FETCH_INFERIOR_REGISTERS */
-
-#include "arm-tdep.h"
-
-#include <sys/types.h>
-#ifndef CROSS_DEBUGGER
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-#include <machine/frame.h>
-#endif
-#include "inferior.h"
-#include "regcache.h"
-#include "gdbcore.h"
-
-extern int arm_apcs_32;
-
-#ifdef CROSS_DEBUGGER
-struct reg {
- unsigned int r[13];
- unsigned int r_sp;
- unsigned int r_lr;
- unsigned int r_pc;
- unsigned int r_cpsr;
-};
-
-typedef struct fp_extended_precision {
- u_int32_t fp_exponent;
- u_int32_t fp_mantissa_hi;
- u_int32_t fp_mantissa_lo;
-} fp_extended_precision_t;
-
-typedef struct fp_extended_precision fp_reg_t;
-
-struct fpreg {
- unsigned int fpr_fpsr;
- fp_reg_t fpr[8];
-};
-#endif
-
-void
-supply_gregset (struct reg *gregset)
-{
- int regno;
- CORE_ADDR r_pc;
-
- /* Integer registers. */
- for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
- supply_register (regno, (char *) &gregset->r[regno]);
-
- supply_register (ARM_SP_REGNUM, (char *) &gregset->r_sp);
- supply_register (ARM_LR_REGNUM, (char *) &gregset->r_lr);
- supply_register (ARM_PC_REGNUM, (char *) &gregset->r_pc);
-
- if (arm_apcs_32)
- supply_register (ARM_PS_REGNUM, (char *) &gregset->r_cpsr);
- else
- supply_register (ARM_PS_REGNUM, (char *) &gregset->r_pc);
-}
-
-/* Fill register REGNO (if it is a general-purpose register) in
- *GREGSETPS with the value in GDB's register array. If REGNO is -1,
- do this for all registers. */
-
-void
-fill_gregset (struct reg *gregset, int regno)
-{
- int i;
-
- for (i = ARM_A1_REGNUM; i < ARM_SP_REGNUM; i++)
- if ((regno == -1 || regno == i))
- regcache_collect (i, &gregset->r[i]);
- if (regno == -1 || regno == ARM_SP_REGNUM)
- regcache_collect (ARM_SP_REGNUM, &gregset->r_sp);
- if (regno == -1 || regno == ARM_LR_REGNUM)
- regcache_collect (ARM_LR_REGNUM, &gregset->r_lr);
- if (regno == -1 || regno == ARM_PC_REGNUM)
- regcache_collect (ARM_PC_REGNUM, &gregset->r_pc);
- if (regno == -1 || regno == ARM_PS_REGNUM)
- regcache_collect (ARM_PS_REGNUM, &gregset->r_cpsr);
-}
-
-void
-supply_fpregset (struct fpreg *fparegset)
-{
- int regno;
-
- for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- supply_register
- (regno, (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]);
-
- supply_register (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr);
-}
-
-void
-fill_fpregset (struct fpreg *fparegset, int regno)
-{
- int i;
-
- for (i = ARM_F0_REGNUM; i <= ARM_F7_REGNUM; i++)
- if (regno == -1 || regno == i)
- regcache_raw_supply(current_regcache, i,
- &fparegset->fpr[i - ARM_F0_REGNUM]);
- if (regno == -1 || regno == ARM_FPS_REGNUM)
- regcache_raw_supply(current_regcache, ARM_FPS_REGNUM,
- &fparegset->fpr_fpsr);
-}
-
-static void
-fetch_register (int regno)
-{
- struct reg inferior_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general register");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_SP_REGNUM:
- supply_register (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- break;
-
- case ARM_LR_REGNUM:
- supply_register (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
- break;
-
- case ARM_PC_REGNUM:
- /* This is ok: we're running native... */
- inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
- supply_register (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- break;
-
- case ARM_PS_REGNUM:
- if (arm_apcs_32)
- supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
- else
- supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_pc);
- break;
-
- default:
- supply_register (regno, (char *) &inferior_registers.r[regno]);
- break;
- }
-}
-
-static void
-fetch_regs (void)
-{
- struct reg inferior_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-#endif
- int regno;
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general registers");
- return;
- }
-#endif
-
- supply_gregset (&inferior_registers);
-}
-
-static void
-fetch_fp_register (int regno)
-{
- struct fpreg inferior_fp_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch floating-point register");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_FPS_REGNUM:
- supply_register (ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
- break;
-
- default:
- supply_register
- (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
- break;
- }
-}
-
-static void
-fetch_fp_regs (void)
-{
- struct fpreg inferior_fp_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-#endif
- int regno;
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general registers");
- return;
- }
-#endif
-
- supply_fpregset (&inferior_fp_registers);
-}
-
-void
-fetch_inferior_registers (int regno)
-{
- if (regno >= 0)
- {
- if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
- fetch_register (regno);
- else
- fetch_fp_register (regno);
- }
- else
- {
- fetch_regs ();
- fetch_fp_regs ();
- }
-}
-
-
-static void
-store_register (int regno)
-{
- struct reg inferior_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch general registers");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_SP_REGNUM:
- regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- break;
-
- case ARM_LR_REGNUM:
- regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
- break;
-
- case ARM_PC_REGNUM:
- if (arm_apcs_32)
- regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- else
- {
- unsigned pc_val;
-
- regcache_collect (ARM_PC_REGNUM, (char *) &pc_val);
-
- pc_val = ADDR_BITS_REMOVE (pc_val);
- inferior_registers.r_pc
- ^= ADDR_BITS_REMOVE (inferior_registers.r_pc);
- inferior_registers.r_pc |= pc_val;
- }
- break;
-
- case ARM_PS_REGNUM:
- if (arm_apcs_32)
- regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
- else
- {
- unsigned psr_val;
-
- regcache_collect (ARM_PS_REGNUM, (char *) &psr_val);
-
- psr_val ^= ADDR_BITS_REMOVE (psr_val);
- inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
- inferior_registers.r_pc |= psr_val;
- }
- break;
-
- default:
- regcache_collect (regno, (char *) &inferior_registers.r[regno]);
- break;
- }
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- warning ("unable to write register %d to inferior", regno);
-#endif
-}
-
-static void
-store_regs (void)
-{
- struct reg inferior_registers;
- int ret;
- int regno;
-
-
- for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
- regcache_collect (regno, (char *) &inferior_registers.r[regno]);
-
- regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
-
- if (arm_apcs_32)
- {
- regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
- }
- else
- {
- unsigned pc_val;
- unsigned psr_val;
-
- regcache_collect (ARM_PC_REGNUM, (char *) &pc_val);
- regcache_collect (ARM_PS_REGNUM, (char *) &psr_val);
-
- pc_val = ADDR_BITS_REMOVE (pc_val);
- psr_val ^= ADDR_BITS_REMOVE (psr_val);
-
- inferior_registers.r_pc = pc_val | psr_val;
- }
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-
- if (ret < 0)
- warning ("unable to store general registers");
-#endif
-}
-
-static void
-store_fp_register (int regno)
-{
- struct fpreg inferior_fp_registers;
-#ifndef CROSS_DEBUGGER
- int ret;
-
- ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- {
- warning ("unable to fetch floating-point registers");
- return;
- }
-#endif
-
- switch (regno)
- {
- case ARM_FPS_REGNUM:
- regcache_collect (ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
- break;
-
- default:
- regcache_collect
- (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
- break;
- }
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- warning ("unable to write register %d to inferior", regno);
-#endif
-}
-
-static void
-store_fp_regs (void)
-{
- struct fpreg inferior_fp_registers;
- int ret;
- int regno;
-
-
- for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- regcache_collect
- (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
-
- regcache_collect (ARM_FPS_REGNUM, (char *) &inferior_fp_registers.fpr_fpsr);
-
-#ifndef CROSS_DEBUGGER
- ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-
- if (ret < 0)
- warning ("unable to store floating-point registers");
-#endif
-}
-
-void
-store_inferior_registers (int regno)
-{
- if (regno >= 0)
- {
- if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
- store_register (regno);
- else
- store_fp_register (regno);
- }
- else
- {
- store_regs ();
- store_fp_regs ();
- }
-}
-
-
-struct md_core
-{
- struct reg intreg;
- struct fpreg freg;
-};
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR ignore)
-{
- struct md_core *core_reg = (struct md_core *) core_reg_sect;
- int regno;
- CORE_ADDR r_pc;
-
- supply_gregset (&core_reg->intreg);
- supply_fpregset (&core_reg->freg);
-}
-
-static void
-fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR ignore)
-{
- struct reg gregset;
- struct fpreg fparegset;
-
- switch (which)
- {
- case 0: /* Integer registers. */
- if (core_reg_size != sizeof (struct reg))
- warning ("wrong size of register set in core file");
- else
- {
- /* The memcpy may be unnecessary, but we can't really be sure
- of the alignment of the data in the core file. */
- memcpy (&gregset, core_reg_sect, sizeof (gregset));
- supply_gregset (&gregset);
- }
- break;
-
- case 2:
- if (core_reg_size != sizeof (struct fpreg))
- warning ("wrong size of FPA register set in core file");
- else
- {
- /* The memcpy may be unnecessary, but we can't really be sure
- of the alignment of the data in the core file. */
- memcpy (&fparegset, core_reg_sect, sizeof (fparegset));
- supply_fpregset (&fparegset);
- }
- break;
-
- default:
- /* Don't know what kind of register request this is; just ignore it. */
- break;
- }
-}
-
-static struct core_fns arm_freebsd_core_fns =
-{
- bfd_target_unknown_flavour, /* core_flovour. */
- default_check_format, /* check_format. */
- default_core_sniffer, /* core_sniffer. */
- fetch_core_registers, /* core_read_registers. */
- NULL
-};
-
-static struct core_fns arm_freebsd_elfcore_fns =
-{
- bfd_target_elf_flavour, /* core_flovour. */
- default_check_format, /* check_format. */
- default_core_sniffer, /* core_sniffer. */
- fetch_elfcore_registers, /* core_read_registers. */
- NULL
-};
-
-void
-_initialize_arm_fbsdnat (void)
-{
- add_core_fns (&arm_freebsd_core_fns);
- add_core_fns (&arm_freebsd_elfcore_fns);
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c b/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c
deleted file mode 100644
index 785897dad3449..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $FreeBSD$ */
-
-/* Target-specific functions for ARM running under NetBSD.
- Copyright 2002, 2003 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "osabi.h"
-
-#include "arch-utils.h"
-#include "arm-tdep.h"
-#include "solib-svr4.h"
-
-/* Description of the longjmp buffer. */
-#define ARM_FBSD_JB_PC 24
-#define ARM_FBSD_JB_ELEMENT_SIZE INT_REGISTER_SIZE
-
-static void
-arm_freebsd_init_abi_common (struct gdbarch_info info,
- struct gdbarch *gdbarch)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- tdep->lowest_pc = 0x8000;
-
- tdep->jb_pc = ARM_FBSD_JB_PC;
- tdep->jb_elt_size = ARM_FBSD_JB_ELEMENT_SIZE;
-}
-
-static void
-arm_freebsd_elf_init_abi (struct gdbarch_info info,
- struct gdbarch *gdbarch)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- arm_freebsd_init_abi_common (info, gdbarch);
-
- /* FreeBSD ELF uses SVR4-style shared libraries. */
- set_gdbarch_in_solib_call_trampoline
- (gdbarch, generic_in_solib_call_trampoline);
- set_solib_svr4_fetch_link_map_offsets
- (gdbarch, svr4_ilp32_fetch_link_map_offsets);
-
- tdep->fp_model = ARM_FLOAT_SOFT_VFP;
-}
-
-void
-_initialize_armfbsd_tdep (void)
-{
- gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_FREEBSD_ELF,
- arm_freebsd_elf_init_abi);
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/config.h b/gnu/usr.bin/gdb/arch/arm/config.h
deleted file mode 100644
index 863f2d9c701be..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/config.h
+++ /dev/null
@@ -1,562 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #define HAVE_STRUCT_REG_R_FS 1 */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #define HAVE_STRUCT_REG_R_GS 1 */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-#if 0
-#define GDB_XM_FILE config/arm/xm-fbsd.h
-#else
-#define GDB_XM_FILE xm-fbsd.h
-#endif
-
-/* targetfile */
-#if 0
-#define GDB_TM_FILE config/arm/tm-fbsd.h
-#else
-#define GDB_TM_FILE tm-fbsd.h
-#endif
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#if 0
-#define GDB_NM_FILE config/arm/nm-fbsd.h
-#else
-#define GDB_NM_FILE nm-fbsd.h
-#endif
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_arm_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_littlearm_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/arm/init.c b/gnu/usr.bin/gdb/arch/arm/init.c
deleted file mode 100644
index d4064dadd4ab8..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/init.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_arm_tdep;
-extern initialize_file_ftype _initialize_armfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-#ifndef CROSS_DEBUGGER
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-#endif
-extern initialize_file_ftype _initialize_arm_fbsdnat;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_arm_tdep ();
- _initialize_armfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_thread_db ();
-#endif
- _initialize_arm_fbsdnat ();
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h b/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h
deleted file mode 100644
index 8134b1a5d88c3..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $FreeBSD$ */
-
-/* Native-dependent definitions for ARM running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994, 1999 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef NM_FBSD_H
-#define NM_FBSD_H
-
-/* Type of the third argument to the `ptrace' system call. */
-#define PTRACE_ARG3_TYPE caddr_t
-
-/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* We can attach and detach. */
-#define ATTACH_DETACH
-
-#endif /* NM_FBSD_H */
diff --git a/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h b/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h
deleted file mode 100644
index b010a969acf88..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $FreeBSD$ */
-
-/* Macro definitions for ARM running under NetBSD.
- Copyright 2003 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_FBSD_H
-#define TM_FBSD_H
-
-#include "solib.h"
-
-#endif /* TM_FBSD_H */
diff --git a/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h b/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h
deleted file mode 100644
index 75f8077564c28..0000000000000
--- a/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* $FreeBSD$ */
-
-/* Parameters for execution on an ARM running NetBSD, for GDB.
- Copyright 1994 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
diff --git a/gnu/usr.bin/gdb/arch/i386/Makefile b/gnu/usr.bin/gdb/arch/i386/Makefile
deleted file mode 100644
index 3d96278908272..0000000000000
--- a/gnu/usr.bin/gdb/arch/i386/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# $FreeBSD$
-
-GENSRCS+= xm.h
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= i386-nat.c i386bsd-nat.c i386fbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= i386-tdep.c i386bsd-tdep.c i386fbsd-tdep-fixed.c i387-tdep.c
-
-nm.h:
- echo '#include "i386/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "i386/tm-fbsd.h"' > ${.TARGET}
-
-xm.h:
- echo '#include "i386/xm-i386.h"' > ${.TARGET}
-
-# Fix source static/extern mismatch nits that GCC 4.2 warns about.
-CLEANFILES += i386fbsd-tdep-fixed.c
-i386fbsd-tdep-fixed.c: i386fbsd-tdep.c
- sed -e '48s/^static\ //' ${.ALLSRC} > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/i386/config.h b/gnu/usr.bin/gdb/arch/i386/config.h
deleted file mode 100644
index 3f7f579433d54..0000000000000
--- a/gnu/usr.bin/gdb/arch/i386/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-#define HAVE_STRUCT_REG_R_FS 1
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-#define HAVE_STRUCT_REG_R_GS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-#define HAVE_PT_GETXMMREGS
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-#define GDB_XM_FILE config/i386/xm-i386.h
-
-/* targetfile */
-#define GDB_TM_FILE config/i386/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/i386/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_i386_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_i386_freebsd_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/i386/init.c b/gnu/usr.bin/gdb/arch/i386/init.c
deleted file mode 100644
index 7675d8e688ce9..0000000000000
--- a/gnu/usr.bin/gdb/arch/i386/init.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_i386_tdep;
-extern initialize_file_ftype _initialize_i386bsd_tdep;
-extern initialize_file_ftype _initialize_i386fbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_i386_nat;
-extern initialize_file_ftype _initialize_i386bsd_nat;
-extern initialize_file_ftype _initialize_i386fbsd_nat;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_i386_tdep ();
- _initialize_i386bsd_tdep ();
- _initialize_i386fbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_i386_nat ();
- _initialize_i386bsd_nat ();
- _initialize_i386fbsd_nat ();
- _initialize_gcore ();
- _initialize_fbsd_proc ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/mips/Makefile b/gnu/usr.bin/gdb/arch/mips/Makefile
deleted file mode 100644
index 24e9cfce25e50..0000000000000
--- a/gnu/usr.bin/gdb/arch/mips/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-#
-# XXX Should set DEFAULT_BFD_VEC based on target.
-#
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= mipsfbsd-nat.c fbsd-threads.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c fbsd-proc.c
-
-nm.h:
- echo '#include "mips/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "mips/tm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/mips/config.h b/gnu/usr.bin/gdb/arch/mips/config.h
deleted file mode 100644
index c0b04cc5e5507..0000000000000
--- a/gnu/usr.bin/gdb/arch/mips/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/mips/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/mips/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_mips_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_littlemips_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/mips/init.c b/gnu/usr.bin/gdb/arch/mips/init.c
deleted file mode 100644
index 491b2b3ee3967..0000000000000
--- a/gnu/usr.bin/gdb/arch/mips/init.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_mips_tdep;
-extern initialize_file_ftype _initialize_mipsfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_mipsfbsd_nat;
-extern initialize_file_ftype _initialize_mips_nat;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_svr4_lm;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_mips_tdep ();
- _initialize_mipsfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
-#if 0
- _initialize_mipsfbsd_nat ();
- _initialize_mips_nat ();
-#endif
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_thread_db ();
-#if 0
- _initialize_svr4_lm ();
-#endif
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/powerpc/Makefile b/gnu/usr.bin/gdb/arch/powerpc/Makefile
deleted file mode 100644
index fa41a237d1f7d..0000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= ppcfbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= ppc-sysv-tdep.c ppcfbsd-tdep.c rs6000-tdep.c
-
-nm.h:
- echo '#include "powerpc/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "powerpc/tm-ppc-eabi.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/powerpc/config.h b/gnu/usr.bin/gdb/arch/powerpc/config.h
deleted file mode 100644
index 8686a99d1f569..0000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/powerpc/tm-ppc-eabi.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/powerpc/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_rs6000_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf32_powerpc_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/powerpc/init.c b/gnu/usr.bin/gdb/arch/powerpc/init.c
deleted file mode 100644
index 5b96bd5137a22..0000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc/init.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_rs6000_tdep;
-extern initialize_file_ftype _initialize_ppcfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_ppcfbsd_nat;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_rs6000_tdep ();
- _initialize_ppcfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_fbsd_proc ();
- _initialize_gcore ();
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_ppcfbsd_nat ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/powerpc64/Makefile b/gnu/usr.bin/gdb/arch/powerpc64/Makefile
deleted file mode 100644
index fa41a237d1f7d..0000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc64/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
-LIBSRCS+= ppcfbsd-nat.c
-.endif
-LIBSRCS+= solib.c solib-svr4.c
-LIBSRCS+= ppc-sysv-tdep.c ppcfbsd-tdep.c rs6000-tdep.c
-
-nm.h:
- echo '#include "powerpc/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "powerpc/tm-ppc-eabi.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/powerpc64/config.h b/gnu/usr.bin/gdb/arch/powerpc64/config.h
deleted file mode 100644
index 6ec6560e42005..0000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc64/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/powerpc/tm-ppc-eabi.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/ia64/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_rs6000_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf64_powerpc_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/powerpc64/init.c b/gnu/usr.bin/gdb/arch/powerpc64/init.c
deleted file mode 100644
index 5b96bd5137a22..0000000000000
--- a/gnu/usr.bin/gdb/arch/powerpc64/init.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_rs6000_tdep;
-extern initialize_file_ftype _initialize_ppcfbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_fbsd_proc;
-extern initialize_file_ftype _initialize_gcore;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_ppcfbsd_nat;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_rs6000_tdep ();
- _initialize_ppcfbsd_tdep ();
- _initialize_corelow ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_fbsd_proc ();
- _initialize_gcore ();
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_ppcfbsd_nat ();
- _initialize_thread_db ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/arch/sparc64/Makefile b/gnu/usr.bin/gdb/arch/sparc64/Makefile
deleted file mode 100644
index 9d771727e9029..0000000000000
--- a/gnu/usr.bin/gdb/arch/sparc64/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-.if !defined(GDB_CROSS_DEBUGGER)
-LIBSRCS+= fbsd-threads.c
-LIBSRCS+= solib.c solib-legacy.c solib-svr4.c
-LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c
-.endif
-LIBSRCS+= sparc-tdep.c sparc64-tdep.c sparc64fbsd-tdep.c
-
-nm.h:
- echo '#include "sparc/nm-fbsd.h"' > ${.TARGET}
-
-tm.h:
- echo '#include "sparc/tm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/sparc64/config.h b/gnu/usr.bin/gdb/arch/sparc64/config.h
deleted file mode 100644
index 8bcfdb28c8f5e..0000000000000
--- a/gnu/usr.bin/gdb/arch/sparc64/config.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $FreeBSD$ */
-
-/* config.h. Generated automatically by configure. */
-/* config.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if the `long double' type works. */
-#define HAVE_LONG_DOUBLE 1
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have <vfork.h>. */
-/* #undef HAVE_VFORK_H */
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the `setpgrp' function takes no argument. */
-/* #undef SETPGRP_VOID */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define vfork as fork if vfork does not work. */
-/* #undef vfork */
-
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-/* Define if your struct reg has r_fs. */
-/* #undef HAVE_STRUCT_REG_R_FS */
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-
-/* Define if your struct reg has r_gs. */
-/* #undef HAVE_STRUCT_REG_R_GS */
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``l_'' prefix. (For Solaris, SVR4, and
- SVR4-like systems.) */
-#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
-
-/* Define if <link.h> exists and defines struct link_map which has
- members with an ``lm_'' prefix. (For SunOS.) */
-/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
-
-/* Define if <link.h> exists and defines a struct so_map which has
- members with an ``som_'' prefix. (Found on older *BSD systems.) */
-/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
-
-/* Define if <sys/link.h> has struct link_map32 */
-/* #undef HAVE_STRUCT_LINK_MAP32 */
-
-/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
-/* #undef _SYSCALL32 */
-
-/* Define if the prfpregset_t type is broken. */
-/* #undef PRFPREGSET_T_BROKEN */
-
-/* Define if you want to use new multi-fd /proc interface
- (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
-/* #undef NEW_PROC_API */
-
-/* Define if ioctl argument PIOCSET is available. */
-/* #undef HAVE_PROCFS_PIOCSET */
-
-/* Define if the `long long' type works. */
-#define CC_HAS_LONG_LONG 1
-
-/* Define if the "ll" format works to print long long ints. */
-#define PRINTF_HAS_LONG_LONG 1
-
-/* Define if the "%Lg" format works to print long doubles. */
-#define PRINTF_HAS_LONG_DOUBLE 1
-
-/* Define if the "%Lg" format works to scan long doubles. */
-#define SCANF_HAS_LONG_DOUBLE 1
-
-/* Define if using Solaris thread debugging. */
-/* #undef HAVE_THREAD_DB_LIB */
-
-/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
-/* #undef START_INFERIOR_TRAPS_EXPECTED */
-/* #undef sys_quotactl */
-
-/* Define if you have HPUX threads */
-/* #undef HAVE_HPUX_THREAD_SUPPORT */
-
-/* Define if <proc_service.h> on solaris uses int instead of
- size_t, and assorted other type changes. */
-/* #undef PROC_SERVICE_IS_OLD */
-
-/* Define if the simulator is being linked in. */
-#define WITH_SIM 1
-
-/* Set to true if the save_state_t structure is present */
-/* #undef HAVE_STRUCT_SAVE_STATE_T */
-
-/* Set to true if the save_state_t structure has the ss_wide member */
-/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
-/* #undef HAVE_PTRACE_GETREGS */
-
-/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
-/* #undef HAVE_PTRACE_GETFPXREGS */
-
-/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
-#define HAVE_PT_GETDBREGS 1
-
-/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
-/* #undef HAVE_PT_GETXMMREGS */
-
-/* Define if libunwind library is being used. */
-/* #undef HAVE_LIBUNWIND */
-
-/* hostfile */
-/* #undef GDB_XM_FILE */
-
-/* targetfile */
-#define GDB_TM_FILE config/sparc/tm-fbsd.h
-
-/* nativefile */
-#ifndef CROSS_DEBUGGER
-#define GDB_NM_FILE config/sparc/nm-fbsd.h
-#endif
-
-/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
- around a <sys/proc.h> problem on IRIX 5. */
-#ifndef _KMEMUSER
-/* #undef _KMEMUSER */
-#endif
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the _mcleanup function. */
-#define HAVE__MCLEANUP 1
-
-/* Define if you have the canonicalize_file_name function. */
-/* #undef HAVE_CANONICALIZE_FILE_NAME */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the monstartup function. */
-#define HAVE_MONSTARTUP 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the pread64 function. */
-/* #undef HAVE_PREAD64 */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the realpath function. */
-#define HAVE_REALPATH 1
-
-/* Define if you have the sbrk function. */
-/* #undef HAVE_SBRK */
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setpgid function. */
-#define HAVE_SETPGID 1
-
-/* Define if you have the setpgrp function. */
-#define HAVE_SETPGRP 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the stpcpy function. */
-#define HAVE_STPCPY 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the syscall function. */
-#define HAVE_SYSCALL 1
-
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <curses.h> header file. */
-#define HAVE_CURSES_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <libunwind-ia64.h> header file. */
-/* #undef HAVE_LIBUNWIND_IA64_H */
-
-/* Define if you have the <libunwind.h> header file. */
-/* #undef HAVE_LIBUNWIND_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <link.h> header file. */
-#define HAVE_LINK_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <machine/reg.h> header file. */
-#define HAVE_MACHINE_REG_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ncurses.h> header file. */
-#define HAVE_NCURSES_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <proc_service.h> header file. */
-/* #undef HAVE_PROC_SERVICE_H */
-
-/* Define if you have the <ptrace.h> header file. */
-/* #undef HAVE_PTRACE_H */
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
-/* Define if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/debugreg.h> header file. */
-/* #undef HAVE_SYS_DEBUGREG_H */
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/fault.h> header file. */
-/* #undef HAVE_SYS_FAULT_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/filio.h> header file. */
-#define HAVE_SYS_FILIO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/procfs.h> header file. */
-#define HAVE_SYS_PROCFS_H 1
-
-/* Define if you have the <sys/ptrace.h> header file. */
-#define HAVE_SYS_PTRACE_H 1
-
-/* Define if you have the <sys/reg.h> header file. */
-/* #undef HAVE_SYS_REG_H */
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <term.h> header file. */
-#define HAVE_TERM_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <thread_db.h> header file. */
-/* #undef HAVE_THREAD_DB_H */
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the <wait.h> header file. */
-/* #undef HAVE_WAIT_H */
-
-/* Define if you have the dl library (-ldl). */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the w library (-lw). */
-/* #undef HAVE_LIBW */
-
-/* Define if you have the stpcpy function */
-#define HAVE_STPCPY 1
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define to 1 if NLS is requested */
-/* #undef ENABLE_NLS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Name of this package. */
-#define PACKAGE "gdb"
-
-/* Define to BFD's default architecture. */
-#define DEFAULT_BFD_ARCH bfd_sparc_arch
-
-/* Define to BFD's default target vector. */
-#define DEFAULT_BFD_VEC bfd_elf64_sparc_vec
-
-/* Define to 1 if your system has the _etext variable. */
-#define HAVE__ETEXT 1
-
-/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
- Solaris 2.[78] when using GCC. */
-/* #undef _MSE_INT_H */
-
-/* Define to 1 if we found this declaration otherwise define to 0. */
-#define HAVE_DECL_GETOPT 0
-
-/* Define if sigsetjmp is available. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#define USE_INCLUDED_REGEX 1
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#define HAVE_STRUCT_REG 1
-
-/* Define if <stdint.h> provides the uintptr_t type. */
-#define HAVE_UINTPTR_T 1
-
-/* Define if malloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_MALLOC */
-
-/* Define if realloc is not declared in system header files. */
-/* #undef NEED_DECLARATION_REALLOC */
-
-/* Define if free is not declared in system header files. */
-/* #undef NEED_DECLARATION_FREE */
-
-/* Define if strerror is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRERROR */
-
-/* Define if strdup is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRDUP */
-
-/* Define if strstr is not declared in system header files. */
-/* #undef NEED_DECLARATION_STRSTR */
-
-/* Define if canonicalize_file_name is not declared in system header files. */
-#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-
-/* Define if <sys/procfs.h> has pstatus_t. */
-/* #undef HAVE_PSTATUS_T */
-
-/* Define if <sys/procfs.h> has prrun_t. */
-/* #undef HAVE_PRRUN_T */
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#define HAVE_GREGSET_T 1
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#define HAVE_FPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#define HAVE_PRGREGSET_T 1
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#define HAVE_PRFPREGSET_T 1
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-/* #undef HAVE_PRGREGSET32_T */
-
-/* Define if <sys/procfs.h> has prfpregset32_t. */
-/* #undef HAVE_PRFPREGSET32_T */
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#define HAVE_LWPID_T 1
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#define HAVE_PSADDR_T 1
-
-/* Define if <sys/procfs.h> has prsysent_t. */
-/* #undef HAVE_PRSYSENT_T */
-
-/* Define if <sys/procfs.h> has pr_sigset_t. */
-/* #undef HAVE_PR_SIGSET_T */
-
-/* Define if <sys/procfs.h> has pr_sigaction64_t. */
-/* #undef HAVE_PR_SIGACTION64_T */
-
-/* Define if <sys/procfs.h> has pr_siginfo64_t. */
-/* #undef HAVE_PR_SIGINFO64_T */
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-/* #undef THREAD_DB_HAS_TD_NOTALLOC */
-
-/* Define if we can use the tkill syscall. */
-/* #undef HAVE_TKILL_SYSCALL */
-
-/* Define to the default OS ABI for this configuration. */
-/* #undef GDB_OSABI_DEFAULT */
-
-/* Define to be a string naming the default host character set. */
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define as const if the declaration of iconv() needs const. */
-/* #undef ICONV_CONST */
-
diff --git a/gnu/usr.bin/gdb/arch/sparc64/init.c b/gnu/usr.bin/gdb/arch/sparc64/init.c
deleted file mode 100644
index d2cf24e98079f..0000000000000
--- a/gnu/usr.bin/gdb/arch/sparc64/init.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* $FreeBSD$ */
-
-/* Do not modify this file. */
-/* It is created automatically by the Makefile. */
-#include "defs.h" /* For initialize_file_ftype. */
-#include "call-cmds.h" /* For initialize_all_files. */
-extern initialize_file_ftype _initialize_gdbtypes;
-extern initialize_file_ftype _initialize_sparc_tdep;
-extern initialize_file_ftype _initialize_sparc64fbsd_tdep;
-extern initialize_file_ftype _initialize_corelow;
-extern initialize_file_ftype _initialize_ser_hardwire;
-extern initialize_file_ftype _initialize_ser_pipe;
-extern initialize_file_ftype _initialize_ser_tcp;
-extern initialize_file_ftype _initialize_thread_db;
-extern initialize_file_ftype _initialize_sparc64fbsd_nat;
-extern initialize_file_ftype _initialize_sparc64_nat;
-extern initialize_file_ftype _initialize_sparc_nat;
-extern initialize_file_ftype _initialize_kernel_u_addr;
-extern initialize_file_ftype _initialize_infptrace;
-extern initialize_file_ftype _initialize_inftarg;
-extern initialize_file_ftype _initialize_solib;
-extern initialize_file_ftype _initialize_svr4_solib;
-extern initialize_file_ftype _initialize_svr4_lm;
-extern initialize_file_ftype _initialize_remote;
-extern initialize_file_ftype _initialize_dcache;
-extern initialize_file_ftype _initialize_sr_support;
-extern initialize_file_ftype _initialize_tracepoint;
-extern initialize_file_ftype _initialize_ax_gdb;
-extern initialize_file_ftype _initialize_annotate;
-extern initialize_file_ftype _initialize_auxv;
-extern initialize_file_ftype _initialize_breakpoint;
-extern initialize_file_ftype _initialize_regcache;
-extern initialize_file_ftype _initialize_charset;
-extern initialize_file_ftype _initialize_dummy_frame;
-extern initialize_file_ftype _initialize_source;
-extern initialize_file_ftype _initialize_values;
-extern initialize_file_ftype _initialize_valops;
-extern initialize_file_ftype _initialize_valarith;
-extern initialize_file_ftype _initialize_valprint;
-extern initialize_file_ftype _initialize_printcmd;
-extern initialize_file_ftype _initialize_symtab;
-extern initialize_file_ftype _initialize_symfile;
-extern initialize_file_ftype _initialize_symmisc;
-extern initialize_file_ftype _initialize_infcall;
-extern initialize_file_ftype _initialize_infcmd;
-extern initialize_file_ftype _initialize_infrun;
-extern initialize_file_ftype _initialize_stack;
-extern initialize_file_ftype _initialize_thread;
-extern initialize_file_ftype _initialize_interpreter;
-extern initialize_file_ftype _initialize_macrocmd;
-extern initialize_file_ftype _initialize_gdbarch;
-extern initialize_file_ftype _initialize_gdbarch_utils;
-extern initialize_file_ftype _initialize_gdb_osabi;
-extern initialize_file_ftype _initialize_copying;
-extern initialize_file_ftype _initialize_mem;
-extern initialize_file_ftype _initialize_parse;
-extern initialize_file_ftype _initialize_language;
-extern initialize_file_ftype _initialize_frame_reg;
-extern initialize_file_ftype _initialize_signals;
-extern initialize_file_ftype _initialize_kod;
-extern initialize_file_ftype _initialize_gdb_events;
-extern initialize_file_ftype _initialize_exec;
-extern initialize_file_ftype _initialize_maint_cmds;
-extern initialize_file_ftype _initialize_demangler;
-extern initialize_file_ftype _initialize_dbxread;
-extern initialize_file_ftype _initialize_coffread;
-extern initialize_file_ftype _initialize_elfread;
-extern initialize_file_ftype _initialize_mipsread;
-extern initialize_file_ftype _initialize_stabsread;
-extern initialize_file_ftype _initialize_core;
-extern initialize_file_ftype _initialize_dwarf2_frame;
-extern initialize_file_ftype _initialize_c_language;
-extern initialize_file_ftype _initialize_f_language;
-extern initialize_file_ftype _initialize_objc_language;
-extern initialize_file_ftype _initialize_ui_out;
-extern initialize_file_ftype _initialize_cli_out;
-extern initialize_file_ftype _initialize_varobj;
-extern initialize_file_ftype _initialize_java_language;
-extern initialize_file_ftype _initialize_m2_language;
-extern initialize_file_ftype _initialize_pascal_language;
-extern initialize_file_ftype _initialize_pascal_valprint;
-extern initialize_file_ftype _initialize_scheme_language;
-extern initialize_file_ftype _initialize_complaints;
-extern initialize_file_ftype _initialize_typeprint;
-extern initialize_file_ftype _initialize_cp_valprint;
-extern initialize_file_ftype _initialize_f_valprint;
-extern initialize_file_ftype _initialize_nlmread;
-extern initialize_file_ftype _initialize_serial;
-extern initialize_file_ftype _initialize_mdebugread;
-extern initialize_file_ftype _initialize_user_regs;
-extern initialize_file_ftype _initialize_frame;
-extern initialize_file_ftype _initialize_frame_unwind;
-extern initialize_file_ftype _initialize_frame_base;
-extern initialize_file_ftype _initialize_gnu_v2_abi;
-extern initialize_file_ftype _initialize_gnu_v3_abi;
-extern initialize_file_ftype _initialize_hpacc_abi;
-extern initialize_file_ftype _initialize_cp_abi;
-extern initialize_file_ftype _initialize_cp_support;
-extern initialize_file_ftype _initialize_cp_namespace;
-extern initialize_file_ftype _initialize_reggroup;
-extern initialize_file_ftype _initialize_inflow;
-extern initialize_file_ftype _initialize_cli_dump;
-extern initialize_file_ftype _initialize_cli_logging;
-extern initialize_file_ftype _initialize_cli_interp;
-extern initialize_file_ftype _initialize_mi_out;
-extern initialize_file_ftype _initialize_mi_cmds;
-extern initialize_file_ftype _initialize_mi_cmd_env;
-extern initialize_file_ftype _initialize_mi_interp;
-extern initialize_file_ftype _initialize_mi_main;
-extern initialize_file_ftype _initialize_tui_hooks;
-extern initialize_file_ftype _initialize_tui_interp;
-extern initialize_file_ftype _initialize_tui_layout;
-extern initialize_file_ftype _initialize_tui_out;
-extern initialize_file_ftype _initialize_tui_regs;
-extern initialize_file_ftype _initialize_tui_stack;
-extern initialize_file_ftype _initialize_tui_win;
-void
-initialize_all_files (void)
-{
- _initialize_gdbtypes ();
- _initialize_sparc_tdep ();
- _initialize_sparc64fbsd_tdep ();
- _initialize_corelow ();
- _initialize_ser_hardwire ();
- _initialize_ser_pipe ();
- _initialize_ser_tcp ();
-#ifndef CROSS_DEBUGGER
- _initialize_thread_db ();
- _initialize_sparc64fbsd_nat ();
- _initialize_sparc64_nat ();
- _initialize_sparc_nat ();
- _initialize_kernel_u_addr ();
- _initialize_infptrace ();
- _initialize_inftarg ();
- _initialize_solib ();
- _initialize_svr4_solib ();
- _initialize_svr4_lm ();
-#endif
- _initialize_remote ();
- _initialize_dcache ();
- _initialize_sr_support ();
- _initialize_tracepoint ();
- _initialize_ax_gdb ();
- _initialize_annotate ();
- _initialize_auxv ();
- _initialize_breakpoint ();
- _initialize_regcache ();
- _initialize_charset ();
- _initialize_dummy_frame ();
- _initialize_source ();
- _initialize_values ();
- _initialize_valops ();
- _initialize_valarith ();
- _initialize_valprint ();
- _initialize_printcmd ();
- _initialize_symtab ();
- _initialize_symfile ();
- _initialize_symmisc ();
- _initialize_infcall ();
- _initialize_infcmd ();
- _initialize_infrun ();
- _initialize_stack ();
- _initialize_thread ();
- _initialize_interpreter ();
- _initialize_macrocmd ();
- _initialize_gdbarch ();
- _initialize_gdbarch_utils ();
- _initialize_gdb_osabi ();
- _initialize_copying ();
- _initialize_mem ();
- _initialize_parse ();
- _initialize_language ();
- _initialize_frame_reg ();
- _initialize_signals ();
- _initialize_kod ();
- _initialize_gdb_events ();
- _initialize_exec ();
- _initialize_maint_cmds ();
- _initialize_demangler ();
- _initialize_dbxread ();
- _initialize_coffread ();
- _initialize_elfread ();
- _initialize_mipsread ();
- _initialize_stabsread ();
- _initialize_core ();
- _initialize_dwarf2_frame ();
- _initialize_c_language ();
- _initialize_f_language ();
- _initialize_objc_language ();
- _initialize_ui_out ();
- _initialize_cli_out ();
- _initialize_varobj ();
- _initialize_java_language ();
- _initialize_m2_language ();
- _initialize_pascal_language ();
- _initialize_pascal_valprint ();
- _initialize_scheme_language ();
- _initialize_complaints ();
- _initialize_typeprint ();
- _initialize_cp_valprint ();
- _initialize_f_valprint ();
- _initialize_nlmread ();
- _initialize_serial ();
- _initialize_mdebugread ();
- _initialize_user_regs ();
- _initialize_frame ();
- _initialize_frame_unwind ();
- _initialize_frame_base ();
- _initialize_gnu_v2_abi ();
- _initialize_gnu_v3_abi ();
- _initialize_hpacc_abi ();
- _initialize_cp_abi ();
- _initialize_cp_support ();
- _initialize_cp_namespace ();
- _initialize_reggroup ();
- _initialize_inflow ();
- _initialize_cli_dump ();
- _initialize_cli_logging ();
- _initialize_cli_interp ();
- _initialize_mi_out ();
- _initialize_mi_cmds ();
- _initialize_mi_cmd_env ();
- _initialize_mi_interp ();
- _initialize_mi_main ();
- _initialize_tui_hooks ();
- _initialize_tui_interp ();
- _initialize_tui_layout ();
- _initialize_tui_out ();
- _initialize_tui_regs ();
- _initialize_tui_stack ();
- _initialize_tui_win ();
-}
diff --git a/gnu/usr.bin/gdb/gdb/Makefile b/gnu/usr.bin/gdb/gdb/Makefile
deleted file mode 100644
index 3cf15f6a24a15..0000000000000
--- a/gnu/usr.bin/gdb/gdb/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-PROG= gdb${GDB_SUFFIX}
-SRCS= gdb.c
-
-BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
- ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
- ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a
-
-# libthread_db.so calls back into gdb for the proc services. Make all the
-# global symbols visible.
-LDFLAGS+= -Wl,-E
-
-DPADD= ${GDBLIBS} ${BULIBS}
-LDADD= ${GDBLIBS} ${BULIBS}
-LIBADD+= m edit ncursesw gnuregex
-
-.include <bsd.prog.mk>
-CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\"
diff --git a/gnu/usr.bin/gdb/gdb/Makefile.depend b/gnu/usr.bin/gdb/gdb/Makefile.depend
deleted file mode 100644
index ee6269e741a78..0000000000000
--- a/gnu/usr.bin/gdb/gdb/Makefile.depend
+++ /dev/null
@@ -1,25 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- gnu/lib/libreadline/readline \
- gnu/lib/libregex \
- gnu/usr.bin/binutils/libbfd \
- gnu/usr.bin/binutils/libiberty \
- gnu/usr.bin/binutils/libopcodes \
- gnu/usr.bin/gdb/libgdb \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/msun \
- lib/ncurses/ncursesw \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/gdb/gdb.1 b/gnu/usr.bin/gdb/gdb/gdb.1
deleted file mode 100644
index 635e5c3118820..0000000000000
--- a/gnu/usr.bin/gdb/gdb/gdb.1
+++ /dev/null
@@ -1,376 +0,0 @@
-.\" Copyright (c) 1991 Free Software Foundation
-.\" See section COPYING for conditions for redistribution
-.\" $FreeBSD$
-.TH gdb 1 "4nov1991" "GNU Tools" "GNU Tools"
-.SH NAME
-gdb \- The GNU Debugger
-.SH SYNOPSIS
-.na
-.TP
-.B gdb
-.RB "[\|" \-help "\|]"
-.RB "[\|" \-nx "\|]"
-.RB "[\|" \-q "\|]"
-.RB "[\|" \-batch "\|]"
-.RB "[\|" \-cd=\c
-.I dir\c
-\|]
-.RB "[\|" \-f "\|]"
-.RB "[\|" "\-b\ "\c
-.IR bps "\|]"
-.RB "[\|" "\-tty="\c
-.IR dev "\|]"
-.RB "[\|" "\-s "\c
-.I symfile\c
-\&\|]
-.RB "[\|" "\-e "\c
-.I prog\c
-\&\|]
-.RB "[\|" "\-se "\c
-.I prog\c
-\&\|]
-.RB "[\|" "\-c "\c
-.I core\c
-\&\|]
-.RB "[\|" "\-x "\c
-.I cmds\c
-\&\|]
-.RB "[\|" "\-d "\c
-.I dir\c
-\&\|]
-.RB "[\|" \c
-.I prog\c
-.RB "[\|" \c
-.IR core \||\| procID\c
-\&\|]\&\|]
-.ad b
-.SH DEPRECATION NOTICE
-This version of gdb is deprecated and will be removed from future versions
-of the FreeBSD base system.
-A newer version of gdb is available from ports or packages
-(devel/gdb).
-.SH DESCRIPTION
-The purpose of a debugger such as GDB is to allow you to see what is
-going on ``inside'' another program while it executes\(em\&or what another
-program was doing at the moment it crashed.
-
-GDB can do four main kinds of things (plus other things in support of
-these) to help you catch bugs in the act:
-
-.TP
-\ \ \ \(bu
-Start your program, specifying anything that might affect its behavior.
-
-.TP
-\ \ \ \(bu
-Make your program stop on specified conditions.
-
-.TP
-\ \ \ \(bu
-Examine what has happened, when your program has stopped.
-
-.TP
-\ \ \ \(bu
-Change things in your program, so you can experiment with correcting the
-effects of one bug and go on to learn about another.
-.PP
-
-You can use GDB to debug programs written in C, C++, and Modula-2.
-Fortran support will be added when a GNU Fortran compiler is ready.
-
-GDB is invoked with the shell command \c
-.B gdb\c
-\&. Once started, it reads
-commands from the terminal until you tell it to exit with the GDB
-command \c
-.B quit\c
-\&. You can get online help from \c
-.B gdb\c
-\& itself
-by using the command \c
-.B help\c
-\&.
-
-You can run \c
-.B gdb\c
-\& with no arguments or options; but the most
-usual way to start GDB is with one argument or two, specifying an
-executable program as the argument:
-.sp
-.br
-gdb\ program
-.br
-.sp
-
-You can also start with both an executable program and a core file specified:
-.sp
-.br
-gdb\ program\ core
-.br
-.sp
-
-You can, instead, specify a process ID as a second argument, if you want
-to debug a running process:
-.sp
-.br
-gdb\ program\ 1234
-.br
-.sp
-
-would attach GDB to process \c
-.B 1234\c
-\& (unless you also have a file
-named `\|\c
-.B 1234\c
-\&\|'; GDB does check for a core file first).
-
-Here are some of the most frequently needed GDB commands:
-.TP
-.B break \fR[\|\fIfile\fB:\fR\|]\fIfunction
-\&
-Set a breakpoint at \c
-.I function\c
-\& (in \c
-.I file\c
-\&).
-.TP
-.B run \fR[\|\fIarglist\fR\|]
-Start your program (with \c
-.I arglist\c
-\&, if specified).
-.TP
-.B bt
-Backtrace: display the program stack.
-.TP
-.BI print " expr"\c
-\&
-Display the value of an expression.
-.TP
-.B c
-Continue running your program (after stopping, e.g. at a breakpoint).
-.TP
-.B next
-Execute next program line (after stopping); step \c
-.I over\c
-\& any
-function calls in the line.
-.TP
-.B step
-Execute next program line (after stopping); step \c
-.I into\c
-\& any
-function calls in the line.
-.TP
-.B help \fR[\|\fIname\fR\|]
-Show information about GDB command \c
-.I name\c
-\&, or general information
-about using GDB.
-.TP
-.B quit
-Exit from GDB.
-.PP
-For full details on GDB, see \c
-.I
-Using GDB: A Guide to the GNU Source-Level Debugger\c
-\&, by Richard M. Stallman and Roland H. Pesch. The same text is available online
-as the \c
-.B gdb\c
-\& entry in the \c
-.B info\c
-\& program.
-.SH OPTIONS
-Any arguments other than options specify an executable
-file and core file (or process ID); that is, the first argument
-encountered with no
-associated option flag is equivalent to a `\|\c
-.B \-se\c
-\&\|' option, and the
-second, if any, is equivalent to a `\|\c
-.B \-c\c
-\&\|' option if it's the name of a file. Many options have
-both long and short forms; both are shown here. The long forms are also
-recognized if you truncate them, so long as enough of the option is
-present to be unambiguous. (If you prefer, you can flag option
-arguments with `\|\c
-.B +\c
-\&\|' rather than `\|\c
-.B \-\c
-\&\|', though we illustrate the
-more usual convention.)
-
-All the options and command line arguments you give are processed
-in sequential order. The order makes a difference when the
-`\|\c
-.B \-x\c
-\&\|' option is used.
-
-.TP
-.B \-help
-.TP
-.B \-h
-List all options, with brief explanations.
-
-.TP
-.BI "\-symbols=" "file"\c
-.TP
-.BI "\-s " "file"\c
-\&
-Read symbol table from file \c
-.I file\c
-\&.
-
-.TP
-.BI "\-exec=" "file"\c
-.TP
-.BI "\-e " "file"\c
-\&
-Use file \c
-.I file\c
-\& as the executable file to execute when
-appropriate, and for examining pure data in conjunction with a core
-dump.
-
-.TP
-.BI "\-se=" "file"\c
-\&
-Read symbol table from file \c
-.I file\c
-\& and use it as the executable
-file.
-
-.TP
-.BI "\-core=" "file"\c
-.TP
-.BI "\-c " "file"\c
-\&
-Use file \c
-.I file\c
-\& as a core dump to examine.
-
-.TP
-.BI "\-command=" "file"\c
-.TP
-.BI "\-x " "file"\c
-\&
-Execute GDB commands from file \c
-.I file\c
-\&.
-
-.TP
-.BI "\-directory=" "directory"\c
-.TP
-.BI "\-d " "directory"\c
-\&
-Add \c
-.I directory\c
-\& to the path to search for source files.
-.PP
-
-.TP
-.B \-nx
-.TP
-.B \-n
-Do not execute commands from any `\|\c
-.B .gdbinit\c
-\&\|' initialization files.
-Normally, the commands in these files are executed after all the
-command options and arguments have been processed.
-
-
-.TP
-.B \-quiet
-.TP
-.B \-q
-``Quiet''. Do not print the introductory and copyright messages. These
-messages are also suppressed in batch mode.
-
-.TP
-.B \-batch
-Run in batch mode. Exit with status \c
-.B 0\c
-\& after processing all the command
-files specified with `\|\c
-.B \-x\c
-\&\|' (and `\|\c
-.B .gdbinit\c
-\&\|', if not inhibited).
-Exit with nonzero status if an error occurs in executing the GDB
-commands in the command files.
-
-Batch mode may be useful for running GDB as a filter, for example to
-download and run a program on another computer; in order to make this
-more useful, the message
-.sp
-.br
-Program\ exited\ normally.
-.br
-.sp
-
-(which is ordinarily issued whenever a program running under GDB control
-terminates) is not issued when running in batch mode.
-
-.TP
-.BI "\-cd=" "directory"\c
-\&
-Run GDB using \c
-.I directory\c
-\& as its working directory,
-instead of the current directory.
-
-.TP
-.B \-fullname
-.TP
-.B \-f
-Emacs sets this option when it runs GDB as a subprocess. It tells GDB
-to output the full file name and line number in a standard,
-recognizable fashion each time a stack frame is displayed (which
-includes each time the program stops). This recognizable format looks
-like two `\|\c
-.B \e032\c
-\&\|' characters, followed by the file name, line number
-and character position separated by colons, and a newline. The
-Emacs-to-GDB interface program uses the two `\|\c
-.B \e032\c
-\&\|' characters as
-a signal to display the source code for the frame.
-
-.TP
-.BI "\-b " "bps"\c
-\&
-Set the line speed (baud rate or bits per second) of any serial
-interface used by GDB for remote debugging.
-
-.TP
-.BI "\-tty=" "device"\c
-\&
-Run using \c
-.I device\c
-\& for your program's standard input and output.
-.PP
-
-.SH "SEE ALSO"
-.RB "`\|" gdb "\|'"
-entry in
-.B info\c
-\&;
-.I
-Using GDB: A Guide to the GNU Source-Level Debugger\c
-, Richard M. Stallman and Roland H. Pesch, July 1991.
-.SH COPYING
-Copyright (c) 1991 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile b/gnu/usr.bin/gdb/gdbserver/Makefile
deleted file mode 100644
index fa46e6de14faa..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# $FreeBSD$
-
-# Not elf specific so don't install in /usr/libexec/elf
-BINDIR=/usr/bin
-
-GDBDIR= ${SRCTOP}/contrib/gdb
-.PATH: ${GDBDIR}/gdb/signals
-.PATH: ${GDBDIR}/gdb/gdbserver
-.PATH: ${GDBDIR}/gdb
-
-PROG= gdbserver
-
-SRCS= inferiors.c mem-break.c regcache.c remote-utils.c \
- server.c signals.c target.c utils.c
-SRCS+= fbsd-low.c
-
-SRCS+= fbsd-${MACHINE_CPUARCH}-low.c reg-${MACHINE_CPUARCH}.c
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-SRCS+= i387-fp.c
-.endif
-#CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH}
-CFLAGS+= -I${GDBDIR}/gdb/gdbserver
-CFLAGS+= -I${GDBDIR}/gdb/regformats
-CFLAGS+= -DNO_MMALLOC -DGDBSERVER
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile.depend b/gnu/usr.bin/gdb/gdbserver/Makefile.depend
deleted file mode 100644
index d5ed563ecfc8a..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/Makefile.depend
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- include \
- include/arpa \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c
deleted file mode 100644
index 82a8c93f3dfb3..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* GNU/FreeBSD/amd64 specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-#include "i387-fp.h"
-
-#include <sys/stddef.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-/* Mapping between the general-purpose registers in `struct user'
- format and GDB's register array layout. */
-static int amd64_regmap[] = {
- offsetof(struct reg, r_rax),
- offsetof(struct reg, r_rbx),
- offsetof(struct reg, r_rcx),
- offsetof(struct reg, r_rdx),
- offsetof(struct reg, r_rsi),
- offsetof(struct reg, r_rdi),
- offsetof(struct reg, r_rbp),
- offsetof(struct reg, r_rsp),
- offsetof(struct reg, r_r8),
- offsetof(struct reg, r_r9),
- offsetof(struct reg, r_r10),
- offsetof(struct reg, r_r11),
- offsetof(struct reg, r_r12),
- offsetof(struct reg, r_r13),
- offsetof(struct reg, r_r14),
- offsetof(struct reg, r_r15),
- offsetof(struct reg, r_rip),
- offsetof(struct reg, r_rflags), /* XXX 64-bit */
- offsetof(struct reg, r_cs),
- offsetof(struct reg, r_ss),
- offsetof(struct reg, r_ds),
- offsetof(struct reg, r_es),
- offsetof(struct reg, r_fs),
- offsetof(struct reg, r_gs),
-};
-#define AMD64_NUM_REGS (sizeof(amd64_regmap) / sizeof(amd64_regmap[0]))
-
-static const char amd64_breakpoint[] = { 0xCC };
-#define AMD64_BP_LEN 1
-
-extern int debug_threads;
-
-static int
-amd64_cannot_store_register(int regno)
-{
-
- return (regno >= AMD64_NUM_REGS);
-}
-
-static int
-amd64_cannot_fetch_register(int regno)
-{
-
- return (regno >= AMD64_NUM_REGS);
-}
-
-static void
-amd64_fill_gregset(void *buf)
-{
- int i;
-
- for (i = 0; i < AMD64_NUM_REGS; i++)
- collect_register(i, ((char *)buf) + amd64_regmap[i]);
-}
-
-static void
-amd64_store_gregset(const void *buf)
-{
- int i;
-
- for (i = 0; i < AMD64_NUM_REGS; i++)
- supply_register(i, ((char *)buf) + amd64_regmap[i]);
-}
-
-static void
-amd64_fill_fpregset(void *buf)
-{
-
- i387_cache_to_fsave(buf);
-}
-
-static void
-amd64_store_fpregset(const void *buf)
-{
-
- i387_fsave_to_cache(buf);
-}
-
-static void
-amd64_fill_fpxregset(void *buf)
-{
-
- i387_cache_to_fxsave(buf);
-}
-
-static void
-amd64_store_fpxregset(const void *buf)
-{
-
- i387_fxsave_to_cache(buf);
-}
-
-
-struct regset_info target_regsets[] = {
- {
- PT_GETREGS,
- PT_SETREGS,
- sizeof(struct reg),
- GENERAL_REGS,
- amd64_fill_gregset,
- amd64_store_gregset,
- },
-#ifdef HAVE_PTRACE_GETFPXREGS
- {
- PTRACE_GETFPXREGS,
- PTRACE_SETFPXREGS,
- sizeof(elf_fpxregset_t),
- EXTENDED_REGS,
- amd64_fill_fpxregset,
- amd64_store_fpxregset,
- },
-#endif
- {
- PT_GETFPREGS,
- PT_SETFPREGS,
- sizeof(struct fpreg),
- FP_REGS,
- amd64_fill_fpregset,
- amd64_store_fpregset,
- },
- {
- 0,
- 0,
- -1,
- -1,
- NULL,
- NULL,
- }
-};
-
-static CORE_ADDR
-amd64_get_pc(void)
-{
- unsigned long pc;
-
- collect_register_by_name("rip", &pc);
-
- if (debug_threads)
- fprintf(stderr, "stop pc (before any decrement) is %016lx\n", pc);
-
- return (pc);
-}
-
-static void
-amd64_set_pc(CORE_ADDR newpc)
-{
-
- if (debug_threads)
- fprintf(stderr, "set pc to %016lx\n", (long)newpc);
- supply_register_by_name("rip", &newpc);
-}
-
-static int
-amd64_breakpoint_at(CORE_ADDR pc)
-{
- unsigned char c;
-
- read_inferior_memory(pc, &c, 1);
- if (c == 0xCC)
- return (1);
-
- return (0);
-}
-
-struct fbsd_target_ops the_low_target = {
- AMD64_NUM_REGS,
- amd64_regmap,
- amd64_cannot_fetch_register,
- amd64_cannot_store_register,
- amd64_get_pc,
- amd64_set_pc,
- amd64_breakpoint,
- AMD64_BP_LEN,
- NULL,
- 1,
- amd64_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c
deleted file mode 100644
index faea705f94ff7..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-arm-low.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* FreeBSD/ARM specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#endif
-
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-
-#define arm_num_regs 26
-
-static int arm_regmap[] = {
- 0, 4, 8, 12, 16, 20, 24, 28,
- 32, 36, 40, 44, 48, 52, 56, 60,
- -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 64
-};
-
-static int
-arm_cannot_store_register (int regno)
-{
- return (regno >= arm_num_regs);
-}
-
-static int
-arm_cannot_fetch_register (int regno)
-{
- return (regno >= arm_num_regs);
-}
-
-extern int debug_threads;
-
-static CORE_ADDR
-arm_get_pc ()
-{
- unsigned long pc;
- collect_register_by_name ("pc", &pc);
- if (debug_threads)
- fprintf (stderr, "stop pc is %08lx\n", pc);
- return pc;
-}
-
-static void
-arm_set_pc (CORE_ADDR pc)
-{
- unsigned long newpc = pc;
- supply_register_by_name ("pc", &newpc);
-}
-
-/* Correct in either endianness. We do not support Thumb yet. */
-static const unsigned long arm_breakpoint = 0xef9f0001;
-#define arm_breakpoint_len 4
-
-static int
-arm_breakpoint_at (CORE_ADDR where)
-{
- unsigned long insn;
-
- (*the_target->read_memory) (where, (char *) &insn, 4);
- if (insn == arm_breakpoint)
- return 1;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return 0;
-}
-
-/* We only place breakpoints in empty marker functions, and thread locking
- is outside of the function. So rather than importing software single-step,
- we can just run until exit. */
-static CORE_ADDR
-arm_reinsert_addr ()
-{
- unsigned long pc;
- collect_register_by_name ("lr", &pc);
- return pc;
-}
-
-static void
-arm_fill_gregset (void *buf)
-{
- int i;
-
- for (i = 0; i < arm_num_regs; i++)
- if (arm_regmap[i] != -1)
- collect_register (i, ((char *) buf) + arm_regmap[i]);
-
-}
-
-static void
-arm_store_gregset (const void *buf)
-{
- int i;
-
- for (i = 0; i < arm_num_regs; i++)
- if (arm_regmap[i] != -1)
- supply_register (i, ((char *) buf) + arm_regmap[i]);
-
-}
-
-
-struct regset_info target_regsets[] = {
- {PT_GETREGS, PT_SETREGS, sizeof (struct reg),
- GENERAL_REGS,
- arm_fill_gregset, arm_store_gregset },
- { 0, 0, -1, -1, NULL, NULL }
-};
-
-struct fbsd_target_ops the_low_target = {
- arm_num_regs,
- arm_regmap,
- arm_cannot_fetch_register,
- arm_cannot_store_register,
- arm_get_pc,
- arm_set_pc,
- (const char *) &arm_breakpoint,
- arm_breakpoint_len,
- arm_reinsert_addr,
- 0,
- arm_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c
deleted file mode 100644
index cd296f9b6655a..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-i386-low.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-#include "i387-fp.h"
-
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#else
-#include <machine/reg.h>
-#endif
-
-/* This module only supports access to the general purpose registers. */
-
-#define i386_num_regs 16
-
-/* This stuff comes from i386-fbsd-nat.c. */
-
-/* Mapping between the general-purpose registers in `struct user'
- format and GDB's register array layout. */
-static int i386_regmap[] =
-{
- tEAX * 4, tECX * 4, tEDX * 4, tEBX * 4,
- tESP * 4, tEBP * 4, tESI * 4, tEDI * 4,
- tEIP * 4, tEFLAGS * 4, tCS * 4, tSS * 4,
- tDS * 4, tES * 4, tFS * 4, tGS * 4
-};
-
-static int
-i386_cannot_store_register (int regno)
-{
- return (regno >= i386_num_regs);
-}
-
-static int
-i386_cannot_fetch_register (int regno)
-{
- return (regno >= i386_num_regs);
-}
-
-
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-
-static void
-i386_fill_gregset (void *buf)
-{
- int i;
-
- for (i = 0; i < i386_num_regs; i++)
- collect_register (i, ((char *) buf) + i386_regmap[i]);
-
-}
-
-static void
-i386_store_gregset (const void *buf)
-{
- int i;
-
- for (i = 0; i < i386_num_regs; i++)
- supply_register (i, ((char *) buf) + i386_regmap[i]);
-
-}
-
-static void
-i386_fill_fpregset (void *buf)
-{
- i387_cache_to_fsave (buf);
-}
-
-static void
-i386_store_fpregset (const void *buf)
-{
- i387_fsave_to_cache (buf);
-}
-
-static void
-i386_fill_fpxregset (void *buf)
-{
- i387_cache_to_fxsave (buf);
-}
-
-static void
-i386_store_fpxregset (const void *buf)
-{
- i387_fxsave_to_cache (buf);
-}
-
-
-struct regset_info target_regsets[] = {
- { PT_GETREGS, PT_SETREGS, sizeof (struct reg),
- GENERAL_REGS,
- i386_fill_gregset, i386_store_gregset },
-#ifdef HAVE_PTRACE_GETFPXREGS
- { PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, sizeof (elf_fpxregset_t),
- EXTENDED_REGS,
- i386_fill_fpxregset, i386_store_fpxregset },
-#endif
- { PT_GETFPREGS, PT_SETFPREGS, sizeof (struct fpreg),
- FP_REGS,
- i386_fill_fpregset, i386_store_fpregset },
- { 0, 0, -1, -1, NULL, NULL }
-};
-
-static const char i386_breakpoint[] = { 0xCC };
-#define i386_breakpoint_len 1
-
-extern int debug_threads;
-
-static CORE_ADDR
-i386_get_pc ()
-{
- unsigned long pc;
-
- collect_register_by_name ("eip", &pc);
-
- if (debug_threads)
- fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc);
- return pc;
-}
-
-static void
-i386_set_pc (CORE_ADDR newpc)
-{
- if (debug_threads)
- fprintf (stderr, "set pc to %08lx\n", (long) newpc);
- supply_register_by_name ("eip", &newpc);
-}
-
-static int
-i386_breakpoint_at (CORE_ADDR pc)
-{
- unsigned char c;
-
- read_inferior_memory (pc, &c, 1);
- if (c == 0xCC)
- return 1;
-
- return 0;
-}
-
-struct fbsd_target_ops the_low_target = {
- i386_num_regs,
- i386_regmap,
- i386_cannot_fetch_register,
- i386_cannot_store_register,
- i386_get_pc,
- i386_set_pc,
- i386_breakpoint,
- i386_breakpoint_len,
- NULL,
- 1,
- i386_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-low.c
deleted file mode 100644
index ab6ff2f307318..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-low.c
+++ /dev/null
@@ -1,1265 +0,0 @@
-/* Low level interface to ptrace, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-
-#include <sys/wait.h>
-#include <sys/param.h>
-#include <sys/ptrace.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead,
- however. This requires changing the ID in place when we go from !using_threads
- to using_threads, immediately.
-
- ``all_processes'' is keyed by the process ID - which on Linux is (presently)
- the same as the LWP ID. */
-
-struct inferior_list all_processes;
-
-/* FIXME this is a bit of a hack, and could be removed. */
-int stopping_threads;
-
-/* FIXME make into a target method? */
-int using_threads;
-
-static void fbsd_resume_one_process (struct inferior_list_entry *entry,
- int step, int signal);
-static void fbsd_resume (struct thread_resume *resume_info);
-static void stop_all_processes (void);
-static int fbsd_wait_for_event (struct thread_info *child);
-
-struct pending_signals
-{
- int signal;
- struct pending_signals *prev;
-};
-
-#define PTRACE_ARG3_TYPE caddr_t
-#define PTRACE_XFER_TYPE int
-
-int debug_threads = 0;
-
-#define pid_of(proc) ((proc)->head.id)
-
-/* FIXME: Delete eventually. */
-#define inferior_pid (pid_of (get_thread_process (current_inferior)))
-
-/* This function should only be called if the process got a SIGTRAP.
- The SIGTRAP could mean several things.
-
- On i386, where decr_pc_after_break is non-zero:
- If we were single-stepping this process using PT_STEP,
- we will get only the one SIGTRAP (even if the instruction we
- stepped over was a breakpoint). The value of $eip will be the
- next instruction.
- If we continue the process using PTRACE_CONT, we will get a
- SIGTRAP when we hit a breakpoint. The value of $eip will be
- the instruction after the breakpoint (i.e. needs to be
- decremented). If we report the SIGTRAP to GDB, we must also
- report the undecremented PC. If we cancel the SIGTRAP, we
- must resume at the decremented PC.
-
- (Presumably, not yet tested) On a non-decr_pc_after_break machine
- with hardware or kernel single-step:
- If we single-step over a breakpoint instruction, our PC will
- point at the following instruction. If we continue and hit a
- breakpoint instruction, our PC will point at the breakpoint
- instruction. */
-
-static CORE_ADDR
-get_stop_pc (void)
-{
- CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
-
- if (get_thread_process (current_inferior)->stepping)
- return stop_pc;
- else
- return stop_pc - the_low_target.decr_pc_after_break;
-}
-
-static void *
-add_process (int pid)
-{
- struct process_info *process;
-
- process = (struct process_info *) malloc (sizeof (*process));
- memset (process, 0, sizeof (*process));
-
- process->head.id = pid;
-
- /* Default to tid == lwpid == pid. */
- process->tid = pid;
- process->lwpid = pid;
-
- add_inferior_to_list (&all_processes, &process->head);
-
- return process;
-}
-
-/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args. */
-
-static int
-fbsd_create_inferior (char *program, char **allargs)
-{
- void *new_process;
- int pid;
-
- pid = vfork ();
- if (pid < 0)
- perror_with_name ("vfork");
-
- if (pid == 0)
- {
- ptrace (PT_TRACE_ME, 0, 0, 0);
-
- setpgid (0, 0);
-
- execv (program, allargs);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", program,
- strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-
- new_process = add_process (pid);
- add_thread (pid, new_process);
-
- return pid;
-}
-
-/* Attach to an inferior process. */
-
-void
-fbsd_attach_lwp (int pid, int tid)
-{
- struct process_info *new_process;
-
- if (ptrace (PT_ATTACH, pid, 0, 0) != 0)
- {
- fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
- strerror (errno), errno);
- fflush (stderr);
-
- /* If we fail to attach to an LWP, just return. */
- if (!using_threads)
- _exit (0177);
- return;
- }
-
- new_process = (struct process_info *) add_process (pid);
- add_thread (tid, new_process);
-
- /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH
- brings it to a halt. We should ignore that SIGSTOP and resume the process
- (unless this is the first process, in which case the flag will be cleared
- in fbsd_attach).
-
- On the other hand, if we are currently trying to stop all threads, we
- should treat the new thread as if we had sent it a SIGSTOP. This works
- because we are guaranteed that add_process added us to the end of the
- list, and so the new thread has not yet reached wait_for_sigstop (but
- will). */
- if (! stopping_threads)
- new_process->stop_expected = 1;
-}
-
-int
-fbsd_attach (int pid)
-{
- struct process_info *process;
-
- fbsd_attach_lwp (pid, pid);
-
- /* Don't ignore the initial SIGSTOP if we just attached to this process. */
- process = (struct process_info *) find_inferior_id (&all_processes, pid);
- process->stop_expected = 0;
-
- return 0;
-}
-
-/* Kill the inferior process. Make us have no inferior. */
-
-static void
-fbsd_kill_one_process (struct inferior_list_entry *entry)
-{
- struct thread_info *thread = (struct thread_info *) entry;
- struct process_info *process = get_thread_process (thread);
- int wstat;
-
- do
- {
- ptrace (PT_KILL, pid_of (process), 0, 0);
-
- /* Make sure it died. The loop is most likely unnecessary. */
- wstat = fbsd_wait_for_event (thread);
- } while (WIFSTOPPED (wstat));
-}
-
-static void
-fbsd_kill (void)
-{
- for_each_inferior (&all_threads, fbsd_kill_one_process);
-}
-
-static void
-fbsd_detach_one_process (struct inferior_list_entry *entry)
-{
- struct thread_info *thread = (struct thread_info *) entry;
- struct process_info *process = get_thread_process (thread);
-
- ptrace (PT_DETACH, pid_of (process), 0, 0);
-}
-
-static void
-fbsd_detach (void)
-{
- for_each_inferior (&all_threads, fbsd_detach_one_process);
-}
-
-/* Return nonzero if the given thread is still alive. */
-static int
-fbsd_thread_alive (int tid)
-{
- if (find_inferior_id (&all_threads, tid) != NULL)
- return 1;
- else
- return 0;
-}
-
-/* Return nonzero if this process stopped at a breakpoint which
- no longer appears to be inserted. Also adjust the PC
- appropriately to resume where the breakpoint used to be. */
-static int
-check_removed_breakpoint (struct process_info *event_child)
-{
- CORE_ADDR stop_pc;
- struct thread_info *saved_inferior;
-
- if (event_child->pending_is_breakpoint == 0)
- return 0;
-
- if (debug_threads)
- fprintf (stderr, "Checking for breakpoint.\n");
-
- saved_inferior = current_inferior;
- current_inferior = get_process_thread (event_child);
-
- stop_pc = get_stop_pc ();
-
- /* If the PC has changed since we stopped, then we shouldn't do
- anything. This happens if, for instance, GDB handled the
- decr_pc_after_break subtraction itself. */
- if (stop_pc != event_child->pending_stop_pc)
- {
- if (debug_threads)
- fprintf (stderr, "Ignoring, PC was changed.\n");
-
- event_child->pending_is_breakpoint = 0;
- current_inferior = saved_inferior;
- return 0;
- }
-
- /* If the breakpoint is still there, we will report hitting it. */
- if ((*the_low_target.breakpoint_at) (stop_pc))
- {
- if (debug_threads)
- fprintf (stderr, "Ignoring, breakpoint is still present.\n");
- current_inferior = saved_inferior;
- return 0;
- }
-
- if (debug_threads)
- fprintf (stderr, "Removed breakpoint.\n");
-
- /* For decr_pc_after_break targets, here is where we perform the
- decrement. We go immediately from this function to resuming,
- and can not safely call get_stop_pc () again. */
- if (the_low_target.set_pc != NULL)
- (*the_low_target.set_pc) (stop_pc);
-
- /* We consumed the pending SIGTRAP. */
- event_child->pending_is_breakpoint = 0;
- event_child->status_pending_p = 0;
- event_child->status_pending = 0;
-
- current_inferior = saved_inferior;
- return 1;
-}
-
-/* Return 1 if this process has an interesting status pending. This function
- may silently resume an inferior process. */
-static int
-status_pending_p (struct inferior_list_entry *entry, void *dummy)
-{
- struct process_info *process = (struct process_info *) entry;
-
- if (process->status_pending_p)
- if (check_removed_breakpoint (process))
- {
- /* This thread was stopped at a breakpoint, and the breakpoint
- is now gone. We were told to continue (or step...) all threads,
- so GDB isn't trying to single-step past this breakpoint.
- So instead of reporting the old SIGTRAP, pretend we got to
- the breakpoint just after it was removed instead of just
- before; resume the process. */
- fbsd_resume_one_process (&process->head, 0, 0);
- return 0;
- }
-
- return process->status_pending_p;
-}
-
-static void
-fbsd_wait_for_process (struct process_info **childp, int *wstatp)
-{
- int ret;
- int to_wait_for = -1;
-
- if (*childp != NULL)
- to_wait_for = (*childp)->lwpid;
-
- while (1)
- {
- ret = waitpid (to_wait_for, wstatp, WNOHANG);
-
- if (ret == -1)
- {
- if (errno != ECHILD)
- perror_with_name ("waitpid");
- }
- else if (ret > 0)
- break;
-
- usleep (1000);
- }
-
- if (debug_threads
- && (!WIFSTOPPED (*wstatp)
- || (WSTOPSIG (*wstatp) != 32
- && WSTOPSIG (*wstatp) != 33)))
- fprintf (stderr, "Got an event from %d (%x)\n", ret, *wstatp);
-
- if (to_wait_for == -1)
- *childp = (struct process_info *) find_inferior_id (&all_processes, ret);
-
- (*childp)->stopped = 1;
- (*childp)->pending_is_breakpoint = 0;
-
- if (debug_threads
- && WIFSTOPPED (*wstatp))
- {
- current_inferior = (struct thread_info *)
- find_inferior_id (&all_threads, (*childp)->tid);
- /* For testing only; i386_stop_pc prints out a diagnostic. */
- if (the_low_target.get_pc != NULL)
- get_stop_pc ();
- }
-}
-
-static int
-fbsd_wait_for_event (struct thread_info *child)
-{
- CORE_ADDR stop_pc;
- struct process_info *event_child;
- int wstat;
-
- /* Check for a process with a pending status. */
- /* It is possible that the user changed the pending task's registers since
- it stopped. We correctly handle the change of PC if we hit a breakpoint
- (in check_removed_breakpoint); signals should be reported anyway. */
- if (child == NULL)
- {
- event_child = (struct process_info *)
- find_inferior (&all_processes, status_pending_p, NULL);
- if (debug_threads && event_child)
- fprintf (stderr, "Got a pending child %d\n", event_child->lwpid);
- }
- else
- {
- event_child = get_thread_process (child);
- if (event_child->status_pending_p
- && check_removed_breakpoint (event_child))
- event_child = NULL;
- }
-
- if (event_child != NULL)
- {
- if (event_child->status_pending_p)
- {
- if (debug_threads)
- fprintf (stderr, "Got an event from pending child %d (%04x)\n",
- event_child->lwpid, event_child->status_pending);
- wstat = event_child->status_pending;
- event_child->status_pending_p = 0;
- event_child->status_pending = 0;
- current_inferior = get_process_thread (event_child);
- return wstat;
- }
- }
-
- /* We only enter this loop if no process has a pending wait status. Thus
- any action taken in response to a wait status inside this loop is
- responding as soon as we detect the status, not after any pending
- events. */
- while (1)
- {
- if (child == NULL)
- event_child = NULL;
- else
- event_child = get_thread_process (child);
-
- fbsd_wait_for_process (&event_child, &wstat);
-
- if (event_child == NULL)
- error ("event from unknown child");
-
- current_inferior = (struct thread_info *)
- find_inferior_id (&all_threads, event_child->tid);
-
- if (using_threads)
- {
- /* Check for thread exit. */
- if (! WIFSTOPPED (wstat))
- {
- if (debug_threads)
- fprintf (stderr, "Thread %d (LWP %d) exiting\n",
- event_child->tid, event_child->head.id);
-
- /* If the last thread is exiting, just return. */
- if (all_threads.head == all_threads.tail)
- return wstat;
-
- dead_thread_notify (event_child->tid);
-
- remove_inferior (&all_processes, &event_child->head);
- free (event_child);
- remove_thread (current_inferior);
- current_inferior = (struct thread_info *) all_threads.head;
-
- /* If we were waiting for this particular child to do something...
- well, it did something. */
- if (child != NULL)
- return wstat;
-
- /* Wait for a more interesting event. */
- continue;
- }
-
- if (WIFSTOPPED (wstat)
- && WSTOPSIG (wstat) == SIGSTOP
- && event_child->stop_expected)
- {
- if (debug_threads)
- fprintf (stderr, "Expected stop.\n");
- event_child->stop_expected = 0;
- fbsd_resume_one_process (&event_child->head,
- event_child->stepping, 0);
- continue;
- }
-
- /* FIXME drow/2002-06-09: Get signal numbers from the inferior's
- thread library? */
- if (WIFSTOPPED (wstat))
- {
- if (debug_threads)
- fprintf (stderr, "Ignored signal %d for %d (LWP %d).\n",
- WSTOPSIG (wstat), event_child->tid,
- event_child->head.id);
- fbsd_resume_one_process (&event_child->head,
- event_child->stepping,
- WSTOPSIG (wstat));
- continue;
- }
- }
-
- /* If this event was not handled above, and is not a SIGTRAP, report
- it. */
- if (!WIFSTOPPED (wstat) || WSTOPSIG (wstat) != SIGTRAP)
- return wstat;
-
- /* If this target does not support breakpoints, we simply report the
- SIGTRAP; it's of no concern to us. */
- if (the_low_target.get_pc == NULL)
- return wstat;
-
- stop_pc = get_stop_pc ();
-
- /* bp_reinsert will only be set if we were single-stepping.
- Notice that we will resume the process after hitting
- a gdbserver breakpoint; single-stepping to/over one
- is not supported (yet). */
- if (event_child->bp_reinsert != 0)
- {
- if (debug_threads)
- fprintf (stderr, "Reinserted breakpoint.\n");
- reinsert_breakpoint (event_child->bp_reinsert);
- event_child->bp_reinsert = 0;
-
- /* Clear the single-stepping flag and SIGTRAP as we resume. */
- fbsd_resume_one_process (&event_child->head, 0, 0);
- continue;
- }
-
- if (debug_threads)
- fprintf (stderr, "Hit a (non-reinsert) breakpoint.\n");
-
- if (check_breakpoints (stop_pc) != 0)
- {
- /* We hit one of our own breakpoints. We mark it as a pending
- breakpoint, so that check_removed_breakpoint () will do the PC
- adjustment for us at the appropriate time. */
- event_child->pending_is_breakpoint = 1;
- event_child->pending_stop_pc = stop_pc;
-
- /* Now we need to put the breakpoint back. We continue in the event
- loop instead of simply replacing the breakpoint right away,
- in order to not lose signals sent to the thread that hit the
- breakpoint. Unfortunately this increases the window where another
- thread could sneak past the removed breakpoint. For the current
- use of server-side breakpoints (thread creation) this is
- acceptable; but it needs to be considered before this breakpoint
- mechanism can be used in more general ways. For some breakpoints
- it may be necessary to stop all other threads, but that should
- be avoided where possible.
-
- If breakpoint_reinsert_addr is NULL, that means that we can
- use PT_STEP on this platform. Uninsert the breakpoint,
- mark it for reinsertion, and single-step.
-
- Otherwise, call the target function to figure out where we need
- our temporary breakpoint, create it, and continue executing this
- process. */
- if (the_low_target.breakpoint_reinsert_addr == NULL)
- {
- event_child->bp_reinsert = stop_pc;
- uninsert_breakpoint (stop_pc);
- fbsd_resume_one_process (&event_child->head, 1, 0);
- }
- else
- {
- reinsert_breakpoint_by_bp
- (stop_pc, (*the_low_target.breakpoint_reinsert_addr) ());
- fbsd_resume_one_process (&event_child->head, 0, 0);
- }
-
- continue;
- }
-
- /* If we were single-stepping, we definitely want to report the
- SIGTRAP. The single-step operation has completed, so also
- clear the stepping flag; in general this does not matter,
- because the SIGTRAP will be reported to the client, which
- will give us a new action for this thread, but clear it for
- consistency anyway. It's safe to clear the stepping flag
- because the only consumer of get_stop_pc () after this point
- is check_removed_breakpoint, and pending_is_breakpoint is not
- set. It might be wiser to use a step_completed flag instead. */
- if (event_child->stepping)
- {
- event_child->stepping = 0;
- return wstat;
- }
-
- /* A SIGTRAP that we can't explain. It may have been a breakpoint.
- Check if it is a breakpoint, and if so mark the process information
- accordingly. This will handle both the necessary fiddling with the
- PC on decr_pc_after_break targets and suppressing extra threads
- hitting a breakpoint if two hit it at once and then GDB removes it
- after the first is reported. Arguably it would be better to report
- multiple threads hitting breakpoints simultaneously, but the current
- remote protocol does not allow this. */
- if ((*the_low_target.breakpoint_at) (stop_pc))
- {
- event_child->pending_is_breakpoint = 1;
- event_child->pending_stop_pc = stop_pc;
- }
-
- return wstat;
- }
-
- /* NOTREACHED */
- return 0;
-}
-
-/* Wait for process, returns status. */
-
-static unsigned char
-fbsd_wait (char *status)
-{
- int w;
- struct thread_info *child = NULL;
-
-retry:
- /* If we were only supposed to resume one thread, only wait for
- that thread - if it's still alive. If it died, however - which
- can happen if we're coming from the thread death case below -
- then we need to make sure we restart the other threads. We could
- pick a thread at random or restart all; restarting all is less
- arbitrary. */
- if (cont_thread > 0)
- {
- child = (struct thread_info *) find_inferior_id (&all_threads,
- cont_thread);
-
- /* No stepping, no signal - unless one is pending already, of course. */
- if (child == NULL)
- {
- struct thread_resume resume_info;
- resume_info.thread = -1;
- resume_info.step = resume_info.sig = resume_info.leave_stopped = 0;
- fbsd_resume (&resume_info);
- }
- }
-
- enable_async_io ();
- unblock_async_io ();
- w = fbsd_wait_for_event (child);
- stop_all_processes ();
- disable_async_io ();
-
- /* If we are waiting for a particular child, and it exited,
- fbsd_wait_for_event will return its exit status. Similarly if
- the last child exited. If this is not the last child, however,
- do not report it as exited until there is a 'thread exited' response
- available in the remote protocol. Instead, just wait for another event.
- This should be safe, because if the thread crashed we will already
- have reported the termination signal to GDB; that should stop any
- in-progress stepping operations, etc.
-
- Report the exit status of the last thread to exit. This matches
- LinuxThreads' behavior. */
-
- if (all_threads.head == all_threads.tail)
- {
- if (WIFEXITED (w))
- {
- fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
- *status = 'W';
- clear_inferiors ();
- free (all_processes.head);
- all_processes.head = all_processes.tail = NULL;
- return ((unsigned char) WEXITSTATUS (w));
- }
- else if (!WIFSTOPPED (w))
- {
- fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
- *status = 'X';
- clear_inferiors ();
- free (all_processes.head);
- all_processes.head = all_processes.tail = NULL;
- return ((unsigned char) WTERMSIG (w));
- }
- }
- else
- {
- if (!WIFSTOPPED (w))
- goto retry;
- }
-
- *status = 'T';
- return ((unsigned char) WSTOPSIG (w));
-}
-
-static void
-send_sigstop (struct inferior_list_entry *entry)
-{
- struct process_info *process = (struct process_info *) entry;
-
- if (process->stopped)
- return;
-
- /* If we already have a pending stop signal for this process, don't
- send another. */
- if (process->stop_expected)
- {
- process->stop_expected = 0;
- return;
- }
-
- if (debug_threads)
- fprintf (stderr, "Sending sigstop to process %d\n", process->head.id);
-
- kill (process->head.id, SIGSTOP);
- process->sigstop_sent = 1;
-}
-
-static void
-wait_for_sigstop (struct inferior_list_entry *entry)
-{
- struct process_info *process = (struct process_info *) entry;
- struct thread_info *saved_inferior, *thread;
- int wstat, saved_tid;
-
- if (process->stopped)
- return;
-
- saved_inferior = current_inferior;
- saved_tid = ((struct inferior_list_entry *) saved_inferior)->id;
- thread = (struct thread_info *) find_inferior_id (&all_threads,
- process->tid);
- wstat = fbsd_wait_for_event (thread);
-
- /* If we stopped with a non-SIGSTOP signal, save it for later
- and record the pending SIGSTOP. If the process exited, just
- return. */
- if (WIFSTOPPED (wstat)
- && WSTOPSIG (wstat) != SIGSTOP)
- {
- if (debug_threads)
- fprintf (stderr, "Stopped with non-sigstop signal\n");
- process->status_pending_p = 1;
- process->status_pending = wstat;
- process->stop_expected = 1;
- }
-
- if (fbsd_thread_alive (saved_tid))
- current_inferior = saved_inferior;
- else
- {
- if (debug_threads)
- fprintf (stderr, "Previously current thread died.\n");
-
- /* Set a valid thread as current. */
- set_desired_inferior (0);
- }
-}
-
-static void
-stop_all_processes (void)
-{
- stopping_threads = 1;
- for_each_inferior (&all_processes, send_sigstop);
- for_each_inferior (&all_processes, wait_for_sigstop);
- stopping_threads = 0;
-}
-
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-static void
-fbsd_resume_one_process (struct inferior_list_entry *entry,
- int step, int signal)
-{
- struct process_info *process = (struct process_info *) entry;
- struct thread_info *saved_inferior;
-
- if (process->stopped == 0)
- return;
-
- /* If we have pending signals or status, and a new signal, enqueue the
- signal. Also enqueue the signal if we are waiting to reinsert a
- breakpoint; it will be picked up again below. */
- if (signal != 0
- && (process->status_pending_p || process->pending_signals != NULL
- || process->bp_reinsert != 0))
- {
- struct pending_signals *p_sig;
- p_sig = malloc (sizeof (*p_sig));
- p_sig->prev = process->pending_signals;
- p_sig->signal = signal;
- process->pending_signals = p_sig;
- }
-
- if (process->status_pending_p && !check_removed_breakpoint (process))
- return;
-
- saved_inferior = current_inferior;
- current_inferior = get_process_thread (process);
-
- if (debug_threads)
- fprintf (stderr, "Resuming process %d (%s, signal %d, stop %s)\n", inferior_pid,
- step ? "step" : "continue", signal,
- process->stop_expected ? "expected" : "not expected");
-
- /* This bit needs some thinking about. If we get a signal that
- we must report while a single-step reinsert is still pending,
- we often end up resuming the thread. It might be better to
- (ew) allow a stack of pending events; then we could be sure that
- the reinsert happened right away and not lose any signals.
-
- Making this stack would also shrink the window in which breakpoints are
- uninserted (see comment in fbsd_wait_for_process) but not enough for
- complete correctness, so it won't solve that problem. It may be
- worthwhile just to solve this one, however. */
- if (process->bp_reinsert != 0)
- {
- if (debug_threads)
- fprintf (stderr, " pending reinsert at %08lx", (long)process->bp_reinsert);
- if (step == 0)
- fprintf (stderr, "BAD - reinserting but not stepping.\n");
- step = 1;
-
- /* Postpone any pending signal. It was enqueued above. */
- signal = 0;
- }
-
- check_removed_breakpoint (process);
-
- if (debug_threads && the_low_target.get_pc != NULL)
- {
- fprintf (stderr, " ");
- (long) (*the_low_target.get_pc) ();
- }
-
- /* If we have pending signals, consume one unless we are trying to reinsert
- a breakpoint. */
- if (process->pending_signals != NULL && process->bp_reinsert == 0)
- {
- struct pending_signals **p_sig;
-
- p_sig = &process->pending_signals;
- while ((*p_sig)->prev != NULL)
- p_sig = &(*p_sig)->prev;
-
- signal = (*p_sig)->signal;
- free (*p_sig);
- *p_sig = NULL;
- }
-
- regcache_invalidate_one ((struct inferior_list_entry *)
- get_process_thread (process));
- errno = 0;
- process->stopped = 0;
- process->stepping = step;
- ptrace (step ? PT_STEP : PT_CONTINUE, process->lwpid, (PTRACE_ARG3_TYPE) 1, signal);
-
- current_inferior = saved_inferior;
- if (errno)
- perror_with_name ("ptrace");
-}
-
-static struct thread_resume *resume_ptr;
-
-/* This function is called once per thread. We look up the thread
- in RESUME_PTR, and mark the thread with a pointer to the appropriate
- resume request.
-
- This algorithm is O(threads * resume elements), but resume elements
- is small (and will remain small at least until GDB supports thread
- suspension). */
-static void
-fbsd_set_resume_request (struct inferior_list_entry *entry)
-{
- struct process_info *process;
- struct thread_info *thread;
- int ndx;
-
- thread = (struct thread_info *) entry;
- process = get_thread_process (thread);
-
- ndx = 0;
- while (resume_ptr[ndx].thread != -1 && resume_ptr[ndx].thread != entry->id)
- ndx++;
-
- process->resume = &resume_ptr[ndx];
-}
-
-/* This function is called once per thread. We check the thread's resume
- request, which will tell us whether to resume, step, or leave the thread
- stopped; and what signal, if any, it should be sent. For threads which
- we aren't explicitly told otherwise, we preserve the stepping flag; this
- is used for stepping over gdbserver-placed breakpoints. */
-
-static void
-fbsd_continue_one_thread (struct inferior_list_entry *entry)
-{
- struct process_info *process;
- struct thread_info *thread;
- int step;
-
- thread = (struct thread_info *) entry;
- process = get_thread_process (thread);
-
- if (process->resume->leave_stopped)
- return;
-
- if (process->resume->thread == -1)
- step = process->stepping || process->resume->step;
- else
- step = process->resume->step;
-
- fbsd_resume_one_process (&process->head, step, process->resume->sig);
-
- process->resume = NULL;
-}
-
-/* This function is called once per thread. We check the thread's resume
- request, which will tell us whether to resume, step, or leave the thread
- stopped; and what signal, if any, it should be sent. We queue any needed
- signals, since we won't actually resume. We already have a pending event
- to report, so we don't need to preserve any step requests; they should
- be re-issued if necessary. */
-
-static void
-fbsd_queue_one_thread (struct inferior_list_entry *entry)
-{
- struct process_info *process;
- struct thread_info *thread;
-
- thread = (struct thread_info *) entry;
- process = get_thread_process (thread);
-
- if (process->resume->leave_stopped)
- return;
-
- /* If we have a new signal, enqueue the signal. */
- if (process->resume->sig != 0)
- {
- struct pending_signals *p_sig;
- p_sig = malloc (sizeof (*p_sig));
- p_sig->prev = process->pending_signals;
- p_sig->signal = process->resume->sig;
- process->pending_signals = p_sig;
- }
-
- process->resume = NULL;
-}
-
-/* Set DUMMY if this process has an interesting status pending. */
-static int
-resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p)
-{
- struct process_info *process = (struct process_info *) entry;
-
- /* Processes which will not be resumed are not interesting, because
- we might not wait for them next time through fbsd_wait. */
- if (process->resume->leave_stopped)
- return 0;
-
- /* If this thread has a removed breakpoint, we won't have any
- events to report later, so check now. check_removed_breakpoint
- may clear status_pending_p. We avoid calling check_removed_breakpoint
- for any thread that we are not otherwise going to resume - this
- lets us preserve stopped status when two threads hit a breakpoint.
- GDB removes the breakpoint to single-step a particular thread
- past it, then re-inserts it and resumes all threads. We want
- to report the second thread without resuming it in the interim. */
- if (process->status_pending_p)
- check_removed_breakpoint (process);
-
- if (process->status_pending_p)
- * (int *) flag_p = 1;
-
- return 0;
-}
-
-static void
-fbsd_resume (struct thread_resume *resume_info)
-{
- int pending_flag;
-
- /* Yes, the use of a global here is rather ugly. */
- resume_ptr = resume_info;
-
- for_each_inferior (&all_threads, fbsd_set_resume_request);
-
- /* If there is a thread which would otherwise be resumed, which
- has a pending status, then don't resume any threads - we can just
- report the pending status. Make sure to queue any signals
- that would otherwise be sent. */
- pending_flag = 0;
- find_inferior (&all_processes, resume_status_pending_p, &pending_flag);
-
- if (debug_threads)
- {
- if (pending_flag)
- fprintf (stderr, "Not resuming, pending status\n");
- else
- fprintf (stderr, "Resuming, no pending status\n");
- }
-
- if (pending_flag)
- for_each_inferior (&all_threads, fbsd_queue_one_thread);
- else
- {
- block_async_io ();
- enable_async_io ();
- for_each_inferior (&all_threads, fbsd_continue_one_thread);
- }
-}
-
-
-static int
-regsets_fetch_inferior_registers ()
-{
- struct regset_info *regset;
-
- regset = target_regsets;
-
- while (regset->size >= 0)
- {
- void *buf;
- int res;
-
- if (regset->size == 0)
- {
- regset ++;
- continue;
- }
-
- buf = malloc (regset->size);
- res = ptrace (regset->get_request, inferior_pid, (PTRACE_ARG3_TYPE) buf, 0);
- if (res < 0)
- {
- char s[256];
- sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%d",
- inferior_pid);
- perror (s);
- }
- regset->store_function (buf);
- regset ++;
- }
- return 0;
-}
-
-static int
-regsets_store_inferior_registers ()
-{
- struct regset_info *regset;
-
- regset = target_regsets;
-
- while (regset->size >= 0)
- {
- void *buf;
- int res;
-
- if (regset->size == 0)
- {
- regset ++;
- continue;
- }
-
- buf = malloc (regset->size);
- regset->fill_function (buf);
- res = ptrace (regset->set_request, inferior_pid, (PTRACE_ARG3_TYPE) buf, 0);
- if (res < 0)
- {
- perror ("Warning: ptrace(regsets_store_inferior_registers)");
- }
- regset ++;
- free (buf);
- }
- return 0;
-}
-
-void
-fbsd_fetch_registers (int regno)
-{
- regsets_fetch_inferior_registers ();
-}
-
-void
-fbsd_store_registers (int regno)
-{
- regsets_store_inferior_registers ();
-}
-
-
-/* Copy LEN bytes from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. */
-
-static int
-fbsd_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
- / sizeof (PTRACE_XFER_TYPE);
- /* Allocate buffer of that many longwords. */
- register PTRACE_XFER_TYPE *buffer
- = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
-
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- buffer[i] = ptrace (PT_READ_D, inferior_pid, (PTRACE_ARG3_TYPE) (intptr_t)addr, 0);
- if (errno)
- return errno;
- }
-
- /* Copy appropriate bytes out of the buffer. */
- memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len);
-
- return 0;
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR.
- On failure (cannot write the inferior)
- returns the value of errno. */
-
-static int
-fbsd_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
- /* Allocate buffer of that many longwords. */
- register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
- extern int errno;
-
- if (debug_threads)
- {
- fprintf (stderr, "Writing %02x to %08lx\n", (unsigned)myaddr[0], (long)memaddr);
- }
-
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- buffer[0] = ptrace (PT_READ_D, inferior_pid,
- (PTRACE_ARG3_TYPE) (intptr_t)addr, 0);
-
- if (count > 1)
- {
- buffer[count - 1]
- = ptrace (PT_READ_D, inferior_pid,
- (PTRACE_ARG3_TYPE) (intptr_t) (addr + (count - 1)
- * sizeof (PTRACE_XFER_TYPE)),
- 0);
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- ptrace (PT_WRITE_D, inferior_pid, (PTRACE_ARG3_TYPE) (intptr_t)addr, buffer[i]);
- if (errno)
- return errno;
- }
-
- return 0;
-}
-
-static void
-fbsd_look_up_symbols (void)
-{
-#ifdef USE_THREAD_DB
- if (using_threads)
- return;
-
- using_threads = thread_db_init ();
-#endif
-}
-
-static void
-fbsd_send_signal (int signum)
-{
- extern int signal_pid;
-
- if (cont_thread > 0)
- {
- struct process_info *process;
-
- process = get_thread_process (current_inferior);
- kill (process->lwpid, signum);
- }
- else
- kill (signal_pid, signum);
-}
-
-/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
- to debugger memory starting at MYADDR. */
-
-static int
-fbsd_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len)
-{
- char filename[PATH_MAX];
- int fd, n;
-
- snprintf (filename, sizeof filename, "/proc/%d/auxv", inferior_pid);
-
- fd = open (filename, O_RDONLY);
- if (fd < 0)
- return -1;
-
- if (offset != (CORE_ADDR) 0
- && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
- n = -1;
- else
- n = read (fd, myaddr, len);
-
- close (fd);
-
- return n;
-}
-
-
-static struct target_ops fbsd_target_ops = {
- fbsd_create_inferior,
- fbsd_attach,
- fbsd_kill,
- fbsd_detach,
- fbsd_thread_alive,
- fbsd_resume,
- fbsd_wait,
- fbsd_fetch_registers,
- fbsd_store_registers,
- fbsd_read_memory,
- fbsd_write_memory,
- fbsd_look_up_symbols,
- fbsd_send_signal,
- fbsd_read_auxv,
-};
-
-static void
-fbsd_init_signals ()
-{
-}
-
-void
-initialize_low (void)
-{
- using_threads = 0;
- set_target_ops (&fbsd_target_ops);
- set_breakpoint_data (the_low_target.breakpoint,
- the_low_target.breakpoint_len);
- init_registers ();
- fbsd_init_signals ();
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-low.h b/gnu/usr.bin/gdb/gdbserver/fbsd-low.h
deleted file mode 100644
index 310368c9b2c15..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-low.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Internal interfaces for the GNU/Linux specific target code for gdbserver.
- Copyright 2002, 2004 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * $FreeBSD$
- */
-
-typedef void (*regset_fill_func) (void *);
-typedef void (*regset_store_func) (const void *);
-enum regset_type {
- GENERAL_REGS,
- FP_REGS,
- EXTENDED_REGS,
-};
-
-struct regset_info
-{
- int get_request, set_request;
- int size;
- enum regset_type type;
- regset_fill_func fill_function;
- regset_store_func store_function;
-};
-extern struct regset_info target_regsets[];
-
-struct fbsd_target_ops
-{
- int num_regs;
- int *regmap;
- int (*cannot_fetch_register) (int);
-
- /* Returns 0 if we can store the register, 1 if we can not
- store the register, and 2 if failure to store the register
- is acceptable. */
- int (*cannot_store_register) (int);
- CORE_ADDR (*get_pc) (void);
- void (*set_pc) (CORE_ADDR newpc);
- const char *breakpoint;
- int breakpoint_len;
- CORE_ADDR (*breakpoint_reinsert_addr) (void);
-
-
- int decr_pc_after_break;
- int (*breakpoint_at) (CORE_ADDR pc);
-};
-
-extern struct fbsd_target_ops the_low_target;
-
-#define get_process(inf) ((struct process_info *)(inf))
-#define get_thread_process(thr) (get_process (inferior_target_data (thr)))
-#define get_process_thread(proc) ((struct thread_info *) \
- find_inferior_id (&all_threads, \
- get_process (proc)->tid))
-
-struct process_info
-{
- struct inferior_list_entry head;
- int thread_known;
- int lwpid;
- int tid;
-
- /* If this flag is set, the next SIGSTOP will be ignored (the process will
- be immediately resumed). */
- int stop_expected;
-
- /* If this flag is set, the process is known to be stopped right now (stop
- event already received in a wait()). */
- int stopped;
-
- /* If this flag is set, we have sent a SIGSTOP to this process and are
- waiting for it to stop. */
- int sigstop_sent;
-
- /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet
- been reported. */
- int status_pending_p;
- int status_pending;
-
- /* If this flag is set, the pending status is a (GDB-placed) breakpoint. */
- int pending_is_breakpoint;
- CORE_ADDR pending_stop_pc;
-
- /* If this is non-zero, it is a breakpoint to be reinserted at our next
- stop (SIGTRAP stops only). */
- CORE_ADDR bp_reinsert;
-
- /* If this flag is set, the last continue operation on this process
- was a single-step. */
- int stepping;
-
- /* If this is non-zero, it points to a chain of signals which need to
- be delivered to this process. */
- struct pending_signals *pending_signals;
-
- /* A link used when resuming. It is initialized from the resume request,
- and then processed and cleared in fbsd_resume_one_process. */
-
- struct thread_resume *resume;
-};
-
-extern struct inferior_list all_processes;
-
-void fbsd_attach_lwp (int pid, int tid);
-
-int thread_db_init (void);
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c
deleted file mode 100644
index 35f7ac6509282..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* FreeBSD/PowerPC specific low level interface, for the remote server for
- GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "server.h"
-#include "fbsd-low.h"
-
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-
-#define ppc_num_regs 71
-
-/* Currently, don't check/send MQ. */
-static int ppc_regmap[] =
- { 0, 4, 8, 12, 16, 20, 24, 28,
- 32, 36, 40, 44, 48, 52, 56, 60,
- 64, 68, 72, 76, 80, 84, 88, 92,
- 96, 100, 104, 108, 112, 116, 120, 124,
-#if 0
- /*
- * XXX on FreeBSD the gdbserver for PowerPC was only tested with FPU-less
- * cores i.e. e500. Let's leave the original FPR references around in case
- * someone picks up and brings support for AIM-like FPU machines.
- */
- PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24,
- PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56,
- PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88,
- PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120,
- PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152,
- PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184,
- PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216,
- PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248,
-#endif
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 144, -1, 132, 128, 140, 136, -1
- };
-
-static int
-ppc_cannot_store_register (int regno)
-{
- /* Some kernels do not allow us to store fpscr. */
- if (regno == find_regno ("fpscr"))
- return 2;
-
- return 0;
-}
-
-static int
-ppc_cannot_fetch_register (int regno)
-{
- return 0;
-}
-
-static CORE_ADDR
-ppc_get_pc (void)
-{
- unsigned long pc;
-
- collect_register_by_name ("pc", &pc);
- return (CORE_ADDR) pc;
-}
-
-static void
-ppc_set_pc (CORE_ADDR pc)
-{
- unsigned long newpc = pc;
-
- supply_register_by_name ("pc", &newpc);
-}
-
-/* Correct in either endianness. Note that this file is
- for PowerPC only, not PowerPC64.
- This instruction is "twge r2, r2", which GDB uses as a software
- breakpoint. */
-static const unsigned long ppc_breakpoint = 0x7d821008;
-#define ppc_breakpoint_len 4
-
-static int
-ppc_breakpoint_at (CORE_ADDR where)
-{
- unsigned long insn;
-
- (*the_target->read_memory) (where, (char *) &insn, 4);
- if (insn == ppc_breakpoint)
- return 1;
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return 0;
-}
-
-static void
-ppc_fill_gregset (void *buf)
-{
- int i;
-
- for (i = 0; i < ppc_num_regs; i++)
- if (ppc_regmap[i] != -1)
- collect_register (i, ((char *) buf) + ppc_regmap[i]);
-
-}
-
-static void
-ppc_store_gregset (const void *buf)
-{
- int i;
-
- for (i = 0; i < ppc_num_regs; i++)
- if (ppc_regmap[i] != -1)
- supply_register (i, ((char *) buf) + ppc_regmap[i]);
-
-}
-
-struct regset_info target_regsets[] = {
- { PT_GETREGS, PT_SETREGS, sizeof (struct reg),
- GENERAL_REGS,
- ppc_fill_gregset, ppc_store_gregset },
- { 0, 0, -1, -1, NULL, NULL }
-};
-
-struct fbsd_target_ops the_low_target = {
- ppc_num_regs,
- ppc_regmap,
- ppc_cannot_fetch_register,
- ppc_cannot_store_register,
- ppc_get_pc,
- ppc_set_pc,
- (const char *) &ppc_breakpoint,
- ppc_breakpoint_len,
- NULL,
- 0,
- ppc_breakpoint_at,
-};
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-amd64.c b/gnu/usr.bin/gdb/gdbserver/reg-amd64.c
deleted file mode 100644
index 7b0534f0d5697..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-amd64.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* A register protocol for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-x86-64.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_x86_64[] = {
- { "rax", 0, 64 },
- { "rbx", 64, 64 },
- { "rcx", 128, 64 },
- { "rdx", 192, 64 },
- { "rsi", 256, 64 },
- { "rdi", 320, 64 },
- { "rbp", 384, 64 },
- { "rsp", 448, 64 },
- { "r8", 512, 64 },
- { "r9", 576, 64 },
- { "r10", 640, 64 },
- { "r11", 704, 64 },
- { "r12", 768, 64 },
- { "r13", 832, 64 },
- { "r14", 896, 64 },
- { "r15", 960, 64 },
- { "rip", 1024, 64 },
- { "eflags", 1088, 32 },
- { "cs", 1120, 32 },
- { "ss", 1152, 32 },
- { "ds", 1184, 32 },
- { "es", 1216, 32 },
- { "fs", 1248, 32 },
- { "gs", 1280, 32 },
- { "st0", 1312, 80 },
- { "st1", 1392, 80 },
- { "st2", 1472, 80 },
- { "st3", 1552, 80 },
- { "st4", 1632, 80 },
- { "st5", 1712, 80 },
- { "st6", 1792, 80 },
- { "st7", 1872, 80 },
- { "fctrl", 1952, 32 },
- { "fstat", 1984, 32 },
- { "ftag", 2016, 32 },
- { "fiseg", 2048, 32 },
- { "fioff", 2080, 32 },
- { "foseg", 2112, 32 },
- { "fooff", 2144, 32 },
- { "fop", 2176, 32 },
- { "xmm0", 2208, 128 },
- { "xmm1", 2336, 128 },
- { "xmm2", 2464, 128 },
- { "xmm3", 2592, 128 },
- { "xmm4", 2720, 128 },
- { "xmm5", 2848, 128 },
- { "xmm6", 2976, 128 },
- { "xmm7", 3104, 128 },
- { "xmm8", 3232, 128 },
- { "xmm9", 3360, 128 },
- { "xmm10", 3488, 128 },
- { "xmm11", 3616, 128 },
- { "xmm12", 3744, 128 },
- { "xmm13", 3872, 128 },
- { "xmm14", 4000, 128 },
- { "xmm15", 4128, 128 },
- { "mxcsr", 4256, 32 },
-};
-
-const char *expedite_regs_x86_64[] = { "rbp", "rsp", "rip", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_x86_64,
- sizeof (regs_x86_64) / sizeof (regs_x86_64[0]));
- gdbserver_expedite_regs = expedite_regs_x86_64;
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-arm.c b/gnu/usr.bin/gdb/gdbserver/reg-arm.c
deleted file mode 100644
index 50379bfed7566..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-arm.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* A register protocol for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was created with the aid of ``regdat.sh'' and ``reg-arm.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_arm[] = {
- { "r0", 0, 32 },
- { "r1", 32, 32 },
- { "r2", 64, 32 },
- { "r3", 96, 32 },
- { "r4", 128, 32 },
- { "r5", 160, 32 },
- { "r6", 192, 32 },
- { "r7", 224, 32 },
- { "r8", 256, 32 },
- { "r9", 288, 32 },
- { "r10", 320, 32 },
- { "r11", 352, 32 },
- { "r12", 384, 32 },
- { "sp", 416, 32 },
- { "lr", 448, 32 },
- { "pc", 480, 32 },
- { "f0", 512, 96 },
- { "f1", 608, 96 },
- { "f2", 704, 96 },
- { "f3", 800, 96 },
- { "f4", 896, 96 },
- { "f5", 992, 96 },
- { "f6", 1088, 96 },
- { "f7", 1184, 96 },
- { "fps", 1280, 32 },
- { "cpsr", 1312, 32 },
-};
-
-const char *expedite_regs_arm[] = { "r11", "sp", "pc", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_arm,
- sizeof (regs_arm) / sizeof (regs_arm[0]));
- gdbserver_expedite_regs = expedite_regs_arm;
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-i386.c b/gnu/usr.bin/gdb/gdbserver/reg-i386.c
deleted file mode 100644
index 3307ea933c451..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-i386.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-i386.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_i386[] = {
- { "eax", 0, 32 },
- { "ecx", 32, 32 },
- { "edx", 64, 32 },
- { "ebx", 96, 32 },
- { "esp", 128, 32 },
- { "ebp", 160, 32 },
- { "esi", 192, 32 },
- { "edi", 224, 32 },
- { "eip", 256, 32 },
- { "eflags", 288, 32 },
- { "cs", 320, 32 },
- { "ss", 352, 32 },
- { "ds", 384, 32 },
- { "es", 416, 32 },
- { "fs", 448, 32 },
- { "gs", 480, 32 },
- { "st0", 512, 80 },
- { "st1", 592, 80 },
- { "st2", 672, 80 },
- { "st3", 752, 80 },
- { "st4", 832, 80 },
- { "st5", 912, 80 },
- { "st6", 992, 80 },
- { "st7", 1072, 80 },
- { "fctrl", 1152, 32 },
- { "fstat", 1184, 32 },
- { "ftag", 1216, 32 },
- { "fiseg", 1248, 32 },
- { "fioff", 1280, 32 },
- { "foseg", 1312, 32 },
- { "fooff", 1344, 32 },
- { "fop", 1376, 32 },
- { "xmm0", 1408, 128 },
- { "xmm1", 1536, 128 },
- { "xmm2", 1664, 128 },
- { "xmm3", 1792, 128 },
- { "xmm4", 1920, 128 },
- { "xmm5", 2048, 128 },
- { "xmm6", 2176, 128 },
- { "xmm7", 2304, 128 },
- { "mxcsr", 2432, 32 },
-};
-
-const char *expedite_regs_i386[] = { "ebp", "esp", "eip", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_i386,
- sizeof (regs_i386) / sizeof (regs_i386[0]));
- gdbserver_expedite_regs = expedite_regs_i386;
-}
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c b/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c
deleted file mode 100644
index 47046631d52e8..0000000000000
--- a/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-
-/* A register protocol for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-ppc.dat''. */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "regdef.h"
-#include "regcache.h"
-
-struct reg regs_ppc[] = {
- { "r0", 0, 32 },
- { "r1", 32, 32 },
- { "r2", 64, 32 },
- { "r3", 96, 32 },
- { "r4", 128, 32 },
- { "r5", 160, 32 },
- { "r6", 192, 32 },
- { "r7", 224, 32 },
- { "r8", 256, 32 },
- { "r9", 288, 32 },
- { "r10", 320, 32 },
- { "r11", 352, 32 },
- { "r12", 384, 32 },
- { "r13", 416, 32 },
- { "r14", 448, 32 },
- { "r15", 480, 32 },
- { "r16", 512, 32 },
- { "r17", 544, 32 },
- { "r18", 576, 32 },
- { "r19", 608, 32 },
- { "r20", 640, 32 },
- { "r21", 672, 32 },
- { "r22", 704, 32 },
- { "r23", 736, 32 },
- { "r24", 768, 32 },
- { "r25", 800, 32 },
- { "r26", 832, 32 },
- { "r27", 864, 32 },
- { "r28", 896, 32 },
- { "r29", 928, 32 },
- { "r30", 960, 32 },
- { "r31", 992, 32 },
- { "f0", 1024, 64 },
- { "f1", 1088, 64 },
- { "f2", 1152, 64 },
- { "f3", 1216, 64 },
- { "f4", 1280, 64 },
- { "f5", 1344, 64 },
- { "f6", 1408, 64 },
- { "f7", 1472, 64 },
- { "f8", 1536, 64 },
- { "f9", 1600, 64 },
- { "f10", 1664, 64 },
- { "f11", 1728, 64 },
- { "f12", 1792, 64 },
- { "f13", 1856, 64 },
- { "f14", 1920, 64 },
- { "f15", 1984, 64 },
- { "f16", 2048, 64 },
- { "f17", 2112, 64 },
- { "f18", 2176, 64 },
- { "f19", 2240, 64 },
- { "f20", 2304, 64 },
- { "f21", 2368, 64 },
- { "f22", 2432, 64 },
- { "f23", 2496, 64 },
- { "f24", 2560, 64 },
- { "f25", 2624, 64 },
- { "f26", 2688, 64 },
- { "f27", 2752, 64 },
- { "f28", 2816, 64 },
- { "f29", 2880, 64 },
- { "f30", 2944, 64 },
- { "f31", 3008, 64 },
- { "pc", 3072, 32 },
- { "ps", 3104, 32 },
- { "cr", 3136, 32 },
- { "lr", 3168, 32 },
- { "ctr", 3200, 32 },
- { "xer", 3232, 32 },
- { "fpscr", 3264, 32 },
-};
-
-const char *expedite_regs_ppc[] = { "r1", "pc", 0 };
-
-void
-init_registers ()
-{
- set_register_cache (regs_ppc,
- sizeof (regs_ppc) / sizeof (regs_ppc[0]));
- gdbserver_expedite_regs = expedite_regs_ppc;
-}
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile
deleted file mode 100644
index 8fb781eca9171..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-PROG= kgdb${GDB_SUFFIX}
-SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c
-WARNS?= 2
-
-BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
- ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
- ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a
-
-DPADD= ${GDBLIBS} ${BULIBS}
-LDADD= ${GDBLIBS} ${BULIBS}
-LIBADD+= m edit ncursesw gnuregex kvm
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile.depend b/gnu/usr.bin/gdb/kgdb/Makefile.depend
deleted file mode 100644
index ed1b03ca732f0..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/Makefile.depend
+++ /dev/null
@@ -1,27 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- gnu/lib/libreadline/readline \
- gnu/lib/libregex \
- gnu/usr.bin/binutils/libbfd \
- gnu/usr.bin/binutils/libiberty \
- gnu/usr.bin/binutils/libopcodes \
- gnu/usr.bin/gdb/libgdb \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/libelf \
- lib/libkvm \
- lib/msun \
- lib/ncurses/ncursesw \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/kgdb/kgdb.1 b/gnu/usr.bin/gdb/kgdb/kgdb.1
deleted file mode 100644
index 8ebfbf55ce9f0..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/kgdb.1
+++ /dev/null
@@ -1,150 +0,0 @@
-.\" Copyright (c) 2004 Marcel Moolenaar
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd July 5, 2017
-.Dt KGDB 1
-.Os
-.Sh NAME
-.Nm kgdb
-.Nd "kernel debugger"
-.Sh SYNOPSIS
-.Nm
-.Op Fl a | Fl f | Fl fullname
-.Op Fl b Ar rate
-.Op Fl q | Fl quiet
-.Op Fl v
-.Op Fl w
-.Op Fl d Ar crashdir
-.Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device
-.Op Ar kernel Op Ar core
-.Sh DEPRECATION NOTICE
-This version of
-.Nm
-is deprecated and will be removed from future versions of the
-.Fx
-base system.
-A newer version of
-.Nm
-is available from ports or packages
-(devel/gdb).
-.Sh DESCRIPTION
-The
-.Nm
-utility is a debugger based on
-.Xr gdb 1
-that allows debugging of kernel core files.
-.Pp
-The options are as follows:
-.Bl -tag -width ".Fl d Ar crashdir"
-.It Fl a
-Increase the annotation level.
-An annotation level of 1 features the historical
-.Fl fullname
-option of
-.Xr gdb 1 .
-This is useful when running
-.Nm
-in Emacs.
-The
-.Fl f
-or
-.Fl fullname
-options are supported for backward compatibility as well.
-.It Fl b Ar rate
-Set the baudrate to
-.Ar rate .
-.It Fl q
-Suppress printing of the banner when the debugger starts.
-The
-.Fl quiet
-form is supported for compatibility as well.
-.It Fl v
-Increase verbosity.
-.It Fl w
-Opens kmem-based targets in read-write mode.
-(This is identical to what
-.Fl -wcore
-used to do in previous
-gdb versions for
-.Fx . )
-.It Fl d Ar crashdir
-Use
-.Ar crashdir
-instead of the default,
-.Pa /var/crash
-to locate kernel core dump files in.
-The name
-.Pa vmcore.
-plus the dump number will be appended to determine
-the actual dump file name.
-.It Fl c Ar core
-Explicitly use
-.Ar core
-as the core dump file.
-.It Fl n Ar dumpnr
-Use the kernel core dump file numbered
-.Ar dumpnr
-for debugging.
-.It Fl r Ar device
-Use
-.Ar device
-to connect
-.Nm
-to for a remote debugging session.
-.El
-.Pp
-The
-.Fl c , n ,
-and
-.Fl r
-options are mutually exclusive.
-.Pp
-Optionally, the name of the kernel symbol file and
-the name of the core dump file can be supplied on the
-command-line as positional arguments.
-If no kernel symbol file name has been given, the
-symbol file of the currently running kernel will be
-used.
-If no core dump file has been specified through either
-of the options or the last command-line argument,
-.Pa /dev/mem
-will be opened to allow debugging the currently running
-kernel.
-.Sh FILES
-.Bl -tag -width ".Pa /var/crash"
-.It Pa /dev/mem
-Default memory image to open if no core dump file
-has been specified.
-.It Pa /var/crash
-Default directory to locate kernel core dump files.
-.El
-.Sh SEE ALSO
-.Xr gdb 1
-.Sh HISTORY
-The
-.Nm
-utility first appeared in its current form in
-.Fx 5.3 .
diff --git a/gnu/usr.bin/gdb/kgdb/kgdb.h b/gnu/usr.bin/gdb/kgdb/kgdb.h
deleted file mode 100644
index 8e5d2baf40b47..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/kgdb.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _KGDB_H_
-#define _KGDB_H_
-
-struct thread_info;
-
-extern kvm_t *kvm;
-
-struct kthr {
- struct kthr *next;
- uintptr_t paddr;
- uintptr_t kaddr;
- uintptr_t kstack;
- uintptr_t pcb;
- int tid;
- int pid;
- int cpu;
-};
-
-extern struct kthr *curkthr;
-
-void initialize_kld_target(void);
-void initialize_kgdb_target(void);
-void kgdb_dmesg(void);
-CORE_ADDR kgdb_trgt_core_pcb(u_int);
-CORE_ADDR kgdb_trgt_stop_pcb(u_int, u_int);
-void kgdb_trgt_new_objfile(struct objfile *);
-void kgdb_trgt_fetch_registers(int);
-void kgdb_trgt_store_registers(int);
-void kld_init(void);
-void kld_new_objfile(struct objfile *);
-
-frame_unwind_sniffer_ftype kgdb_trgt_trapframe_sniffer;
-
-struct kthr *kgdb_thr_first(void);
-struct kthr *kgdb_thr_init(void);
-struct kthr *kgdb_thr_lookup_tid(int);
-struct kthr *kgdb_thr_lookup_pid(int);
-struct kthr *kgdb_thr_lookup_paddr(uintptr_t);
-struct kthr *kgdb_thr_lookup_taddr(uintptr_t);
-struct kthr *kgdb_thr_next(struct kthr *);
-struct kthr *kgdb_thr_select(struct kthr *);
-char *kgdb_thr_extra_thread_info(int);
-
-CORE_ADDR kgdb_lookup(const char *sym);
-CORE_ADDR kgdb_parse_1(const char *, int);
-
-#define kgdb_parse(exp) kgdb_parse_1((exp), 0)
-#define kgdb_parse_quiet(exp) kgdb_parse_1((exp), 1)
-
-extern int (*arm_tdep_pc_fixup)(CORE_ADDR *pc);
-int kgdb_trgt_pc_fixup(CORE_ADDR *pc);
-
-#endif /* _KGDB_H_ */
diff --git a/gnu/usr.bin/gdb/kgdb/kld.c b/gnu/usr.bin/gdb/kgdb/kld.c
deleted file mode 100644
index 50f0797c4cf48..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/kld.c
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <kvm.h>
-#include <libgen.h>
-
-#include <defs.h>
-#include <command.h>
-#include <completer.h>
-#include <environ.h>
-#include <exec.h>
-#include <frame-unwind.h>
-#include <inferior.h>
-#include <objfiles.h>
-#include <gdbcore.h>
-#include <language.h>
-#include <solist.h>
-
-#include "kgdb.h"
-
-struct lm_info {
- CORE_ADDR base_address;
-};
-
-/* Offsets of fields in linker_file structure. */
-static CORE_ADDR off_address, off_filename, off_pathname, off_next;
-
-/* KVA of 'linker_path' which corresponds to the kern.module_path sysctl .*/
-static CORE_ADDR module_path_addr;
-static CORE_ADDR linker_files_addr;
-static CORE_ADDR kernel_file_addr;
-
-static struct target_so_ops kld_so_ops;
-
-static int
-kld_ok (char *path)
-{
- struct stat sb;
-
- if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode))
- return (1);
- return (0);
-}
-
-/*
- * Look for a matching file checking for debug suffixes before the raw file:
- * - filename + ".debug" (e.g. foo.ko.debug)
- * - filename (e.g. foo.ko)
- */
-static const char *kld_suffixes[] = {
- ".debug",
- ".symbols",
- "",
- NULL
-};
-
-static int
-check_kld_path (char *path, size_t path_size)
-{
- const char **suffix;
- char *ep;
-
- ep = path + strlen(path);
- suffix = kld_suffixes;
- while (*suffix != NULL) {
- if (strlcat(path, *suffix, path_size) < path_size) {
- if (kld_ok(path))
- return (1);
- }
-
- /* Restore original path to remove suffix. */
- *ep = '\0';
- suffix++;
- }
- return (0);
-}
-
-/*
- * Try to find the path for a kld by looking in the kernel's directory and
- * in the various paths in the module path.
- */
-static int
-find_kld_path (char *filename, char *path, size_t path_size)
-{
- char *module_path;
- char *kernel_dir, *module_dir, *cp;
- int error;
-
- if (exec_bfd) {
- kernel_dir = dirname(bfd_get_filename(exec_bfd));
- if (kernel_dir != NULL) {
- snprintf(path, path_size, "%s/%s", kernel_dir,
- filename);
- if (check_kld_path(path, path_size))
- return (1);
- }
- }
- if (module_path_addr != 0) {
- target_read_string(module_path_addr, &module_path, PATH_MAX,
- &error);
- if (error == 0) {
- make_cleanup(xfree, module_path);
- cp = module_path;
- while ((module_dir = strsep(&cp, ";")) != NULL) {
- snprintf(path, path_size, "%s/%s", module_dir,
- filename);
- if (check_kld_path(path, path_size))
- return (1);
- }
- }
- }
- return (0);
-}
-
-/*
- * Read a kernel pointer given a KVA in 'address'.
- */
-static CORE_ADDR
-read_pointer (CORE_ADDR address)
-{
- CORE_ADDR value;
-
- if (target_read_memory(address, (char *)&value, TARGET_PTR_BIT / 8) !=
- 0)
- return (0);
- return (extract_unsigned_integer(&value, TARGET_PTR_BIT / 8));
-}
-
-/*
- * Try to find this kld in the kernel linker's list of linker files.
- */
-static int
-find_kld_address (char *arg, CORE_ADDR *address)
-{
- CORE_ADDR kld;
- char *kld_filename;
- char *filename;
- int error;
-
- if (linker_files_addr == 0 || off_address == 0 || off_filename == 0 ||
- off_next == 0)
- return (0);
-
- filename = basename(arg);
- for (kld = read_pointer(linker_files_addr); kld != 0;
- kld = read_pointer(kld + off_next)) {
- /* Try to read this linker file's filename. */
- target_read_string(read_pointer(kld + off_filename),
- &kld_filename, PATH_MAX, &error);
- if (error)
- continue;
-
- /* Compare this kld's filename against our passed in name. */
- if (strcmp(kld_filename, filename) != 0) {
- xfree(kld_filename);
- continue;
- }
- xfree(kld_filename);
-
- /*
- * We found a match, use its address as the base
- * address if we can read it.
- */
- *address = read_pointer(kld + off_address);
- if (*address == 0)
- return (0);
- return (1);
- }
- return (0);
-}
-
-static void
-adjust_section_address (struct section_table *sec, CORE_ADDR *curr_base)
-{
- struct bfd_section *asect = sec->the_bfd_section;
- bfd *abfd = sec->bfd;
-
- if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) {
- sec->addr += *curr_base;
- sec->endaddr += *curr_base;
- return;
- }
-
- *curr_base = align_power(*curr_base,
- bfd_get_section_alignment(abfd, asect));
- sec->addr = *curr_base;
- sec->endaddr = sec->addr + bfd_section_size(abfd, asect);
- *curr_base = sec->endaddr;
-}
-
-static void
-load_kld (char *path, CORE_ADDR base_addr, int from_tty)
-{
- struct section_addr_info *sap;
- struct section_table *sections = NULL, *sections_end = NULL, *s;
- struct cleanup *cleanup;
- bfd *bfd;
- CORE_ADDR curr_addr;
- int i;
-
- /* Open the kld. */
- bfd = bfd_openr(path, gnutarget);
- if (bfd == NULL)
- error("\"%s\": can't open: %s", path,
- bfd_errmsg(bfd_get_error()));
- cleanup = make_cleanup_bfd_close(bfd);
-
- if (!bfd_check_format(bfd, bfd_object))
- error("\%s\": not an object file", path);
-
- /* Make sure we have a .text section. */
- if (bfd_get_section_by_name (bfd, ".text") == NULL)
- error("\"%s\": can't find text section", path);
-
- /* Build a section table from the bfd and relocate the sections. */
- if (build_section_table (bfd, &sections, &sections_end))
- error("\"%s\": can't find file sections", path);
- cleanup = make_cleanup(xfree, sections);
- curr_addr = base_addr;
- for (s = sections; s < sections_end; s++)
- adjust_section_address(s, &curr_addr);
-
- /* Build a section addr info to pass to symbol_file_add(). */
- sap = build_section_addr_info_from_section_table (sections,
- sections_end);
- cleanup = make_cleanup((make_cleanup_ftype *)free_section_addr_info,
- sap);
-
- printf_unfiltered("add symbol table from file \"%s\" at\n", path);
- for (i = 0; i < sap->num_sections; i++)
- printf_unfiltered("\t%s_addr = %s\n", sap->other[i].name,
- local_hex_string(sap->other[i].addr));
-
- if (from_tty && (!query("%s", "")))
- error("Not confirmed.");
-
- symbol_file_add(path, from_tty, sap, 0, OBJF_USERLOADED);
-
- do_cleanups(cleanup);
-}
-
-static void
-kgdb_add_kld_cmd (char *arg, int from_tty)
-{
- char path[PATH_MAX];
- CORE_ADDR base_addr;
-
- if (!exec_bfd)
- error("No kernel symbol file");
-
- /* Try to open the raw path to handle absolute paths first. */
- snprintf(path, sizeof(path), "%s", arg);
- if (!check_kld_path(path, sizeof(path))) {
-
- /*
- * If that didn't work, look in the various possible
- * paths for the module.
- */
- if (!find_kld_path(arg, path, sizeof(path))) {
- error("Unable to locate kld");
- return;
- }
- }
-
- if (!find_kld_address(arg, &base_addr)) {
- error("Unable to find kld in kernel");
- return;
- }
-
- load_kld(path, base_addr, from_tty);
-
- reinit_frame_cache();
-}
-
-static void
-kld_relocate_section_addresses (struct so_list *so, struct section_table *sec)
-{
- static CORE_ADDR curr_addr;
-
- if (sec == so->sections)
- curr_addr = so->lm_info->base_address;
-
- adjust_section_address(sec, &curr_addr);
-}
-
-static void
-kld_free_so (struct so_list *so)
-{
-
- xfree(so->lm_info);
-}
-
-static void
-kld_clear_solib (void)
-{
-}
-
-static void
-kld_solib_create_inferior_hook (void)
-{
-}
-
-static void
-kld_special_symbol_handling (void)
-{
-}
-
-static struct so_list *
-kld_current_sos (void)
-{
- struct so_list *head, **prev, *new;
- CORE_ADDR kld, kernel;
- char *path;
- int error;
-
- if (linker_files_addr == 0 || kernel_file_addr == 0 ||
- off_address == 0 || off_filename == 0 || off_next == 0)
- return (NULL);
-
- head = NULL;
- prev = &head;
-
- /*
- * Walk the list of linker files creating so_list entries for
- * each non-kernel file.
- */
- kernel = read_pointer(kernel_file_addr);
- for (kld = read_pointer(linker_files_addr); kld != 0;
- kld = read_pointer(kld + off_next)) {
- /* Skip the main kernel file. */
- if (kld == kernel)
- continue;
-
- new = xmalloc(sizeof(*new));
- memset(new, 0, sizeof(*new));
-
- new->lm_info = xmalloc(sizeof(*new->lm_info));
- new->lm_info->base_address = 0;
-
- /* Read the base filename and store it in so_original_name. */
- target_read_string(read_pointer(kld + off_filename),
- &path, sizeof(new->so_original_name), &error);
- if (error != 0) {
- warning("kld_current_sos: Can't read filename: %s\n",
- safe_strerror(error));
- free_so(new);
- continue;
- }
- strlcpy(new->so_original_name, path,
- sizeof(new->so_original_name));
- xfree(path);
-
- /*
- * Try to read the pathname (if it exists) and store
- * it in so_name.
- */
- if (find_kld_path(new->so_original_name, new->so_name,
- sizeof(new->so_name))) {
- /* we found the kld */;
- } else if (off_pathname != 0) {
- target_read_string(read_pointer(kld + off_pathname),
- &path, sizeof(new->so_name), &error);
- if (error != 0) {
- warning(
- "kld_current_sos: Can't read pathname for \"%s\": %s\n",
- new->so_original_name,
- safe_strerror(error));
- strlcpy(new->so_name, new->so_original_name,
- sizeof(new->so_name));
- } else {
- strlcpy(new->so_name, path,
- sizeof(new->so_name));
- xfree(path);
- }
- } else
- strlcpy(new->so_name, new->so_original_name,
- sizeof(new->so_name));
-
- /* Read this kld's base address. */
- new->lm_info->base_address = read_pointer(kld + off_address);
- if (new->lm_info->base_address == 0) {
- warning(
- "kld_current_sos: Invalid address for kld \"%s\"",
- new->so_original_name);
- free_so(new);
- continue;
- }
-
- /* Append to the list. */
- *prev = new;
- prev = &new->next;
- }
-
- return (head);
-}
-
-static int
-kld_open_symbol_file_object (void *from_ttyp)
-{
-
- return (0);
-}
-
-static int
-kld_in_dynsym_resolve_code (CORE_ADDR pc)
-{
-
- return (0);
-}
-
-static int
-kld_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
-{
- char path[PATH_MAX];
- int fd;
-
- *temp_pathname = NULL;
- if (!find_kld_path(solib, path, sizeof(path))) {
- errno = ENOENT;
- return (-1);
- }
- fd = open(path, o_flags, 0);
- if (fd >= 0)
- *temp_pathname = xstrdup(path);
- return (fd);
-}
-
-void
-kld_new_objfile (struct objfile *objfile)
-{
-
- if (!have_partial_symbols())
- return;
-
- /*
- * Compute offsets of relevant members in struct linker_file
- * and the addresses of global variables. Don't warn about
- * kernels that don't have 'pathname' in the linker_file
- * struct since 6.x kernels don't have it.
- */
- off_address = kgdb_parse("&((struct linker_file *)0)->address");
- off_filename = kgdb_parse("&((struct linker_file *)0)->filename");
- off_pathname = kgdb_parse_quiet("&((struct linker_file *)0)->pathname");
- off_next = kgdb_parse("&((struct linker_file *)0)->link.tqe_next");
- module_path_addr = kgdb_parse("linker_path");
- linker_files_addr = kgdb_parse("&linker_files.tqh_first");
- kernel_file_addr = kgdb_parse("&linker_kernel_file");
-}
-
-static int
-load_klds_stub (void *arg)
-{
-
- SOLIB_ADD(NULL, 1, &current_target, auto_solib_add);
- return (0);
-}
-
-void
-kld_init (void)
-{
-
- catch_errors(load_klds_stub, NULL, NULL, RETURN_MASK_ALL);
-}
-
-void
-initialize_kld_target(void)
-{
- struct cmd_list_element *c;
-
- kld_so_ops.relocate_section_addresses = kld_relocate_section_addresses;
- kld_so_ops.free_so = kld_free_so;
- kld_so_ops.clear_solib = kld_clear_solib;
- kld_so_ops.solib_create_inferior_hook = kld_solib_create_inferior_hook;
- kld_so_ops.special_symbol_handling = kld_special_symbol_handling;
- kld_so_ops.current_sos = kld_current_sos;
- kld_so_ops.open_symbol_file_object = kld_open_symbol_file_object;
- kld_so_ops.in_dynsym_resolve_code = kld_in_dynsym_resolve_code;
- kld_so_ops.find_and_open_solib = kld_find_and_open_solib;
-
- current_target_so_ops = &kld_so_ops;
-
- c = add_com("add-kld", class_files, kgdb_add_kld_cmd,
- "Usage: add-kld FILE\n\
-Load the symbols from the kernel loadable module FILE.");
- set_cmd_completer(c, filename_completer);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/kthr.c b/gnu/usr.bin/gdb/kgdb/kthr.c
deleted file mode 100644
index 1bc95cb18b369..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/kthr.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/cpuset.h>
-#include <sys/proc.h>
-#include <sys/types.h>
-#include <sys/signal.h>
-#include <err.h>
-#include <inttypes.h>
-#include <kvm.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <defs.h>
-#include <frame-unwind.h>
-
-#include "kgdb.h"
-
-static CORE_ADDR dumppcb;
-static int dumptid;
-
-static cpuset_t stopped_cpus;
-
-static struct kthr *first;
-struct kthr *curkthr;
-
-CORE_ADDR
-kgdb_lookup(const char *sym)
-{
- CORE_ADDR addr;
- char *name;
-
- asprintf(&name, "&%s", sym);
- addr = kgdb_parse(name);
- free(name);
- return (addr);
-}
-
-struct kthr *
-kgdb_thr_first(void)
-{
- return (first);
-}
-
-static void
-kgdb_thr_add_procs(uintptr_t paddr)
-{
- struct proc p;
- struct thread td;
- struct kthr *kt;
- CORE_ADDR addr;
-
- while (paddr != 0) {
- if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- break;
- }
- addr = (uintptr_t)TAILQ_FIRST(&p.p_threads);
- while (addr != 0) {
- if (kvm_read(kvm, addr, &td, sizeof(td)) !=
- sizeof(td)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- break;
- }
- kt = malloc(sizeof(*kt));
- kt->next = first;
- kt->kaddr = addr;
- if (td.td_tid == dumptid)
- kt->pcb = dumppcb;
- else if (td.td_oncpu != NOCPU &&
- CPU_ISSET(td.td_oncpu, &stopped_cpus))
- kt->pcb = kgdb_trgt_core_pcb(td.td_oncpu);
- else
- kt->pcb = (uintptr_t)td.td_pcb;
- kt->kstack = td.td_kstack;
- kt->tid = td.td_tid;
- kt->pid = p.p_pid;
- kt->paddr = paddr;
- kt->cpu = td.td_oncpu;
- first = kt;
- addr = (uintptr_t)TAILQ_NEXT(&td, td_plist);
- }
- paddr = (uintptr_t)LIST_NEXT(&p, p_list);
- }
-}
-
-struct kthr *
-kgdb_thr_init(void)
-{
- long cpusetsize;
- struct kthr *kt;
- CORE_ADDR addr;
- uintptr_t paddr;
-
- while (first != NULL) {
- kt = first;
- first = kt->next;
- free(kt);
- }
-
- addr = kgdb_lookup("allproc");
- if (addr == 0)
- return (NULL);
- kvm_read(kvm, addr, &paddr, sizeof(paddr));
-
- dumppcb = kgdb_lookup("dumppcb");
- if (dumppcb == 0)
- return (NULL);
-
- addr = kgdb_lookup("dumptid");
- if (addr != 0)
- kvm_read(kvm, addr, &dumptid, sizeof(dumptid));
- else
- dumptid = -1;
-
- addr = kgdb_lookup("stopped_cpus");
- CPU_ZERO(&stopped_cpus);
- cpusetsize = sysconf(_SC_CPUSET_SIZE);
- if (cpusetsize != -1 && (u_long)cpusetsize <= sizeof(cpuset_t) &&
- addr != 0)
- kvm_read(kvm, addr, &stopped_cpus, cpusetsize);
-
- kgdb_thr_add_procs(paddr);
- addr = kgdb_lookup("zombproc");
- if (addr != 0) {
- kvm_read(kvm, addr, &paddr, sizeof(paddr));
- kgdb_thr_add_procs(paddr);
- }
- curkthr = kgdb_thr_lookup_tid(dumptid);
- if (curkthr == NULL)
- curkthr = first;
- return (first);
-}
-
-struct kthr *
-kgdb_thr_lookup_tid(int tid)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->tid != tid)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_lookup_taddr(uintptr_t taddr)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->kaddr != taddr)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_lookup_pid(int pid)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->pid != pid)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_lookup_paddr(uintptr_t paddr)
-{
- struct kthr *kt;
-
- kt = first;
- while (kt != NULL && kt->paddr != paddr)
- kt = kt->next;
- return (kt);
-}
-
-struct kthr *
-kgdb_thr_next(struct kthr *kt)
-{
- return (kt->next);
-}
-
-struct kthr *
-kgdb_thr_select(struct kthr *kt)
-{
- struct kthr *pcur;
-
- pcur = curkthr;
- curkthr = kt;
- return (pcur);
-}
-
-char *
-kgdb_thr_extra_thread_info(int tid)
-{
- char comm[MAXCOMLEN + 1];
- char td_name[MAXCOMLEN + 1];
- struct kthr *kt;
- struct proc *p;
- struct thread *t;
- static char buf[64];
-
- kt = kgdb_thr_lookup_tid(tid);
- if (kt == NULL)
- return (NULL);
- snprintf(buf, sizeof(buf), "PID=%d", kt->pid);
- p = (struct proc *)kt->paddr;
- if (kvm_read(kvm, (uintptr_t)&p->p_comm[0], &comm, sizeof(comm)) !=
- sizeof(comm))
- return (buf);
- strlcat(buf, ": ", sizeof(buf));
- strlcat(buf, comm, sizeof(buf));
- t = (struct thread *)kt->kaddr;
- if (kvm_read(kvm, (uintptr_t)&t->td_name[0], &td_name,
- sizeof(td_name)) == sizeof(td_name) &&
- strcmp(comm, td_name) != 0) {
- strlcat(buf, "/", sizeof(buf));
- strlcat(buf, td_name, sizeof(buf));
- }
- return (buf);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/main.c b/gnu/usr.bin/gdb/kgdb/main.c
deleted file mode 100644
index a1da89314a0e8..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/main.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/resource.h>
-#include <sys/select.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <err.h>
-#include <inttypes.h>
-#include <kvm.h>
-#include <limits.h>
-#include <paths.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* libgdb stuff. */
-#include <defs.h>
-#include <frame.h>
-#include <frame-unwind.h>
-#include <inferior.h>
-#include <interps.h>
-#include <cli-out.h>
-#include <main.h>
-#include <objfiles.h>
-#include <target.h>
-#include <top.h>
-#include <ui-file.h>
-#include <bfd.h>
-#include <gdbcore.h>
-#include <wrapper.h>
-
-extern frame_unwind_sniffer_ftype *kgdb_sniffer_kluge;
-
-#include "kgdb.h"
-
-static int dumpnr;
-static int quiet;
-static int verbose;
-
-static char crashdir[PATH_MAX];
-static char *kernel;
-static char *remote;
-static char *vmcore;
-static struct ui_file *parse_gdberr;
-
-static void (*kgdb_new_objfile_chain)(struct objfile * objfile);
-
-static void
-usage(void)
-{
-
- fprintf(stderr,
- "usage: %s [-afqvw] [-b rate] [-d crashdir] [-c core | -n dumpnr | -r device]\n"
- "\t[kernel [core]]\n", getprogname());
- exit(1);
-}
-
-static void
-kernel_from_dumpnr(int nr)
-{
- char path[PATH_MAX];
- FILE *info;
- char *s;
- struct stat st;
- int l;
-
- /*
- * If there's a kernel image right here in the crash directory, then
- * use it. The kernel image is either called kernel.<nr> or is in a
- * subdirectory kernel.<nr> and called kernel. The latter allows us
- * to collect the modules in the same place.
- */
- snprintf(path, sizeof(path), "%s/kernel.%d", crashdir, nr);
- if (stat(path, &st) == 0) {
- if (S_ISREG(st.st_mode)) {
- kernel = strdup(path);
- return;
- }
- if (S_ISDIR(st.st_mode)) {
- snprintf(path, sizeof(path), "%s/kernel.%d/kernel",
- crashdir, nr);
- if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
- kernel = strdup(path);
- return;
- }
- }
- }
-
- /*
- * No kernel image here. Parse the dump header. The kernel object
- * directory can be found there and we probably have the kernel
- * image still in it. The object directory may also have a kernel
- * with debugging info (called kernel.debug). If we have a debug
- * kernel, use it.
- */
- snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr);
- info = fopen(path, "r");
- if (info == NULL) {
- warn("%s", path);
- return;
- }
- while (fgets(path, sizeof(path), info) != NULL) {
- l = strlen(path);
- if (l > 0 && path[l - 1] == '\n')
- path[--l] = '\0';
- if (strncmp(path, " ", 4) == 0) {
- s = strchr(path, ':');
- s = (s == NULL) ? path + 4 : s + 1;
- l = snprintf(path, sizeof(path), "%s/kernel.debug", s);
- if (stat(path, &st) == -1 || !S_ISREG(st.st_mode)) {
- path[l - 6] = '\0';
- if (stat(path, &st) == -1 ||
- !S_ISREG(st.st_mode))
- break;
- }
- kernel = strdup(path);
- break;
- }
- }
- fclose(info);
-}
-
-static void
-kgdb_new_objfile(struct objfile *objfile)
-{
- static int once = 1;
-
- kld_new_objfile(objfile);
- kgdb_trgt_new_objfile(objfile);
-
- if (kgdb_new_objfile_chain != NULL)
- kgdb_new_objfile_chain(objfile);
-
- if (once && objfile != NULL && objfile == symfile_objfile) {
- /*
- * The initial kernel has just been loaded. Start the
- * remote target if we have one.
- */
- once = 0;
- if (remote != NULL)
- push_remote_target (remote, 0);
- }
-}
-
-/*
- * Parse an expression and return its value. If 'quiet' is true, then
- * any error messages from the parser are masked.
- */
-CORE_ADDR
-kgdb_parse_1(const char *exp, int quiet)
-{
- struct ui_file *old_stderr;
- struct cleanup *old_chain;
- struct expression *expr;
- struct value *val;
- char *s;
- CORE_ADDR n;
-
- old_stderr = gdb_stderr;
- if (quiet)
- gdb_stderr = parse_gdberr;
- n = 0;
- s = xstrdup(exp);
- old_chain = make_cleanup(xfree, s);
- if (gdb_parse_exp_1(&s, NULL, 0, &expr) && *s == '\0') {
- make_cleanup(free_current_contents, &expr);
- if (gdb_evaluate_expression(expr, &val))
- n = value_as_address(val);
- }
- do_cleanups(old_chain);
- gdb_stderr = old_stderr;
- return (n);
-}
-
-#define MSGBUF_SEQ_TO_POS(size, seq) ((seq) % (size))
-
-void
-kgdb_dmesg(void)
-{
- CORE_ADDR bufp;
- int size, rseq, wseq;
- char c;
-
- /*
- * Display the unread portion of the message buffer. This gives the
- * user a some initial data to work from.
- */
- if (quiet)
- return;
- bufp = kgdb_parse("msgbufp->msg_ptr");
- size = (int)kgdb_parse("msgbufp->msg_size");
- if (bufp == 0 || size == 0)
- return;
- rseq = (int)kgdb_parse("msgbufp->msg_rseq");
- wseq = (int)kgdb_parse("msgbufp->msg_wseq");
- rseq = MSGBUF_SEQ_TO_POS(size, rseq);
- wseq = MSGBUF_SEQ_TO_POS(size, wseq);
- if (rseq == wseq)
- return;
-
- printf("\nUnread portion of the kernel message buffer:\n");
- while (rseq < wseq) {
- read_memory(bufp + rseq, &c, 1);
- putchar(c);
- rseq++;
- if (rseq == size)
- rseq = 0;
- }
- if (c != '\n')
- putchar('\n');
- putchar('\n');
-}
-
-static void
-kgdb_init(char *argv0 __unused)
-{
-
- parse_gdberr = mem_fileopen();
- set_prompt("(kgdb) ");
- initialize_kgdb_target();
- initialize_kld_target();
- kgdb_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = kgdb_new_objfile;
-}
-
-/*
- * Remote targets can support any number of syntaxes and we want to
- * support them all with one addition: we support specifying a device
- * node for a serial device without the "/dev/" prefix.
- *
- * What we do is to stat(2) the existing remote target first. If that
- * fails, we try it with "/dev/" prepended. If that succeeds we use
- * the resulting path, otherwise we use the original target. If
- * either stat(2) succeeds make sure the file is either a character
- * device or a FIFO.
- */
-static void
-verify_remote(void)
-{
- char path[PATH_MAX];
- struct stat st;
-
- if (stat(remote, &st) != 0) {
- snprintf(path, sizeof(path), "/dev/%s", remote);
- if (stat(path, &st) != 0)
- return;
- free(remote);
- remote = strdup(path);
- }
- if (!S_ISCHR(st.st_mode) && !S_ISFIFO(st.st_mode))
- errx(1, "%s: not a special file, FIFO or socket", remote);
-}
-
-static void
-add_arg(struct captured_main_args *args, char *arg)
-{
-
- args->argc++;
- args->argv = reallocf(args->argv, (args->argc + 1) * sizeof(char *));
- if (args->argv == NULL)
- err(1, "Out of memory building argument list");
- args->argv[args->argc] = arg;
-}
-
-int
-main(int argc, char *argv[])
-{
- char path[PATH_MAX];
- struct stat st;
- struct captured_main_args args;
- char *s;
- int a, ch;
-
- dumpnr = -1;
-
- strlcpy(crashdir, "/var/crash", sizeof(crashdir));
- s = getenv("KGDB_CRASH_DIR");
- if (s != NULL)
- strlcpy(crashdir, s, sizeof(crashdir));
-
- /* Convert long options into short options. */
- for (a = 1; a < argc; a++) {
- s = argv[a];
- if (s[0] == '-') {
- s++;
- /* Long options take either 1 or 2 dashes. */
- if (s[0] == '-')
- s++;
- if (strcmp(s, "quiet") == 0)
- argv[a] = "-q";
- else if (strcmp(s, "fullname") == 0)
- argv[a] = "-f";
- }
- }
-
- quiet = 0;
- memset (&args, 0, sizeof args);
- args.use_windows = 0;
- args.interpreter_p = INTERP_CONSOLE;
- args.argv = malloc(sizeof(char *));
- args.argv[0] = argv[0];
-
- while ((ch = getopt(argc, argv, "ab:c:d:fn:qr:vw")) != -1) {
- switch (ch) {
- case 'a':
- annotation_level++;
- break;
- case 'b': {
- int i;
- char *p;
-
- i = strtol(optarg, &p, 0);
- if (*p != '\0' || p == optarg)
- warnx("warning: could not set baud rate to `%s'.\n",
- optarg);
- else
- baud_rate = i;
- break;
- }
- case 'c': /* use given core file. */
- if (vmcore != NULL) {
- warnx("option %c: can only be specified once",
- optopt);
- usage();
- /* NOTREACHED */
- }
- vmcore = strdup(optarg);
- break;
- case 'd': /* lookup dumps in given directory. */
- strlcpy(crashdir, optarg, sizeof(crashdir));
- break;
- case 'f':
- annotation_level = 1;
- break;
- case 'n': /* use dump with given number. */
- dumpnr = strtol(optarg, &s, 0);
- if (dumpnr < 0 || *s != '\0') {
- warnx("option %c: invalid kernel dump number",
- optopt);
- usage();
- /* NOTREACHED */
- }
- break;
- case 'q':
- quiet = 1;
- add_arg(&args, "-q");
- break;
- case 'r': /* use given device for remote session. */
- if (remote != NULL) {
- warnx("option %c: can only be specified once",
- optopt);
- usage();
- /* NOTREACHED */
- }
- remote = strdup(optarg);
- break;
- case 'v': /* increase verbosity. */
- verbose++;
- break;
- case 'w': /* core file is writeable. */
- add_arg(&args, "--write");
- break;
- case '?':
- default:
- usage();
- }
- }
-
- if (((vmcore != NULL) ? 1 : 0) + ((dumpnr >= 0) ? 1 : 0) +
- ((remote != NULL) ? 1 : 0) > 1) {
- warnx("options -c, -n and -r are mutually exclusive");
- usage();
- /* NOTREACHED */
- }
-
- if (verbose > 1)
- warnx("using %s as the crash directory", crashdir);
-
- if (argc > optind)
- kernel = strdup(argv[optind++]);
-
- if (argc > optind && (dumpnr >= 0 || remote != NULL)) {
- warnx("options -n and -r do not take a core file. Ignored");
- optind = argc;
- }
-
- if (dumpnr >= 0) {
- snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr);
- if (stat(path, &st) == -1)
- err(1, "%s", path);
- if (!S_ISREG(st.st_mode))
- errx(1, "%s: not a regular file", path);
- vmcore = strdup(path);
- } else if (remote != NULL) {
- verify_remote();
- } else if (argc > optind) {
- if (vmcore == NULL)
- vmcore = strdup(argv[optind++]);
- if (argc > optind)
- warnx("multiple core files specified. Ignored");
- } else if (vmcore == NULL && kernel == NULL) {
- vmcore = strdup(_PATH_MEM);
- kernel = strdup(getbootfile());
- }
-
- if (verbose) {
- if (vmcore != NULL)
- warnx("core file: %s", vmcore);
- if (remote != NULL)
- warnx("device file: %s", remote);
- if (kernel != NULL)
- warnx("kernel image: %s", kernel);
- }
-
- /* A remote target requires an explicit kernel argument. */
- if (remote != NULL && kernel == NULL) {
- warnx("remote debugging requires a kernel");
- usage();
- /* NOTREACHED */
- }
-
- /* If we don't have a kernel image yet, try to find one. */
- if (kernel == NULL) {
- if (dumpnr >= 0)
- kernel_from_dumpnr(dumpnr);
-
- if (kernel == NULL)
- errx(1, "couldn't find a suitable kernel image");
- if (verbose)
- warnx("kernel image: %s", kernel);
- }
- add_arg(&args, kernel);
-
- if (vmcore != NULL)
- add_arg(&args, vmcore);
-
- /* The libgdb code uses optind too. Reset it... */
- optind = 0;
-
- /* Terminate argv list. */
- add_arg(&args, NULL);
-
- init_ui_hook = kgdb_init;
- frame_tdep_pc_fixup = kgdb_trgt_pc_fixup;
- kgdb_sniffer_kluge = kgdb_trgt_trapframe_sniffer;
-
- return (gdb_main(&args));
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
deleted file mode 100644
index 56c64b8fe47bf..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <err.h>
-#include <fcntl.h>
-#include <kvm.h>
-
-#include <defs.h>
-#include <readline/readline.h>
-#include <command.h>
-#include <exec.h>
-#include <frame-unwind.h>
-#include <gdb.h>
-#include <gdbcore.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <language.h>
-#include <regcache.h>
-#include <solib.h>
-#include <target.h>
-#include <ui-out.h>
-
-#include "kgdb.h"
-
-#ifdef CROSS_DEBUGGER
-/*
- * We suppress the call to add_target() of core_ops in corelow.c because if
- * there are multiple core_stratum targets, the find_core_target() function
- * won't know which one to return and returns none. We need it to return
- * our target. We only have to do that when we're building a cross-debugger
- * because fbsd-threads.c is part of a native debugger and it too defines
- * coreops_suppress_target with 1 as the initializer.
- */
-int coreops_suppress_target = 1;
-#endif
-
-static CORE_ADDR stoppcbs;
-
-static void kgdb_core_cleanup(void *);
-
-static char *vmcore;
-static struct target_ops kgdb_trgt_ops;
-
-kvm_t *kvm;
-static char kvm_err[_POSIX2_LINE_MAX];
-
-#define KERNOFF (kgdb_kernbase ())
-#define PINKERNEL(x) ((x) >= KERNOFF)
-
-static int
-kgdb_resolve_symbol(const char *name, kvaddr_t *kva)
-{
- struct minimal_symbol *ms;
-
- ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
- return (1);
-
- *kva = SYMBOL_VALUE_ADDRESS (ms);
- return (0);
-}
-
-static CORE_ADDR
-kgdb_kernbase (void)
-{
- static CORE_ADDR kernbase;
- struct minimal_symbol *sym;
-
- if (kernbase == 0) {
- sym = lookup_minimal_symbol ("kernbase", NULL, NULL);
- if (sym == NULL) {
- kernbase = KERNBASE;
- } else {
- kernbase = SYMBOL_VALUE_ADDRESS (sym);
- }
- }
- return kernbase;
-}
-
-static void
-kgdb_trgt_open(char *filename, int from_tty)
-{
- struct cleanup *old_chain;
- struct thread_info *ti;
- struct kthr *kt;
- kvm_t *nkvm;
- char *temp;
- int ontop;
-
- target_preopen (from_tty);
- if (!filename)
- error ("No vmcore file specified.");
- if (!exec_bfd)
- error ("Can't open a vmcore without a kernel");
-
- filename = tilde_expand (filename);
- if (filename[0] != '/') {
- temp = concat (current_directory, "/", filename, NULL);
- xfree(filename);
- filename = temp;
- }
-
- old_chain = make_cleanup (xfree, filename);
-
- nkvm = kvm_open2(bfd_get_filename(exec_bfd), filename,
- write_files ? O_RDWR : O_RDONLY, kvm_err, kgdb_resolve_symbol);
- if (nkvm == NULL)
- error ("Failed to open vmcore: %s", kvm_err);
-
- /* Don't free the filename now and close any previous vmcore. */
- discard_cleanups(old_chain);
- unpush_target(&kgdb_trgt_ops);
-
- kvm = nkvm;
- vmcore = filename;
- old_chain = make_cleanup(kgdb_core_cleanup, NULL);
-
- ontop = !push_target (&kgdb_trgt_ops);
- discard_cleanups (old_chain);
-
- kgdb_dmesg();
-
- init_thread_list();
- kt = kgdb_thr_init();
- while (kt != NULL) {
- ti = add_thread(pid_to_ptid(kt->tid));
- kt = kgdb_thr_next(kt);
- }
- if (curkthr != 0)
- inferior_ptid = pid_to_ptid(curkthr->tid);
-
- if (ontop) {
- /* XXX: fetch registers? */
- kld_init();
- flush_cached_frames();
- select_frame (get_current_frame());
- print_stack_frame(get_selected_frame(),
- frame_relative_level(get_selected_frame()), 1);
- } else
- warning(
- "you won't be able to access this vmcore until you terminate\n\
-your %s; do ``info files''", target_longname);
-}
-
-static void
-kgdb_trgt_close(int quitting)
-{
-
- if (kvm != NULL) {
- inferior_ptid = null_ptid;
- CLEAR_SOLIB();
- if (kvm_close(kvm) != 0)
- warning("cannot close \"%s\": %s", vmcore,
- kvm_geterr(kvm));
- kvm = NULL;
- xfree(vmcore);
- vmcore = NULL;
- if (kgdb_trgt_ops.to_sections) {
- xfree(kgdb_trgt_ops.to_sections);
- kgdb_trgt_ops.to_sections = NULL;
- kgdb_trgt_ops.to_sections_end = NULL;
- }
- }
-}
-
-static void
-kgdb_core_cleanup(void *arg)
-{
-
- kgdb_trgt_close(0);
-}
-
-static void
-kgdb_trgt_detach(char *args, int from_tty)
-{
-
- if (args)
- error ("Too many arguments");
- unpush_target(&kgdb_trgt_ops);
- reinit_frame_cache();
- if (from_tty)
- printf_filtered("No vmcore file now.\n");
-}
-
-static char *
-kgdb_trgt_extra_thread_info(struct thread_info *ti)
-{
-
- return (kgdb_thr_extra_thread_info(ptid_get_pid(ti->ptid)));
-}
-
-static void
-kgdb_trgt_files_info(struct target_ops *target)
-{
-
- printf_filtered ("\t`%s', ", vmcore);
- wrap_here (" ");
- printf_filtered ("file type %s.\n", "FreeBSD kernel vmcore");
-}
-
-static void
-kgdb_trgt_find_new_threads(void)
-{
- struct target_ops *tb;
-
- if (kvm != NULL)
- return;
-
- tb = find_target_beneath(&kgdb_trgt_ops);
- if (tb->to_find_new_threads != NULL)
- tb->to_find_new_threads();
-}
-
-static char *
-kgdb_trgt_pid_to_str(ptid_t ptid)
-{
- static char buf[33];
-
- snprintf(buf, sizeof(buf), "Thread %d", ptid_get_pid(ptid));
- return (buf);
-}
-
-static int
-kgdb_trgt_thread_alive(ptid_t ptid)
-{
- return (kgdb_thr_lookup_tid(ptid_get_pid(ptid)) != NULL);
-}
-
-static int
-kgdb_trgt_xfer_memory(CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- struct target_ops *tb;
-
- if (kvm != NULL) {
- if (len == 0)
- return (0);
- if (!write)
- return (kvm_read2(kvm, memaddr, myaddr, len));
- else
- return (kvm_write(kvm, memaddr, myaddr, len));
- }
- tb = find_target_beneath(target);
- return (tb->to_xfer_memory(memaddr, myaddr, len, write, attrib, tb));
-}
-
-static int
-kgdb_trgt_ignore_breakpoints(CORE_ADDR addr, char *contents)
-{
-
- return 0;
-}
-
-static void
-kgdb_switch_to_thread(int tid)
-{
- char buf[16];
- int thread_id;
-
- thread_id = pid_to_thread_id(pid_to_ptid(tid));
- if (thread_id == 0)
- error ("invalid tid");
- snprintf(buf, sizeof(buf), "%d", thread_id);
- gdb_thread_select(uiout, buf);
-}
-
-static void
-kgdb_set_proc_cmd (char *arg, int from_tty)
-{
- CORE_ADDR addr;
- struct kthr *thr;
-
- if (!arg)
- error_no_arg ("proc address for the new context");
-
- if (kvm == NULL)
- error ("only supported for core file target");
-
- addr = (CORE_ADDR) parse_and_eval_address (arg);
-
- if (!PINKERNEL (addr)) {
- thr = kgdb_thr_lookup_pid((int)addr);
- if (thr == NULL)
- error ("invalid pid");
- } else {
- thr = kgdb_thr_lookup_paddr(addr);
- if (thr == NULL)
- error("invalid proc address");
- }
- kgdb_switch_to_thread(thr->tid);
-}
-
-static void
-kgdb_set_tid_cmd (char *arg, int from_tty)
-{
- CORE_ADDR addr;
- struct kthr *thr;
-
- if (!arg)
- error_no_arg ("TID or thread address for the new context");
-
- addr = (CORE_ADDR) parse_and_eval_address (arg);
-
- if (kvm != NULL && PINKERNEL (addr)) {
- thr = kgdb_thr_lookup_taddr(addr);
- if (thr == NULL)
- error("invalid thread address");
- addr = thr->tid;
- }
- kgdb_switch_to_thread(addr);
-}
-
-int fbsdcoreops_suppress_target = 1;
-
-void
-initialize_kgdb_target(void)
-{
-
- kgdb_trgt_ops.to_magic = OPS_MAGIC;
- kgdb_trgt_ops.to_shortname = "kernel";
- kgdb_trgt_ops.to_longname = "kernel core dump file";
- kgdb_trgt_ops.to_doc =
- "Use a vmcore file as a target. Specify the filename of the vmcore file.";
- kgdb_trgt_ops.to_stratum = core_stratum;
- kgdb_trgt_ops.to_has_memory = 1;
- kgdb_trgt_ops.to_has_registers = 1;
- kgdb_trgt_ops.to_has_stack = 1;
-
- kgdb_trgt_ops.to_open = kgdb_trgt_open;
- kgdb_trgt_ops.to_close = kgdb_trgt_close;
- kgdb_trgt_ops.to_attach = find_default_attach;
- kgdb_trgt_ops.to_detach = kgdb_trgt_detach;
- kgdb_trgt_ops.to_extra_thread_info = kgdb_trgt_extra_thread_info;
- kgdb_trgt_ops.to_fetch_registers = kgdb_trgt_fetch_registers;
- kgdb_trgt_ops.to_files_info = kgdb_trgt_files_info;
- kgdb_trgt_ops.to_find_new_threads = kgdb_trgt_find_new_threads;
- kgdb_trgt_ops.to_pid_to_str = kgdb_trgt_pid_to_str;
- kgdb_trgt_ops.to_store_registers = kgdb_trgt_store_registers;
- kgdb_trgt_ops.to_thread_alive = kgdb_trgt_thread_alive;
- kgdb_trgt_ops.to_xfer_memory = kgdb_trgt_xfer_memory;
- kgdb_trgt_ops.to_insert_breakpoint = kgdb_trgt_ignore_breakpoints;
- kgdb_trgt_ops.to_remove_breakpoint = kgdb_trgt_ignore_breakpoints;
-
- add_target(&kgdb_trgt_ops);
-
- add_com ("proc", class_obscure, kgdb_set_proc_cmd,
- "Set current process context");
- add_com ("tid", class_obscure, kgdb_set_tid_cmd,
- "Set current thread context");
-}
-
-CORE_ADDR
-kgdb_trgt_stop_pcb(u_int cpuid, u_int pcbsz)
-{
- static int once = 0;
-
- if (stoppcbs == 0 && !once) {
- once = 1;
- stoppcbs = kgdb_lookup("stoppcbs");
- }
- if (stoppcbs == 0)
- return 0;
-
- return (stoppcbs + pcbsz * cpuid);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_amd64.c b/gnu/usr.bin/gdb/kgdb/trgt_amd64.c
deleted file mode 100644
index ec0ac01803384..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_amd64.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <amd64-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- supply_register(AMD64_RBX_REGNUM, (char *)&pcb.pcb_rbx);
- supply_register(AMD64_RBP_REGNUM, (char *)&pcb.pcb_rbp);
- supply_register(AMD64_RSP_REGNUM, (char *)&pcb.pcb_rsp);
- supply_register(AMD64_R8_REGNUM + 4, (char *)&pcb.pcb_r12);
- supply_register(AMD64_R8_REGNUM + 5, (char *)&pcb.pcb_r13);
- supply_register(AMD64_R8_REGNUM + 6, (char *)&pcb.pcb_r14);
- supply_register(AMD64_R15_REGNUM, (char *)&pcb.pcb_r15);
- supply_register(AMD64_RIP_REGNUM, (char *)&pcb.pcb_rip);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static int kgdb_trgt_frame_offset[20] = {
- offsetof(struct trapframe, tf_rax),
- offsetof(struct trapframe, tf_rbx),
- offsetof(struct trapframe, tf_rcx),
- offsetof(struct trapframe, tf_rdx),
- offsetof(struct trapframe, tf_rsi),
- offsetof(struct trapframe, tf_rdi),
- offsetof(struct trapframe, tf_rbp),
- offsetof(struct trapframe, tf_rsp),
- offsetof(struct trapframe, tf_r8),
- offsetof(struct trapframe, tf_r9),
- offsetof(struct trapframe, tf_r10),
- offsetof(struct trapframe, tf_r11),
- offsetof(struct trapframe, tf_r12),
- offsetof(struct trapframe, tf_r13),
- offsetof(struct trapframe, tf_r14),
- offsetof(struct trapframe, tf_r15),
- offsetof(struct trapframe, tf_rip),
- offsetof(struct trapframe, tf_rflags),
- offsetof(struct trapframe, tf_cs),
- offsetof(struct trapframe, tf_ss)
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= AMD64_RAX_REGNUM && regnum <= AMD64_EFLAGS_REGNUM + 2)
- ? kgdb_trgt_frame_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "calltrap") == 0 ||
- strcmp(pname, "fast_syscall_common") == 0 ||
- strcmp(pname, "mchk_calltrap") == 0 ||
- strcmp(pname, "nmi_calltrap") == 0 ||
- (pname[0] == 'X' && pname[1] != '_'))
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %lx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_arm.c b/gnu/usr.bin/gdb/kgdb/trgt_arm.c
deleted file mode 100644
index 13111bc434690..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_arm.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#ifndef CROSS_DEBUGGER
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <machine/armreg.h>
-#endif
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <arm-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
-#ifndef CROSS_DEBUGGER
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-#else
- return -1;
-#endif
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
-#ifndef CROSS_DEBUGGER
- struct kthr *kt;
- struct pcb pcb;
- int i;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
- for (i = ARM_A1_REGNUM + 4; i <= ARM_SP_REGNUM; i++) {
- supply_register(i, (char *)&pcb.pcb_regs.sf_r4 +
- (i - (ARM_A1_REGNUM + 4 )) * 4);
- }
- supply_register(ARM_PC_REGNUM, (char *)&pcb.pcb_regs.sf_pc);
- supply_register(ARM_LR_REGNUM, (char *)&pcb.pcb_regs.sf_lr);
-#endif
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-#ifndef CROSS_DEBUGGER
-struct kgdb_frame_cache {
- CORE_ADDR fp;
- CORE_ADDR sp;
- CORE_ADDR pc;
-};
-
-static int kgdb_trgt_frame_offset[26] = {
- offsetof(struct trapframe, tf_r0),
- offsetof(struct trapframe, tf_r1),
- offsetof(struct trapframe, tf_r2),
- offsetof(struct trapframe, tf_r3),
- offsetof(struct trapframe, tf_r4),
- offsetof(struct trapframe, tf_r5),
- offsetof(struct trapframe, tf_r6),
- offsetof(struct trapframe, tf_r7),
- offsetof(struct trapframe, tf_r8),
- offsetof(struct trapframe, tf_r9),
- offsetof(struct trapframe, tf_r10),
- offsetof(struct trapframe, tf_r11),
- offsetof(struct trapframe, tf_r12),
- offsetof(struct trapframe, tf_svc_sp),
- offsetof(struct trapframe, tf_svc_lr),
- offsetof(struct trapframe, tf_pc),
- -1, -1, -1, -1, -1, -1, -1, -1, -1,
- offsetof(struct trapframe, tf_spsr)
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- frame_unwind_register(next_frame, ARM_SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, ARM_SP_REGNUM));
- frame_unwind_register(next_frame, ARM_FP_REGNUM, buf);
- cache->fp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, ARM_FP_REGNUM));
- cache->pc = frame_func_unwind(next_frame);
- }
- return (cache);
-}
-
-static int is_undef;
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
- CORE_ADDR sp;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= 0 && regnum <= ARM_PS_REGNUM)
- ? kgdb_trgt_frame_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- sp = cache->sp;
-
- ofs = kgdb_trgt_frame_offset[regnum];
- *addrp = sp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-#endif
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
-#ifndef CROSS_DEBUGGER
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL) {
- is_undef = 0;
- return (NULL);
- }
- if (!strcmp(pname, "undefinedinstruction"))
- is_undef = 1;
- if (strcmp(pname, "Laddress_exception_entry") == 0 ||
- strcmp(pname, "undefined_entry") == 0 ||
- strcmp(pname, "exception_exit") == 0 ||
- strcmp(pname, "Laddress_exception_msg") == 0 ||
- strcmp(pname, "irq_entry") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- if (!strcmp(pname, "undefinedinstruction"))
- is_undef = 1;
- else
- is_undef = 0;
-#endif
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc)
-{
-#ifndef CROSS_DEBUGGER
- struct minimal_symbol *msymbol;
- int valpc;
-
- /*
- * exception_exit and swi_exit are special. These functions
- * are artificially injected into the stack to be executed
- * as the last entry in calling chain when all functions exit.
- * Treat them differently.
- */
- msymbol = lookup_minimal_symbol_by_pc(*pc);
- if (msymbol != NULL) {
- if (strcmp(DEPRECATED_SYMBOL_NAME(msymbol), "exception_exit") == 0)
- return (0);
- if (strcmp(DEPRECATED_SYMBOL_NAME(msymbol), "swi_exit") == 0)
- return (0);
- }
-
- /*
- * kdb_enter contains an invalid instruction which is supposed
- * to generate a trap. BFD does not understand it and treats
- * this part of function as a separate function. Move PC
- * two instruction earlier to be inside kdb_enter section.
- */
- target_read_memory(*pc - 4, (char*)&valpc, 4);
- if (valpc == 0xe7ffffff) {
- *pc = *pc - 8;
- return (0);
- }
-
- /*
- * When the panic/vpanic is the last (noreturn) function,
- * the bottom of the calling function looks as below.
- * mov lr, pc
- * b panic
- * Normally, GDB is not able to detect function boundaries,
- * so move the PC two instruction earlier where it can deal
- * with it.
- * Match this pair of instructions: mov lr, pc followed with
- * non-linked branch.
- */
- if ((valpc & 0xff000000) == 0xea000000) {
- target_read_memory(*pc - 8, (char*)&valpc, 4);
- if (valpc == 0xe1a0e00f) {
- *pc -= 8;
- return (0);
- }
- }
-#endif
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_i386.c b/gnu/usr.bin/gdb/kgdb/trgt_i386.c
deleted file mode 100644
index b90eebaaf35e2..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_i386.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <machine/segments.h>
-#include <machine/tss.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <i386-tdep.h>
-
-#include "kgdb.h"
-
-static int ofs_fix;
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
- supply_register(I386_EBX_REGNUM, (char *)&pcb.pcb_ebx);
- supply_register(I386_ESP_REGNUM, (char *)&pcb.pcb_esp);
- supply_register(I386_EBP_REGNUM, (char *)&pcb.pcb_ebp);
- supply_register(I386_ESI_REGNUM, (char *)&pcb.pcb_esi);
- supply_register(I386_EDI_REGNUM, (char *)&pcb.pcb_edi);
- supply_register(I386_EIP_REGNUM, (char *)&pcb.pcb_eip);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-
- /*
- * In revision 1.117 of i386/i386/exception.S trap handlers
- * were changed to pass trapframes by reference rather than
- * by value. Detect this by seeing if the first instruction
- * at the 'calltrap' label is a "push %esp" which has the
- * opcode 0x54.
- */
- if (kgdb_parse("((char *)calltrap)[0]") == 0x54)
- ofs_fix = 4;
- else
- ofs_fix = 0;
-}
-
-struct kgdb_tss_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
- CORE_ADDR tss;
-};
-
-static int kgdb_trgt_tss_offset[15] = {
- offsetof(struct i386tss, tss_eax),
- offsetof(struct i386tss, tss_ecx),
- offsetof(struct i386tss, tss_edx),
- offsetof(struct i386tss, tss_ebx),
- offsetof(struct i386tss, tss_esp),
- offsetof(struct i386tss, tss_ebp),
- offsetof(struct i386tss, tss_esi),
- offsetof(struct i386tss, tss_edi),
- offsetof(struct i386tss, tss_eip),
- offsetof(struct i386tss, tss_eflags),
- offsetof(struct i386tss, tss_cs),
- offsetof(struct i386tss, tss_ss),
- offsetof(struct i386tss, tss_ds),
- offsetof(struct i386tss, tss_es),
- offsetof(struct i386tss, tss_fs)
-};
-
-/*
- * If the current thread is executing on a CPU, fetch the common_tss
- * for that CPU.
- *
- * This is painful because 'struct pcpu' is variant sized, so we can't
- * use it. Instead, we lookup the GDT selector for this CPU and
- * extract the base of the TSS from there.
- */
-static CORE_ADDR
-kgdb_trgt_fetch_tss(void)
-{
- struct kthr *kt;
- struct segment_descriptor sd;
- uintptr_t addr, cpu0prvpage, tss;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL || kt->cpu == NOCPU || kt->cpu < 0)
- return (0);
-
- addr = kgdb_lookup("gdt");
- if (addr == 0)
- return (0);
- addr += (kt->cpu * NGDT + GPROC0_SEL) * sizeof(sd);
- if (kvm_read(kvm, addr, &sd, sizeof(sd)) != sizeof(sd)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- return (0);
- }
- if (sd.sd_type != SDT_SYS386BSY) {
- warnx("descriptor is not a busy TSS");
- return (0);
- }
- tss = sd.sd_hibase << 24 | sd.sd_lobase;
-
- /*
- * In SMP kernels, the TSS is stored as part of the per-CPU
- * data. On older kernels, the CPU0's private page
- * is stored at an address that isn't mapped in minidumps.
- * However, the data is mapped at the alternate cpu0prvpage
- * address. Thus, if the TSS is at the invalid address,
- * change it to be relative to cpu0prvpage instead.
- */
- if (trunc_page(tss) == 0xffc00000) {
- addr = kgdb_lookup("cpu0prvpage");
- if (addr == 0)
- return (0);
- if (kvm_read(kvm, addr, &cpu0prvpage, sizeof(cpu0prvpage)) !=
- sizeof(cpu0prvpage)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- return (0);
- }
- tss = cpu0prvpage + (tss & PAGE_MASK);
- }
- return ((CORE_ADDR)tss);
-}
-
-static struct kgdb_tss_cache *
-kgdb_trgt_tss_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_tss_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_tss_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- cache->tss = kgdb_trgt_fetch_tss();
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_dblfault_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_tss_cache *cache;
-
- cache = kgdb_trgt_tss_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_dblfault_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_tss_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= I386_EAX_REGNUM && regnum <= I386_FS_REGNUM)
- ? kgdb_trgt_tss_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_tss_cache(next_frame, this_cache);
- if (cache->tss == 0)
- return;
- *addrp = cache->tss + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_dblfault_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_dblfault_this_id,
- &kgdb_trgt_dblfault_prev_register
-};
-
-struct kgdb_frame_cache {
- int frame_type;
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-#define FT_NORMAL 1
-#define FT_INTRFRAME 2
-#define FT_INTRTRAPFRAME 3
-#define FT_TIMERFRAME 4
-
-static int kgdb_trgt_frame_offset[15] = {
- offsetof(struct trapframe, tf_eax),
- offsetof(struct trapframe, tf_ecx),
- offsetof(struct trapframe, tf_edx),
- offsetof(struct trapframe, tf_ebx),
- offsetof(struct trapframe, tf_esp),
- offsetof(struct trapframe, tf_ebp),
- offsetof(struct trapframe, tf_esi),
- offsetof(struct trapframe, tf_edi),
- offsetof(struct trapframe, tf_eip),
- offsetof(struct trapframe, tf_eflags),
- offsetof(struct trapframe, tf_cs),
- offsetof(struct trapframe, tf_ss),
- offsetof(struct trapframe, tf_ds),
- offsetof(struct trapframe, tf_es),
- offsetof(struct trapframe, tf_fs)
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- char *pname;
- CORE_ADDR pcx;
- uintptr_t addr, setidt_disp;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- pcx = frame_pc_unwind(next_frame);
- if (pcx >= PMAP_TRM_MIN_ADDRESS) {
- addr = kgdb_lookup("setidt_disp");
- if (addr != 0) {
- if (kvm_read(kvm, addr, &setidt_disp,
- sizeof(setidt_disp)) !=
- sizeof(setidt_disp))
- warnx("kvm_read: %s", kvm_geterr(kvm));
- else
- pcx -= setidt_disp;
- }
- }
- cache->pc = pcx;
- find_pc_partial_function(cache->pc, &pname, NULL, NULL);
- if (pname[0] != 'X')
- cache->frame_type = FT_NORMAL;
- else if (strcmp(pname, "Xtimerint") == 0)
- cache->frame_type = FT_TIMERFRAME;
- else if (strcmp(pname, "Xcpustop") == 0 ||
- strcmp(pname, "Xrendezvous") == 0 ||
- strcmp(pname, "Xipi_intr_bitmap_handler") == 0 ||
- strcmp(pname, "Xlazypmap") == 0)
- cache->frame_type = FT_INTRTRAPFRAME;
- else
- cache->frame_type = FT_INTRFRAME;
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= I386_EAX_REGNUM && regnum <= I386_FS_REGNUM)
- ? kgdb_trgt_frame_offset[regnum] + ofs_fix : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- switch (cache->frame_type) {
- case FT_NORMAL:
- break;
- case FT_INTRFRAME:
- ofs += 4;
- break;
- case FT_TIMERFRAME:
- break;
- case FT_INTRTRAPFRAME:
- ofs -= ofs_fix;
- break;
- default:
- fprintf_unfiltered(gdb_stderr, "Correct FT_XXX frame offsets "
- "for %d\n", cache->frame_type);
- break;
- }
- *addrp = cache->sp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- if (pc >= PMAP_TRM_MIN_ADDRESS)
- return (&kgdb_trgt_trapframe_unwind);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "dblfault_handler") == 0)
- return (&kgdb_trgt_dblfault_unwind);
- if (strcmp(pname, "calltrap") == 0 ||
- (pname[0] == 'X' && pname[1] != '_'))
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %llx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_mips.c b/gnu/usr.bin/gdb/kgdb/trgt_mips.c
deleted file mode 100644
index 17ea6fe4ca1a2..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_mips.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2007 Juniper Networks, Inc.
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * from: src/gnu/usr.bin/gdb/kgdb/trgt_alpha.c,v 1.2.2.1 2005/09/15 05:32:10 marcel
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/asm.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <mips-tdep.h>
-
-#ifndef CROSS_DEBUGGER
-#include <machine/pcb.h>
-#endif
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
-#ifndef CROSS_DEBUGGER
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S0]);
- supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S1]);
- supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S2]);
- supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S3]);
- supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S4]);
- supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S5]);
- supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S6]);
- supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S7]);
- supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_SP]);
- supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]);
- supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]);
- supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]);
-#endif
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
-
- fprintf_unfiltered(gdb_stderr, "Unimplemented function: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-#ifndef CROSS_DEBUGGER
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static int kgdb_trgt_frame_offset[] = {
- offsetof(struct trapframe, zero),
- offsetof(struct trapframe, ast),
- offsetof(struct trapframe, v0),
- offsetof(struct trapframe, v1),
- offsetof(struct trapframe, a0),
- offsetof(struct trapframe, a1),
- offsetof(struct trapframe, a2),
- offsetof(struct trapframe, a3),
-#if defined(__mips_n32) || defined(__mips_n64)
- offsetof(struct trapframe, a4),
- offsetof(struct trapframe, a5),
- offsetof(struct trapframe, a6),
- offsetof(struct trapframe, a7),
- offsetof(struct trapframe, t0),
- offsetof(struct trapframe, t1),
- offsetof(struct trapframe, t2),
- offsetof(struct trapframe, t3),
-#else
- offsetof(struct trapframe, t0),
- offsetof(struct trapframe, t1),
- offsetof(struct trapframe, t2),
- offsetof(struct trapframe, t3),
- offsetof(struct trapframe, t4),
- offsetof(struct trapframe, t5),
- offsetof(struct trapframe, t6),
- offsetof(struct trapframe, t7),
-#endif
- offsetof(struct trapframe, s0),
- offsetof(struct trapframe, s1),
- offsetof(struct trapframe, s2),
- offsetof(struct trapframe, s3),
- offsetof(struct trapframe, s4),
- offsetof(struct trapframe, s5),
- offsetof(struct trapframe, s6),
- offsetof(struct trapframe, s7),
- offsetof(struct trapframe, t8),
- offsetof(struct trapframe, t9),
- offsetof(struct trapframe, k0),
- offsetof(struct trapframe, k1),
- offsetof(struct trapframe, gp),
- offsetof(struct trapframe, sp),
- offsetof(struct trapframe, s8),
- offsetof(struct trapframe, ra),
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame __unused,
- void **this_cache __unused, int regnum __unused, int *optimizedp __unused,
- enum lval_type *lvalp __unused, CORE_ADDR *addrp __unused,
- int *realnump __unused, void *valuep __unused)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- ofs = (regnum >= 0 && regnum <= MIPS_RA_REGNUM) ?
- kgdb_trgt_frame_offset[regnum] : -1;
- if (ofs == -1)
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + ofs * 8;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-#endif
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
-#ifndef CROSS_DEBUGGER
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if ((strcmp(pname, "MipsKernIntr") == 0) ||
- (strcmp(pname, "MipsKernGenException") == 0) ||
- (strcmp(pname, "MipsUserIntr") == 0) ||
- (strcmp(pname, "MipsUserGenException") == 0))
- return (&kgdb_trgt_trapframe_unwind);
-#endif
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c b/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c
deleted file mode 100644
index 703cc0f716f96..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#ifdef CROSS_DEBUGGER
-#include <sys/powerpc/include/pcb.h>
-#include <sys/powerpc/include/frame.h>
-#else
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#endif
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <ppc-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
- struct gdbarch_tdep *tdep;
- int i;
-
- tdep = gdbarch_tdep (current_gdbarch);
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- /*
- * r14-r31 are saved in the pcb
- */
- for (i = 14; i <= 31; i++) {
- supply_register(tdep->ppc_gp0_regnum + i,
- (char *)&pcb.pcb_context[i]);
- }
-
- /* r1 is saved in the sp field */
- supply_register(tdep->ppc_gp0_regnum + 1, (char *)&pcb.pcb_sp);
-
- supply_register(tdep->ppc_lr_regnum, (char *)&pcb.pcb_lr);
- supply_register(tdep->ppc_cr_regnum, (char *)&pcb.pcb_cr);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep;
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- tdep = gdbarch_tdep(current_gdbarch);
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- if (regnum >= tdep->ppc_gp0_regnum &&
- regnum <= tdep->ppc_gplast_regnum)
- ofs = offsetof(struct trapframe,
- fixreg[regnum - tdep->ppc_gp0_regnum]);
- else if (regnum == tdep->ppc_lr_regnum)
- ofs = offsetof(struct trapframe, lr);
- else if (regnum == tdep->ppc_cr_regnum)
- ofs = offsetof(struct trapframe, cr);
- else if (regnum == tdep->ppc_xer_regnum)
- ofs = offsetof(struct trapframe, xer);
- else if (regnum == tdep->ppc_ctr_regnum)
- ofs = offsetof(struct trapframe, ctr);
- else if (regnum == PC_REGNUM)
- ofs = offsetof(struct trapframe, srr0);
- else
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + 8 + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "asttrapexit") == 0 ||
- strcmp(pname, "trapexit") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %llx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c b/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c
deleted file mode 100644
index bfb0d7eed8759..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <ppc-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
- struct gdbarch_tdep *tdep;
- int i;
-
- tdep = gdbarch_tdep (current_gdbarch);
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- /*
- * r14-r31 are saved in the pcb
- */
- for (i = 14; i <= 31; i++) {
- supply_register(tdep->ppc_gp0_regnum + i,
- (char *)&pcb.pcb_context[i]);
- }
-
- /* r1 is saved in the sp field */
- supply_register(tdep->ppc_gp0_regnum + 1, (char *)&pcb.pcb_sp);
- /* r2 is saved in the toc field */
- supply_register(tdep->ppc_gp0_regnum + 2, (char *)&pcb.pcb_toc);
-
- supply_register(tdep->ppc_lr_regnum, (char *)&pcb.pcb_lr);
- supply_register(tdep->ppc_cr_regnum, (char *)&pcb.pcb_cr);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SP_REGNUM));
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep;
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- tdep = gdbarch_tdep(current_gdbarch);
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- if (regnum >= tdep->ppc_gp0_regnum &&
- regnum <= tdep->ppc_gplast_regnum)
- ofs = offsetof(struct trapframe,
- fixreg[regnum - tdep->ppc_gp0_regnum]);
- else if (regnum == tdep->ppc_lr_regnum)
- ofs = offsetof(struct trapframe, lr);
- else if (regnum == tdep->ppc_cr_regnum)
- ofs = offsetof(struct trapframe, cr);
- else if (regnum == tdep->ppc_xer_regnum)
- ofs = offsetof(struct trapframe, xer);
- else if (regnum == tdep->ppc_ctr_regnum)
- ofs = offsetof(struct trapframe, ctr);
- else if (regnum == PC_REGNUM)
- ofs = offsetof(struct trapframe, srr0);
- else
- return;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *addrp = cache->sp + 48 + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_pc_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "asttrapexit") == 0 ||
- strcmp(pname, "trapexit") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %llx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c b/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c
deleted file mode 100644
index b39299f40918f..0000000000000
--- a/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2004 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/asm.h>
-#include <machine/pcb.h>
-#include <machine/frame.h>
-#include <err.h>
-#include <kvm.h>
-#include <string.h>
-
-#include <defs.h>
-#include <target.h>
-#include <gdbthread.h>
-#include <inferior.h>
-#include <regcache.h>
-#include <frame-unwind.h>
-#include <sparc-tdep.h>
-#include <sparc64-tdep.h>
-
-#include "kgdb.h"
-
-CORE_ADDR
-kgdb_trgt_core_pcb(u_int cpuid)
-{
- return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb)));
-}
-
-void
-kgdb_trgt_fetch_registers(int regno __unused)
-{
- struct kthr *kt;
- struct pcb pcb;
-
- kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL)
- return;
- if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
- warnx("kvm_read: %s", kvm_geterr(kvm));
- memset(&pcb, 0, sizeof(pcb));
- }
-
- supply_register(SPARC_SP_REGNUM, (char *)&pcb.pcb_sp);
- sparc_supply_rwindow(current_regcache, pcb.pcb_sp, -1);
- supply_register(SPARC64_PC_REGNUM, (char *)&pcb.pcb_pc);
- pcb.pcb_pc += 4;
- supply_register(SPARC64_NPC_REGNUM, (char *)&pcb.pcb_pc);
-}
-
-void
-kgdb_trgt_store_registers(int regno __unused)
-{
- fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
-}
-
-void
-kgdb_trgt_new_objfile(struct objfile *objfile)
-{
-}
-
-struct kgdb_frame_cache {
- CORE_ADDR pc;
- CORE_ADDR sp;
- CORE_ADDR fp;
-};
-
-static struct kgdb_frame_cache *
-kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
-{
- char buf[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
-
- cache = *this_cache;
- if (cache == NULL) {
- cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
- *this_cache = cache;
- cache->pc = frame_func_unwind(next_frame);
- frame_unwind_register(next_frame, SPARC_SP_REGNUM, buf);
- cache->sp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SPARC_SP_REGNUM));
- frame_unwind_register(next_frame, SPARC_FP_REGNUM, buf);
- cache->fp = extract_unsigned_integer(buf,
- register_size(current_gdbarch, SPARC_FP_REGNUM));
- cache->fp += BIAS - sizeof(struct trapframe);
- }
- return (cache);
-}
-
-static void
-kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
- struct frame_id *this_id)
-{
- struct kgdb_frame_cache *cache;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
- *this_id = frame_id_build(cache->sp, cache->pc);
-}
-
-static void
-kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
- void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump, void *valuep)
-{
- char dummy_valuep[MAX_REGISTER_SIZE];
- struct kgdb_frame_cache *cache;
- int ofs, regsz;
-
- regsz = register_size(current_gdbarch, regnum);
-
- if (valuep == NULL)
- valuep = dummy_valuep;
- memset(valuep, 0, regsz);
- *optimizedp = 0;
- *addrp = 0;
- *lvalp = not_lval;
- *realnump = -1;
-
- cache = kgdb_trgt_frame_cache(next_frame, this_cache);
-
- switch (regnum) {
- case SPARC_SP_REGNUM:
- ofs = offsetof(struct trapframe, tf_sp);
- break;
- case SPARC64_PC_REGNUM:
- ofs = offsetof(struct trapframe, tf_tpc);
- break;
- case SPARC64_NPC_REGNUM:
- ofs = offsetof(struct trapframe, tf_tnpc);
- break;
- case SPARC_O0_REGNUM:
- case SPARC_O1_REGNUM:
- case SPARC_O2_REGNUM:
- case SPARC_O3_REGNUM:
- case SPARC_O4_REGNUM:
- case SPARC_O5_REGNUM:
- case SPARC_O7_REGNUM:
- ofs = offsetof(struct trapframe, tf_out) +
- (regnum - SPARC_O0_REGNUM) * 8;
- break;
- default:
- if (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM) {
- ofs = (regnum - SPARC_L0_REGNUM) * 8;
- *addrp = cache->sp + BIAS + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
- }
- return;
- }
-
- *addrp = cache->fp + ofs;
- *lvalp = lval_memory;
- target_read_memory(*addrp, valuep, regsz);
-}
-
-static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
- UNKNOWN_FRAME,
- &kgdb_trgt_trapframe_this_id,
- &kgdb_trgt_trapframe_prev_register
-};
-
-const struct frame_unwind *
-kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
-{
- char *pname;
- CORE_ADDR pc;
-
- pc = frame_func_unwind(next_frame);
- pname = NULL;
- find_pc_partial_function(pc, &pname, NULL, NULL);
- if (pname == NULL)
- return (NULL);
- if (strcmp(pname, "tl0_intr") == 0 ||
- strcmp(pname, "tl0_trap") == 0 ||
- strcmp(pname, "tl1_intr") == 0 ||
- strcmp(pname, "tl1_trap") == 0)
- return (&kgdb_trgt_trapframe_unwind);
- /* printf("%s: %lx =%s\n", __func__, pc, pname); */
- return (NULL);
-}
-
-/*
- * This function ensures, that the PC is inside the
- * function section which is understood by GDB.
- *
- * Return 0 when fixup is necessary, -1 otherwise.
- */
-int
-kgdb_trgt_pc_fixup(CORE_ADDR *pc __unused)
-{
-
- return (-1);
-}
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile b/gnu/usr.bin/gdb/libgdb/Makefile
deleted file mode 100644
index 8c27c58907edf..0000000000000
--- a/gnu/usr.bin/gdb/libgdb/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-# $FreeBSD$
-
-# These assignments duplicate much of the functionality of
-# MACHINE_CPUARCH, but there's no easy way to export make functions...
-
-.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}}
-.else
-TARGET_CPUARCH=${MACHINE_CPUARCH}
-.endif
-TARGET_ARCH?= ${MACHINE_ARCH}
-
-LIB= gdb
-INTERNALLIB=
-SRCS= annotate.c arch-utils.c auxv.c ax-gdb.c ax-general.c \
- bcache.c bfd-target.c block.c blockframe.c breakpoint.c \
- buildsym.c \
- c-exp.y c-lang.c c-typeprint.c c-valprint.c charset.c \
- cli-cmds.c cli-decode.c cli-dump.c cli-interp.c cli-logging.c \
- cli-out.c cli-script.c cli-setshow.c cli-utils.c coff-pe-read.c \
- coffread.c complaints.c completer.c copying.c corefile.c \
- corelow.c cp-abi.c cp-namespace.c cp-support.c cp-valprint.c \
- dbxread.c dcache.c demangle.c dictionary.c disasm.c doublest.c \
- dummy-frame.c dwarf2-frame.c dwarf2expr.c dwarf2loc.c \
- dwarf2read.c dwarfread.c \
- elfread.c environ.c eval.c event-loop.c event-top.c exec.c \
- expprint.c \
- f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c \
- ${_fork_child} frame-base.c frame-unwind.c frame.c \
- gdb-events.c gdbarch.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
- hpacc-abi.c \
- inf-loop.c infcall.c infcmd.c inflow.c ${_infptrace} infrun.c \
- ${_inftarg} init.c interps.c \
- jv-exp.y jv-lang.c jv-typeprint.c jv-valprint.c \
- kod-cisco.c kod.c \
- language.c linespec.c \
- m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c macrocmd.c \
- macroexp.c macroscope.c macrotab.c main.c maint.c mdebugread.c \
- mem-break.c memattr.c mi-cmd-break.c mi-cmd-disas.c \
- mi-cmd-env.c mi-cmd-file.c mi-cmd-stack.c mi-cmd-var.c \
- mi-cmds.c mi-console.c mi-getopt.c mi-interp.c mi-main.c \
- mi-out.c mi-parse.c mi-symbol-cmds.c minsyms.c mipsread.c \
- nlmread.c \
- objc-exp.y objc-lang.c objfiles.c observer.c osabi.c \
- p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \
- regcache.c reggroups.c remote-fileio.c remote-utils.c remote.c \
- scm-exp.c scm-lang.c scm-valprint.c sentinel-frame.c ser-pipe.c \
- ser-tcp.c ser-unix.c serial.c signals.c source.c stabsread.c \
- stack.c std-regs.c symfile.c symmisc.c symtab.c \
- target.c thread.c top.c tracepoint.c trad-frame.c tui-command.c \
- tui-data.c tui-disasm.c tui-file.c tui-hooks.c tui-interp.c \
- tui-io.c tui-layout.c tui-out.c tui-regs.c tui-source.c \
- tui-stack.c tui-win.c tui-windata.c tui-wingeneral.c \
- tui-winsource.c tui.c typeprint.c \
- ui-file.c ui-out.c user-regs.c utils.c \
- valarith.c valops.c valprint.c values.c varobj.c \
- wrapper.c ${LIBSRCS}
-
-.for stupid_gnu in \
-xregcomp xre_exec xregexec xre_search xre_compile_fastmap xregerror xre_comp xre_set_syntax
-CFLAGS+= -D${stupid_gnu}=${stupid_gnu:S/^x//}
-.endfor
-
-.if ${TARGET_ARCH} == ${MACHINE_ARCH}
-_fork_child= fork-child.c
-_infptrace= infptrace.c
-_inftarg= inftarg.c
-.endif
-
-GENSRCS= version.c
-
-version.c:
- echo '#include "version.h"' > ${.TARGET}
- echo 'const char version[] = ${VERSION};' >> ${.TARGET}
- echo 'const char host_name[] = "${MACHINE_ARCH}-${VENDOR}-freebsd";' \
- >> ${.TARGET}
- echo 'const char target_name[] = "${TARGET_ARCH}-${VENDOR}-freebsd";' \
- >> ${.TARGET}
-
-.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile.depend b/gnu/usr.bin/gdb/libgdb/Makefile.depend
deleted file mode 100644
index 80f12f7059aa0..0000000000000
--- a/gnu/usr.bin/gdb/libgdb/Makefile.depend
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/libreadline/readline \
- include \
- include/arpa \
- include/xlocale \
- lib/libthread_db \
- lib/msun \
- lib/ncurses/ncursesw \
- usr.bin/yacc.host \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
deleted file mode 100644
index 78819a743e517..0000000000000
--- a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
+++ /dev/null
@@ -1,1799 +0,0 @@
-/* $FreeBSD$ */
-/* FreeBSD libthread_db assisted debugging support.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <dlfcn.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <signal.h>
-
-#include "proc_service.h"
-#include "thread_db.h"
-
-#include "defs.h"
-#include "bfd.h"
-#include "elf-bfd.h"
-#include "gdb_assert.h"
-#include "gdbcore.h"
-#include "gdbthread.h"
-#include "inferior.h"
-#include "objfiles.h"
-#include "regcache.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "target.h"
-#include "gdbcmd.h"
-#include "solib-svr4.h"
-
-#include "gregset.h"
-#ifdef PT_GETXMMREGS
-#include "i387-tdep.h"
-#endif
-
-#define LIBTHREAD_DB_SO "libthread_db.so"
-
-struct ps_prochandle
-{
- pid_t pid;
-};
-
-extern int child_suppress_run;
-
-extern struct target_ops child_ops;
-
-/* This module's target vectors. */
-static struct target_ops fbsd_thread_ops;
-static struct target_ops fbsd_core_ops;
-
-/* Saved copy of orignal core_ops. */
-static struct target_ops orig_core_ops;
-extern struct target_ops core_ops;
-
-/* Pointer to the next function on the objfile event chain. */
-static void (*target_new_objfile_chain) (struct objfile *objfile);
-
-/* Non-zero if there is a thread module */
-static int fbsd_thread_present;
-
-/* Non-zero if we're using this module's target vector. */
-static int fbsd_thread_active;
-
-/* Non-zero if core_open is called */
-static int fbsd_thread_core = 0;
-
-/* Non-zero if we have to keep this module's target vector active
- across re-runs. */
-static int keep_thread_db;
-
-/* Structure that identifies the child process for the
- <proc_service.h> interface. */
-static struct ps_prochandle proc_handle;
-
-/* Connection to the libthread_db library. */
-static td_thragent_t *thread_agent;
-
-/* The last thread we are single stepping */
-static ptid_t last_single_step_thread;
-
-/* Pointers to the libthread_db functions. */
-
-static td_err_e (*td_init_p) (void);
-
-static td_err_e (*td_ta_new_p) (struct ps_prochandle *ps, td_thragent_t **ta);
-static td_err_e (*td_ta_delete_p) (td_thragent_t *);
-static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt,
- td_thrhandle_t *__th);
-static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, lwpid_t lwpid,
- td_thrhandle_t *th);
-static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta,
- td_thr_iter_f *callback,
- void *cbdata_p, td_thr_state_e state,
- int ti_pri, sigset_t *ti_sigmask_p,
- unsigned int ti_user_flags);
-static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta,
- td_event_e event, td_notify_t *ptr);
-static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta,
- td_thr_events_t *event);
-static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta,
- td_event_msg_t *msg);
-static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
- td_thrinfo_t *infop);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_getxmmregs_p) (const td_thrhandle_t *th,
- char *regset);
-#endif
-static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
- prfpregset_t *regset);
-static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
- prgregset_t gregs);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_setxmmregs_p) (const td_thrhandle_t *th,
- const char *fpregs);
-#endif
-static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
- const prfpregset_t *fpregs);
-static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
- prgregset_t gregs);
-static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event);
-
-static td_err_e (*td_thr_sstep_p) (td_thrhandle_t *th, int step);
-
-static td_err_e (*td_ta_tsd_iter_p) (const td_thragent_t *ta,
- td_key_iter_f *func, void *data);
-static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
- void *map_address,
- size_t offset, void **address);
-static td_err_e (*td_thr_dbsuspend_p) (const td_thrhandle_t *);
-static td_err_e (*td_thr_dbresume_p) (const td_thrhandle_t *);
-
-static CORE_ADDR td_create_bp_addr;
-
-/* Location of the thread death event breakpoint. */
-static CORE_ADDR td_death_bp_addr;
-
-/* Prototypes for local functions. */
-static void fbsd_thread_find_new_threads (void);
-static int fbsd_thread_alive (ptid_t ptid);
-static void attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
- const td_thrinfo_t *ti_p, int verbose);
-static void fbsd_thread_detach (char *args, int from_tty);
-
-/* Building process ids. */
-
-#define GET_PID(ptid) ptid_get_pid (ptid)
-#define GET_LWP(ptid) ptid_get_lwp (ptid)
-#define GET_THREAD(ptid) ptid_get_tid (ptid)
-
-#define IS_LWP(ptid) (GET_LWP (ptid) != 0)
-#define IS_THREAD(ptid) (GET_THREAD (ptid) != 0)
-
-#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0)
-#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid)
-
-static char *
-thread_db_err_str (td_err_e err)
-{
- static char buf[64];
-
- switch (err)
- {
- case TD_OK:
- return "generic 'call succeeded'";
- case TD_ERR:
- return "generic error";
- case TD_NOTHR:
- return "no thread to satisfy query";
- case TD_NOSV:
- return "no sync handle to satisfy query";
- case TD_NOLWP:
- return "no LWP to satisfy query";
- case TD_BADPH:
- return "invalid process handle";
- case TD_BADTH:
- return "invalid thread handle";
- case TD_BADSH:
- return "invalid synchronization handle";
- case TD_BADTA:
- return "invalid thread agent";
- case TD_BADKEY:
- return "invalid key";
- case TD_NOMSG:
- return "no event message for getmsg";
- case TD_NOFPREGS:
- return "FPU register set not available";
- case TD_NOLIBTHREAD:
- return "application not linked with libthread";
- case TD_NOEVENT:
- return "requested event is not supported";
- case TD_NOCAPAB:
- return "capability not available";
- case TD_DBERR:
- return "debugger service failed";
- case TD_NOAPLIC:
- return "operation not applicable to";
- case TD_NOTSD:
- return "no thread-specific data for this thread";
- case TD_MALLOC:
- return "malloc failed";
- case TD_PARTIALREG:
- return "only part of register set was written/read";
- case TD_NOXREGS:
- return "X register set not available for this thread";
- default:
- snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err);
- return buf;
- }
-}
-
-static char *
-thread_db_state_str (td_thr_state_e state)
-{
- static char buf[64];
-
- switch (state)
- {
- case TD_THR_STOPPED:
- return "stopped by debugger";
- case TD_THR_RUN:
- return "runnable";
- case TD_THR_ACTIVE:
- return "active";
- case TD_THR_ZOMBIE:
- return "zombie";
- case TD_THR_SLEEP:
- return "sleeping";
- case TD_THR_STOPPED_ASLEEP:
- return "stopped by debugger AND blocked";
- default:
- snprintf (buf, sizeof (buf), "unknown thread_db state %d", state);
- return buf;
- }
-}
-
-/* Convert LWP to user-level thread id. */
-static ptid_t
-thread_from_lwp (ptid_t ptid, td_thrhandle_t *th, td_thrinfo_t *ti)
-{
- td_err_e err;
-
- gdb_assert (IS_LWP (ptid));
-
- if (fbsd_thread_active)
- {
- err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), th);
- if (err == TD_OK)
- {
- err = td_thr_get_info_p (th, ti);
- if (err != TD_OK)
- error ("Cannot get thread info: %s", thread_db_err_str (err));
- return BUILD_THREAD (ti->ti_tid, GET_PID (ptid));
- }
- }
-
- /* the LWP is not mapped to user thread */
- return BUILD_LWP (GET_LWP (ptid), GET_PID (ptid));
-}
-
-static void
-fbsd_core_get_first_lwp (bfd *abfd, asection *asect, void *obj)
-{
- if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0)
- return;
-
- if (*(lwpid_t *)obj != 0)
- return;
-
- *(lwpid_t *)obj = atoi (bfd_section_name (abfd, asect) + 5);
-}
-
-static long
-get_current_lwp (int pid)
-{
- struct ptrace_lwpinfo pl;
- lwpid_t lwpid;
-
- if (!target_has_execution)
- {
- lwpid = 0;
- bfd_map_over_sections (core_bfd, fbsd_core_get_first_lwp, &lwpid);
- return lwpid;
- }
- if (ptrace (PT_LWPINFO, pid, (caddr_t)&pl, sizeof(pl)))
- perror_with_name("PT_LWPINFO");
-
- return (long)pl.pl_lwpid;
-}
-
-static void
-get_current_thread ()
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- long lwp;
- ptid_t tmp, ptid;
-
- lwp = get_current_lwp (proc_handle.pid);
- tmp = BUILD_LWP (lwp, proc_handle.pid);
- ptid = thread_from_lwp (tmp, &th, &ti);
- if (!in_thread_list (ptid))
- {
- attach_thread (ptid, &th, &ti, 1);
- }
- inferior_ptid = ptid;
-}
-
-static td_err_e
-enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp)
-{
- td_notify_t notify;
- td_err_e err;
-
- /* Get the breakpoint address for thread EVENT. */
- err = td_ta_event_addr_p (thread_agent, event, &notify);
- if (err != TD_OK)
- return err;
-
- /* Set up the breakpoint. */
- (*bp) = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
- extract_typed_address(&notify.u.bptaddr, builtin_type_void_func_ptr),
- &current_target);
- create_thread_event_breakpoint ((*bp));
-
- return TD_OK;
-}
-
-static void
-enable_thread_event_reporting (void)
-{
- td_thr_events_t events;
- td_notify_t notify;
- td_err_e err;
-
- /* We cannot use the thread event reporting facility if these
- functions aren't available. */
- if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL
- || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL)
- return;
-
- /* Set the process wide mask saying which events we're interested in. */
- td_event_emptyset (&events);
- td_event_addset (&events, TD_CREATE);
- td_event_addset (&events, TD_DEATH);
-
- err = td_ta_set_event_p (thread_agent, &events);
- if (err != TD_OK)
- {
- warning ("Unable to set global thread event mask: %s",
- thread_db_err_str (err));
- return;
- }
-
- /* Delete previous thread event breakpoints, if any. */
- remove_thread_event_breakpoints ();
- td_create_bp_addr = 0;
- td_death_bp_addr = 0;
-
- /* Set up the thread creation event. */
- err = enable_thread_event (thread_agent, TD_CREATE, &td_create_bp_addr);
- if (err != TD_OK)
- {
- warning ("Unable to get location for thread creation breakpoint: %s",
- thread_db_err_str (err));
- return;
- }
-
- /* Set up the thread death event. */
- err = enable_thread_event (thread_agent, TD_DEATH, &td_death_bp_addr);
- if (err != TD_OK)
- {
- warning ("Unable to get location for thread death breakpoint: %s",
- thread_db_err_str (err));
- return;
- }
-}
-
-static void
-disable_thread_event_reporting (void)
-{
- td_thr_events_t events;
-
- /* Set the process wide mask saying we aren't interested in any
- events anymore. */
- td_event_emptyset (&events);
- td_ta_set_event_p (thread_agent, &events);
-
- /* Delete thread event breakpoints, if any. */
- remove_thread_event_breakpoints ();
- td_create_bp_addr = 0;
- td_death_bp_addr = 0;
-}
-
-static void
-fbsd_thread_activate (void)
-{
- fbsd_thread_active = 1;
- init_thread_list();
- if (fbsd_thread_core == 0)
- enable_thread_event_reporting ();
- fbsd_thread_find_new_threads ();
- get_current_thread ();
-}
-
-static void
-fbsd_thread_deactivate (void)
-{
- if (fbsd_thread_core == 0)
- disable_thread_event_reporting();
- td_ta_delete_p (thread_agent);
-
- inferior_ptid = pid_to_ptid (proc_handle.pid);
- proc_handle.pid = 0;
- fbsd_thread_active = 0;
- fbsd_thread_present = 0;
- init_thread_list ();
-}
-
-static char *
-fbsd_thread_get_name (lwpid_t lwpid)
-{
- static char last_thr_name[MAXCOMLEN + 1];
- char section_name[32];
- struct ptrace_lwpinfo lwpinfo;
- bfd_size_type size;
- struct bfd_section *section;
-
- if (target_has_execution)
- {
- if (ptrace (PT_LWPINFO, lwpid, (caddr_t)&lwpinfo, sizeof (lwpinfo)) == -1)
- goto fail;
- strncpy (last_thr_name, lwpinfo.pl_tdname, sizeof (last_thr_name) - 1);
- }
- else
- {
- snprintf (section_name, sizeof (section_name), ".tname/%u", lwpid);
- section = bfd_get_section_by_name (core_bfd, section_name);
- if (! section)
- goto fail;
-
- /* Section size fix-up. */
- size = bfd_section_size (core_bfd, section);
- if (size > sizeof (last_thr_name))
- size = sizeof (last_thr_name);
-
- if (! bfd_get_section_contents (core_bfd, section, last_thr_name,
- (file_ptr)0, size))
- goto fail;
- if (last_thr_name[0] == '\0')
- goto fail;
- }
- last_thr_name[sizeof (last_thr_name) - 1] = '\0';
- return last_thr_name;
-fail:
- strcpy (last_thr_name, "<unknown>");
- return last_thr_name;
-}
-
-static void
-fbsd_thread_new_objfile (struct objfile *objfile)
-{
- td_err_e err;
-
- if (objfile == NULL)
- {
- /* All symbols have been discarded. If the thread_db target is
- active, deactivate it now. */
- if (fbsd_thread_active)
- {
- gdb_assert (proc_handle.pid == 0);
- fbsd_thread_active = 0;
- }
-
- goto quit;
- }
-
- if (!child_suppress_run)
- goto quit;
-
- /* Nothing to do. The thread library was already detected and the
- target vector was already activated. */
- if (fbsd_thread_active)
- goto quit;
-
- /* Initialize the structure that identifies the child process. Note
- that at this point there is no guarantee that we actually have a
- child process. */
- proc_handle.pid = GET_PID (inferior_ptid);
-
- /* Now attempt to open a connection to the thread library. */
- err = td_ta_new_p (&proc_handle, &thread_agent);
- switch (err)
- {
- case TD_NOLIBTHREAD:
- /* No thread library was detected. */
- break;
-
- case TD_OK:
- /* The thread library was detected. Activate the thread_db target. */
- fbsd_thread_present = 1;
-
- /* We can only poke around if there actually is a child process.
- If there is no child process alive, postpone the steps below
- until one has been created. */
- if (fbsd_thread_core == 0 && proc_handle.pid != 0)
- {
- push_target(&fbsd_thread_ops);
- fbsd_thread_activate();
- }
- else
- {
- td_ta_delete_p(thread_agent);
- thread_agent = NULL;
- }
- break;
-
- default:
- warning ("Cannot initialize thread debugging library: %s",
- thread_db_err_str (err));
- break;
- }
-
- quit:
- if (target_new_objfile_chain)
- target_new_objfile_chain (objfile);
-}
-
-static void
-fbsd_thread_attach (char *args, int from_tty)
-{
- fbsd_thread_core = 0;
-
- child_ops.to_attach (args, from_tty);
-
- /* Must get symbols from solibs before libthread_db can run! */
- SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
-
- if (fbsd_thread_present && !fbsd_thread_active)
- push_target(&fbsd_thread_ops);
-}
-
-static void
-fbsd_thread_post_attach (int pid)
-{
- child_ops.to_post_attach (pid);
-
- if (fbsd_thread_present && !fbsd_thread_active)
- {
- proc_handle.pid = GET_PID (inferior_ptid);
- fbsd_thread_activate ();
- }
-}
-
-static void
-fbsd_thread_detach (char *args, int from_tty)
-{
- fbsd_thread_deactivate ();
- unpush_target (&fbsd_thread_ops);
-
- /* Clear gdb solib information and symbol file
- cache, so that after detach and re-attach, new_objfile
- hook will be called */
-
- clear_solib();
- symbol_file_clear(0);
- proc_handle.pid = 0;
- child_ops.to_detach (args, from_tty);
-}
-
-static int
-suspend_thread_callback (const td_thrhandle_t *th_p, void *data)
-{
- int err = td_thr_dbsuspend_p (th_p);
- if (err != 0)
- fprintf_filtered(gdb_stderr, "%s %s\n", __func__, thread_db_err_str (err));
- return (err);
-}
-
-static int
-resume_thread_callback (const td_thrhandle_t *th_p, void *data)
-{
- int err = td_thr_dbresume_p (th_p);
- if (err != 0)
- fprintf_filtered(gdb_stderr, "%s %s\n", __func__, thread_db_err_str (err));
- return (err);
-}
-
-static void
-fbsd_thread_resume (ptid_t ptid, int step, enum target_signal signo)
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- ptid_t work_ptid;
- int resume_all, ret;
- long lwp, thvalid = 0;
-
- if (!fbsd_thread_active)
- {
- child_ops.to_resume (ptid, step, signo);
- return;
- }
-
- if (GET_PID(ptid) != -1 && step != 0)
- {
- resume_all = 0;
- work_ptid = ptid;
- }
- else
- {
- resume_all = 1;
- work_ptid = inferior_ptid;
- }
-
- lwp = GET_LWP (work_ptid);
- if (lwp == 0)
- {
- /* check user thread */
- ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(work_ptid), &th);
- if (ret)
- error (thread_db_err_str (ret));
-
- /* For M:N thread, we need to tell UTS to set/unset single step
- flag at context switch time, the flag will be written into
- thread mailbox. This becauses some architecture may not have
- machine single step flag in ucontext, so we put the flag in mailbox,
- when the thread switches back, kse_switchin restores the single step
- state. */
- ret = td_thr_sstep_p (&th, step);
- if (ret)
- error (thread_db_err_str (ret));
- ret = td_thr_get_info_p (&th, &ti);
- if (ret)
- error (thread_db_err_str (ret));
- thvalid = 1;
- lwp = ti.ti_lid;
- }
-
- if (lwp)
- {
- int req = step ? PT_SETSTEP : PT_CLEARSTEP;
- if (ptrace (req, (pid_t) lwp, (caddr_t) 1, target_signal_to_host(signo)))
- perror_with_name ("PT_SETSTEP/PT_CLEARSTEP");
- }
-
- if (!ptid_equal (last_single_step_thread, null_ptid))
- {
- ret = td_ta_thr_iter_p (thread_agent, resume_thread_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
- if (ret != TD_OK)
- error ("resume error: %s", thread_db_err_str (ret));
- }
-
- if (!resume_all)
- {
- ret = td_ta_thr_iter_p (thread_agent, suspend_thread_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
- if (ret != TD_OK)
- error ("suspend error: %s", thread_db_err_str (ret));
- last_single_step_thread = work_ptid;
- }
- else
- last_single_step_thread = null_ptid;
-
- if (thvalid)
- {
- ret = td_thr_dbresume_p (&th);
- if (ret != TD_OK)
- error ("resume error: %s", thread_db_err_str (ret));
- }
- else
- {
- /* it is not necessary, put it here for completness */
- ret = ptrace(PT_RESUME, lwp, 0, 0);
- }
-
- /* now continue the process, suspended thread wont run */
- if (ptrace (PT_CONTINUE, proc_handle.pid , (caddr_t)1,
- target_signal_to_host(signo)))
- perror_with_name ("PT_CONTINUE");
-}
-
-static void
-attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
- const td_thrinfo_t *ti_p, int verbose)
-{
- td_err_e err;
-
- /* Add the thread to GDB's thread list. */
- if (!in_thread_list (ptid)) {
- add_thread (ptid);
- if (verbose)
- printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid));
- }
-
- if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
- return; /* A zombie thread -- do not attach. */
-
- if (! IS_THREAD(ptid))
- return;
- if (fbsd_thread_core != 0)
- return;
- /* Enable thread event reporting for this thread. */
- err = td_thr_event_enable_p (th_p, 1);
- if (err != TD_OK)
- error ("Cannot enable thread event reporting for %s: %s",
- target_pid_to_str (ptid), thread_db_err_str (err));
-}
-
-static void
-detach_thread (ptid_t ptid, int verbose)
-{
- if (verbose)
- printf_unfiltered ("[%s exited]\n", target_pid_to_str (ptid));
-}
-
-static void
-check_event (ptid_t ptid)
-{
- td_event_msg_t msg;
- td_thrinfo_t ti;
- td_err_e err;
- CORE_ADDR stop_pc;
- int loop = 0;
-
- /* Bail out early if we're not at a thread event breakpoint. */
- stop_pc = read_pc_pid (ptid) - DECR_PC_AFTER_BREAK;
- if (stop_pc != td_create_bp_addr && stop_pc != td_death_bp_addr)
- return;
- loop = 1;
-
- do
- {
- err = td_ta_event_getmsg_p (thread_agent, &msg);
- if (err != TD_OK)
- {
- if (err == TD_NOMSG)
- return;
- error ("Cannot get thread event message: %s",
- thread_db_err_str (err));
- }
- err = td_thr_get_info_p ((void *)(uintptr_t)msg.th_p, &ti);
- if (err != TD_OK)
- error ("Cannot get thread info: %s", thread_db_err_str (err));
- ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid));
- switch (msg.event)
- {
- case TD_CREATE:
- /* We may already know about this thread, for instance when the
- user has issued the `info threads' command before the SIGTRAP
- for hitting the thread creation breakpoint was reported. */
- attach_thread (ptid, (void *)(uintptr_t)msg.th_p, &ti, 1);
- break;
- case TD_DEATH:
- if (!in_thread_list (ptid))
- error ("Spurious thread death event.");
- detach_thread (ptid, 1);
- break;
- default:
- error ("Spurious thread event.");
- }
- }
- while (loop);
-}
-
-static ptid_t
-fbsd_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
-{
- ptid_t ret;
- long lwp;
- CORE_ADDR stop_pc;
- td_thrhandle_t th;
- td_thrinfo_t ti;
-
- ret = child_ops.to_wait (ptid, ourstatus);
- if (GET_PID(ret) >= 0 && ourstatus->kind == TARGET_WAITKIND_STOPPED)
- {
- lwp = get_current_lwp (GET_PID(ret));
- ret = thread_from_lwp (BUILD_LWP(lwp, GET_PID(ret)),
- &th, &ti);
- if (!in_thread_list(ret)) {
- /*
- * We have to enable event reporting for initial thread
- * which was not mapped before.
- */
- attach_thread(ret, &th, &ti, 1);
- }
- if (ourstatus->value.sig == TARGET_SIGNAL_TRAP)
- check_event(ret);
- /* this is a hack, if an event won't cause gdb to stop, for example,
- SIGARLM, gdb resumes the process immediatly without setting
- inferior_ptid to the new thread returned here, this is a bug
- because inferior_ptid may already not exist there, and passing
- a none existing thread to fbsd_thread_resume causes error. */
- if (!fbsd_thread_alive (inferior_ptid))
- {
- delete_thread (inferior_ptid);
- inferior_ptid = ret;
- }
- }
-
- return (ret);
-}
-
-static int
-fbsd_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- int err;
-
- if (target_has_execution)
- err = child_ops.to_xfer_memory (memaddr, myaddr, len, write, attrib,
- target);
- else
- err = orig_core_ops.to_xfer_memory (memaddr, myaddr, len, write, attrib,
- target);
-
- return (err);
-}
-
-static void
-fbsd_lwp_fetch_registers (int regno)
-{
- gregset_t gregs;
- fpregset_t fpregs;
- lwpid_t lwp;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- if (!target_has_execution)
- {
- orig_core_ops.to_fetch_registers (-1);
- return;
- }
-
- /* XXX: We've replaced the pid with the lwpid for GDB's benefit. */
- lwp = GET_PID (inferior_ptid);
-
- if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1)
- error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
- supply_gregset (&gregs);
-
-#ifdef PT_GETXMMREGS
- if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == 0)
- {
- i387_supply_fxsave (current_regcache, -1, xmmregs);
- }
- else
- {
-#endif
- if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
- error ("Cannot get lwp %d registers: %s\n ", lwp, safe_strerror (errno));
- supply_fpregset (&fpregs);
-#ifdef PT_GETXMMREGS
- }
-#endif
-}
-
-static void
-fbsd_thread_fetch_registers (int regno)
-{
- prgregset_t gregset;
- prfpregset_t fpregset;
- td_thrhandle_t th;
- td_err_e err;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- if (!IS_THREAD (inferior_ptid))
- {
- fbsd_lwp_fetch_registers (regno);
- return;
- }
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
- if (err != TD_OK)
- error ("Cannot find thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid), thread_db_err_str (err));
-
- err = td_thr_getgregs_p (&th, gregset);
- if (err != TD_OK)
- error ("Cannot fetch general-purpose registers for thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid), thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
- err = td_thr_getxmmregs_p (&th, xmmregs);
- if (err == TD_OK)
- {
- i387_supply_fxsave (current_regcache, -1, xmmregs);
- }
- else
- {
-#endif
- err = td_thr_getfpregs_p (&th, &fpregset);
- if (err != TD_OK)
- error ("Cannot get floating-point registers for thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid), thread_db_err_str (err));
- supply_fpregset (&fpregset);
-#ifdef PT_GETXMMREGS
- }
-#endif
-
- supply_gregset (gregset);
-}
-
-static void
-fbsd_lwp_store_registers (int regno)
-{
- gregset_t gregs;
- fpregset_t fpregs;
- lwpid_t lwp;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- /* FIXME, is it possible ? */
- if (!IS_LWP (inferior_ptid))
- {
- child_ops.to_store_registers (regno);
- return ;
- }
-
- lwp = GET_LWP (inferior_ptid);
- if (regno != -1)
- if (ptrace (PT_GETREGS, lwp, (caddr_t) &gregs, 0) == -1)
- error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
-
- fill_gregset (&gregs, regno);
- if (ptrace (PT_SETREGS, lwp, (caddr_t) &gregs, 0) == -1)
- error ("Cannot set lwp %d registers: %s\n", lwp, safe_strerror (errno));
-
-#ifdef PT_GETXMMREGS
- if (regno != -1)
- if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == -1)
- goto noxmm;
-
- i387_fill_fxsave (xmmregs, regno);
- if (ptrace (PT_SETXMMREGS, lwp, xmmregs, 0) == -1)
- goto noxmm;
-
- return;
-
-noxmm:
-#endif
-
- if (regno != -1)
- if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
- error ("Cannot get lwp %d float registers: %s\n", lwp,
- safe_strerror (errno));
-
- fill_fpregset (&fpregs, regno);
- if (ptrace (PT_SETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
- error ("Cannot set lwp %d float registers: %s\n", lwp,
- safe_strerror (errno));
-}
-
-static void
-fbsd_thread_store_registers (int regno)
-{
- prgregset_t gregset;
- prfpregset_t fpregset;
- td_thrhandle_t th;
- td_err_e err;
-#ifdef PT_GETXMMREGS
- char xmmregs[512];
-#endif
-
- if (!IS_THREAD (inferior_ptid))
- {
- fbsd_lwp_store_registers (regno);
- return;
- }
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
- if (err != TD_OK)
- error ("Cannot find thread %d: Thread ID=%ld, %s",
- pid_to_thread_id (inferior_ptid),
- GET_THREAD (inferior_ptid),
- thread_db_err_str (err));
-
- if (regno != -1)
- {
- char old_value[MAX_REGISTER_SIZE];
-
- regcache_collect (regno, old_value);
- err = td_thr_getgregs_p (&th, gregset);
- if (err != TD_OK)
- error ("%s: td_thr_getgregs %s", __func__, thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
- err = td_thr_getxmmregs_p (&th, xmmregs);
- if (err != TD_OK)
- {
-#endif
- err = td_thr_getfpregs_p (&th, &fpregset);
- if (err != TD_OK)
- error ("%s: td_thr_getfpgregs %s", __func__, thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
- }
-#endif
- supply_register (regno, old_value);
- }
-
- fill_gregset (gregset, regno);
- err = td_thr_setgregs_p (&th, gregset);
- if (err != TD_OK)
- error ("Cannot store general-purpose registers for thread %d: Thread ID=%d, %s",
- pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
- thread_db_err_str (err));
-
-#ifdef PT_GETXMMREGS
- i387_fill_fxsave (xmmregs, regno);
- err = td_thr_setxmmregs_p (&th, xmmregs);
- if (err == TD_OK)
- return;
-#endif
-
- fill_fpregset (&fpregset, regno);
- err = td_thr_setfpregs_p (&th, &fpregset);
- if (err != TD_OK)
- error ("Cannot store floating-point registers for thread %d: Thread ID=%d, %s",
- pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
- thread_db_err_str (err));
-}
-
-static void
-fbsd_thread_kill (void)
-{
- child_ops.to_kill();
-}
-
-static int
-fbsd_thread_can_run (void)
-{
- return child_suppress_run;
-}
-
-static void
-fbsd_thread_create_inferior (char *exec_file, char *allargs, char **env)
-{
- if (fbsd_thread_present && !fbsd_thread_active)
- push_target(&fbsd_thread_ops);
-
- child_ops.to_create_inferior (exec_file, allargs, env);
-}
-
-static void
-fbsd_thread_post_startup_inferior (ptid_t ptid)
-{
- if (fbsd_thread_present && !fbsd_thread_active)
- {
- /* The child process is now the actual multi-threaded
- program. Snatch its process ID... */
- proc_handle.pid = GET_PID (ptid);
- td_ta_new_p (&proc_handle, &thread_agent);
- fbsd_thread_activate();
- }
-}
-
-static void
-fbsd_thread_mourn_inferior (void)
-{
- if (fbsd_thread_active)
- fbsd_thread_deactivate ();
-
- unpush_target (&fbsd_thread_ops);
-
- child_ops.to_mourn_inferior ();
-}
-
-static void
-fbsd_core_check_lwp (bfd *abfd, asection *asect, void *obj)
-{
- lwpid_t lwp;
-
- if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0)
- return;
-
- /* already found */
- if (*(lwpid_t *)obj == 0)
- return;
-
- lwp = atoi (bfd_section_name (abfd, asect) + 5);
- if (*(lwpid_t *)obj == lwp)
- *(lwpid_t *)obj = 0;
-}
-
-static int
-fbsd_thread_alive (ptid_t ptid)
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- td_err_e err;
- gregset_t gregs;
- lwpid_t lwp;
-
- if (IS_THREAD (ptid))
- {
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
- if (err != TD_OK)
- return 0;
-
- err = td_thr_get_info_p (&th, &ti);
- if (err != TD_OK)
- return 0;
-
- /* A zombie thread. */
- if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
- return 0;
-
- return 1;
- }
- else if (GET_LWP (ptid) == 0)
- {
- /* we sometimes are called with lwp == 0 */
- return 1;
- }
-
- if (fbsd_thread_active)
- {
- err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
-
- /*
- * if the lwp was already mapped to user thread, don't use it
- * directly, please use user thread id instead.
- */
- if (err == TD_OK)
- return 0;
- }
-
- if (!target_has_execution)
- {
- lwp = GET_LWP (ptid);
- bfd_map_over_sections (core_bfd, fbsd_core_check_lwp, &lwp);
- return (lwp == 0);
- }
-
- /* check lwp in kernel */
- return ptrace (PT_GETREGS, GET_LWP (ptid), (caddr_t)&gregs, 0) == 0;
-}
-
-static void
-fbsd_thread_files_info (struct target_ops *ignore)
-{
- child_ops.to_files_info (ignore);
-}
-
-static int
-find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
-{
- td_thrinfo_t ti;
- td_err_e err;
- ptid_t ptid;
-
- err = td_thr_get_info_p (th_p, &ti);
- if (err != TD_OK)
- error ("Cannot get thread info: %s", thread_db_err_str (err));
-
- /* Ignore zombie */
- if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
- return 0;
-
- ptid = BUILD_THREAD (ti.ti_tid, proc_handle.pid);
- attach_thread (ptid, th_p, &ti, 1);
- return 0;
-}
-
-static void
-fbsd_thread_find_new_threads (void)
-{
- td_err_e err;
-
- if (!fbsd_thread_active)
- return;
-
- /* Iterate over all user-space threads to discover new threads. */
- err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
- if (err != TD_OK)
- error ("Cannot find new threads: %s", thread_db_err_str (err));
-}
-
-static char *
-fbsd_thread_pid_to_str (ptid_t ptid)
-{
- static char buf[64 + MAXCOMLEN];
-
- if (IS_THREAD (ptid))
- {
- td_thrhandle_t th;
- td_thrinfo_t ti;
- td_err_e err;
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
- if (err != TD_OK)
- error ("Cannot find thread, Thread ID=%ld, %s",
- GET_THREAD (ptid), thread_db_err_str (err));
-
- err = td_thr_get_info_p (&th, &ti);
- if (err != TD_OK)
- error ("Cannot get thread info, Thread ID=%ld, %s",
- GET_THREAD (ptid), thread_db_err_str (err));
-
- if (ti.ti_lid != 0)
- {
- snprintf (buf, sizeof (buf), "Thread %llx (LWP %d/%s)",
- (unsigned long long)th.th_thread, ti.ti_lid,
- fbsd_thread_get_name (ti.ti_lid));
- }
- else
- {
- snprintf (buf, sizeof (buf), "Thread %llx (%s)",
- (unsigned long long)th.th_thread,
- thread_db_state_str (ti.ti_state));
- }
-
- return buf;
- }
- else if (IS_LWP (ptid))
- {
- snprintf (buf, sizeof (buf), "LWP %d", (int) GET_LWP (ptid));
- return buf;
- }
- return normal_pid_to_str (ptid);
-}
-
-CORE_ADDR
-fbsd_thread_get_local_address(ptid_t ptid, struct objfile *objfile,
- CORE_ADDR offset)
-{
- td_thrhandle_t th;
- void *address;
- CORE_ADDR lm;
- void *lm2;
- int ret, is_library = (objfile->flags & OBJF_SHARED);
-
- if (IS_THREAD (ptid))
- {
- if (!td_thr_tls_get_addr_p)
- error ("Cannot find thread-local interface in thread_db library.");
-
- /* Get the address of the link map for this objfile. */
- lm = svr4_fetch_objfile_link_map (objfile);
-
- /* Couldn't find link map. Bail out. */
- if (!lm)
- {
- if (is_library)
- error ("Cannot find shared library `%s' link_map in dynamic"
- " linker's module list", objfile->name);
- else
- error ("Cannot find executable file `%s' link_map in dynamic"
- " linker's module list", objfile->name);
- }
-
- ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(ptid), &th);
-
- /* get the address of the variable. */
- store_typed_address(&lm2, builtin_type_void_data_ptr, lm);
- ret = td_thr_tls_get_addr_p (&th, lm2, offset, &address);
-
- if (ret != TD_OK)
- {
- if (is_library)
- error ("Cannot find thread-local storage for thread %ld, "
- "shared library %s:\n%s",
- (long) GET_THREAD (ptid),
- objfile->name, thread_db_err_str (ret));
- else
- error ("Cannot find thread-local storage for thread %ld, "
- "executable file %s:\n%s",
- (long) GET_THREAD (ptid),
- objfile->name, thread_db_err_str (ret));
- }
-
- /* Cast assuming host == target. */
- return extract_typed_address(&address, builtin_type_void_data_ptr);
- }
- return (0);
-}
-
-static int
-tsd_cb (thread_key_t key, void (*destructor)(void *), void *ignore)
-{
- struct minimal_symbol *ms;
- char *name;
-
- ms = lookup_minimal_symbol_by_pc (
- extract_typed_address(&destructor, builtin_type_void_func_ptr));
- if (!ms)
- name = "???";
- else
- name = DEPRECATED_SYMBOL_NAME (ms);
-
- printf_filtered ("Key %d, destructor %p <%s>\n", key, destructor, name);
- return 0;
-}
-
-static void
-fbsd_thread_tsd_cmd (char *exp, int from_tty)
-{
- if (fbsd_thread_active)
- td_ta_tsd_iter_p (thread_agent, tsd_cb, NULL);
-}
-
-static void
-fbsd_print_sigset (sigset_t *set)
-{
- int i;
-
- for (i = 1; i <= _SIG_MAXSIG; ++i) {
- if (sigismember(set, i)) {
- if (i < sizeof(sys_signame)/sizeof(sys_signame[0]))
- printf_filtered("%s ", sys_signame[i]);
- else
- printf_filtered("sig%d ", i);
- }
- }
- printf_filtered("\n");
-}
-
-static void
-fbsd_thread_signal_cmd (char *exp, int from_tty)
-{
- td_thrhandle_t th;
- td_thrinfo_t ti;
- td_err_e err;
- const char *code;
-
- if (!fbsd_thread_active || !IS_THREAD(inferior_ptid))
- return;
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
- if (err != TD_OK)
- return;
-
- err = td_thr_get_info_p (&th, &ti);
- if (err != TD_OK)
- return;
-
- printf_filtered("signal mask:\n");
- fbsd_print_sigset(&ti.ti_sigmask);
- printf_filtered("signal pending:\n");
- fbsd_print_sigset(&ti.ti_pending);
- if (ti.ti_siginfo.si_signo != 0) {
- printf_filtered("si_signo %d si_errno %d", ti.ti_siginfo.si_signo,
- ti.ti_siginfo.si_errno);
- if (ti.ti_siginfo.si_errno != 0)
- printf_filtered(" (%s)", strerror(ti.ti_siginfo.si_errno));
- printf_filtered("\n");
- switch (ti.ti_siginfo.si_code) {
- case SI_NOINFO:
- code = "NOINFO";
- break;
- case SI_USER:
- code = "USER";
- break;
- case SI_QUEUE:
- code = "QUEUE";
- break;
- case SI_TIMER:
- code = "TIMER";
- break;
- case SI_ASYNCIO:
- code = "ASYNCIO";
- break;
- case SI_MESGQ:
- code = "MESGQ";
- break;
- case SI_KERNEL:
- code = "KERNEL";
- break;
- default:
- code = "UNKNOWN";
- break;
- }
- printf_filtered("si_code %s (%d) si_pid %d si_uid %d si_status %x "
- "si_addr %p\n",
- code, ti.ti_siginfo.si_code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid,
- ti.ti_siginfo.si_status, ti.ti_siginfo.si_addr);
- }
-}
-
-static int
-ignore (CORE_ADDR addr, char *contents)
-{
- return 0;
-}
-
-static void
-fbsd_core_open (char *filename, int from_tty)
-{
- int err;
-
- fbsd_thread_core = 1;
-
- orig_core_ops.to_open (filename, from_tty);
-
- if (fbsd_thread_present)
- {
- err = td_ta_new_p (&proc_handle, &thread_agent);
- if (err == TD_OK)
- {
- proc_handle.pid = elf_tdata (core_bfd)->core_pid;
- fbsd_thread_activate ();
- }
- else
- error ("fbsd_core_open: td_ta_new: %s", thread_db_err_str (err));
- }
-}
-
-static void
-fbsd_core_close (int quitting)
-{
- orig_core_ops.to_close (quitting);
-}
-
-static void
-fbsd_core_detach (char *args, int from_tty)
-{
- if (fbsd_thread_active)
- fbsd_thread_deactivate ();
- unpush_target (&fbsd_thread_ops);
- orig_core_ops.to_detach (args, from_tty);
-
- /* Clear gdb solib information and symbol file
- cache, so that after detach and re-attach, new_objfile
- hook will be called */
- clear_solib();
- symbol_file_clear(0);
-}
-
-static void
-fbsd_core_files_info (struct target_ops *ignore)
-{
- orig_core_ops.to_files_info (ignore);
-}
-
-static void
-init_fbsd_core_ops (void)
-{
- fbsd_core_ops.to_shortname = "FreeBSD-core";
- fbsd_core_ops.to_longname = "FreeBSD multithreaded core dump file";
- fbsd_core_ops.to_doc =
- "Use a core file as a target. Specify the filename of the core file.";
- fbsd_core_ops.to_open = fbsd_core_open;
- fbsd_core_ops.to_close = fbsd_core_close;
- fbsd_core_ops.to_attach = 0;
- fbsd_core_ops.to_post_attach = 0;
- fbsd_core_ops.to_detach = fbsd_core_detach;
- /* fbsd_core_ops.to_resume = 0; */
- /* fbsd_core_ops.to_wait = 0; */
- fbsd_core_ops.to_fetch_registers = fbsd_thread_fetch_registers;
- /* fbsd_core_ops.to_store_registers = 0; */
- /* fbsd_core_ops.to_prepare_to_store = 0; */
- fbsd_core_ops.to_xfer_memory = fbsd_thread_xfer_memory;
- fbsd_core_ops.to_files_info = fbsd_core_files_info;
- fbsd_core_ops.to_insert_breakpoint = ignore;
- fbsd_core_ops.to_remove_breakpoint = ignore;
- /* fbsd_core_ops.to_lookup_symbol = 0; */
- fbsd_core_ops.to_create_inferior = fbsd_thread_create_inferior;
- fbsd_core_ops.to_stratum = core_stratum;
- fbsd_core_ops.to_has_all_memory = 0;
- fbsd_core_ops.to_has_memory = 1;
- fbsd_core_ops.to_has_stack = 1;
- fbsd_core_ops.to_has_registers = 1;
- fbsd_core_ops.to_has_execution = 0;
- fbsd_core_ops.to_has_thread_control = tc_none;
- fbsd_core_ops.to_thread_alive = fbsd_thread_alive;
- fbsd_core_ops.to_pid_to_str = fbsd_thread_pid_to_str;
- fbsd_core_ops.to_find_new_threads = fbsd_thread_find_new_threads;
- fbsd_core_ops.to_sections = 0;
- fbsd_core_ops.to_sections_end = 0;
- fbsd_core_ops.to_magic = OPS_MAGIC;
-}
-
-static void
-init_fbsd_thread_ops (void)
-{
- fbsd_thread_ops.to_shortname = "freebsd-threads";
- fbsd_thread_ops.to_longname = "FreeBSD multithreaded child process.";
- fbsd_thread_ops.to_doc = "FreeBSD threads support.";
- fbsd_thread_ops.to_attach = fbsd_thread_attach;
- fbsd_thread_ops.to_detach = fbsd_thread_detach;
- fbsd_thread_ops.to_post_attach = fbsd_thread_post_attach;
- fbsd_thread_ops.to_resume = fbsd_thread_resume;
- fbsd_thread_ops.to_wait = fbsd_thread_wait;
- fbsd_thread_ops.to_fetch_registers = fbsd_thread_fetch_registers;
- fbsd_thread_ops.to_store_registers = fbsd_thread_store_registers;
- fbsd_thread_ops.to_xfer_memory = fbsd_thread_xfer_memory;
- fbsd_thread_ops.to_files_info = fbsd_thread_files_info;
- fbsd_thread_ops.to_kill = fbsd_thread_kill;
- fbsd_thread_ops.to_create_inferior = fbsd_thread_create_inferior;
- fbsd_thread_ops.to_post_startup_inferior = fbsd_thread_post_startup_inferior;
- fbsd_thread_ops.to_mourn_inferior = fbsd_thread_mourn_inferior;
- fbsd_thread_ops.to_can_run = fbsd_thread_can_run;
- fbsd_thread_ops.to_thread_alive = fbsd_thread_alive;
- fbsd_thread_ops.to_find_new_threads = fbsd_thread_find_new_threads;
- fbsd_thread_ops.to_pid_to_str = fbsd_thread_pid_to_str;
- fbsd_thread_ops.to_stratum = thread_stratum;
- fbsd_thread_ops.to_has_thread_control = tc_none;
- fbsd_thread_ops.to_has_all_memory = 1;
- fbsd_thread_ops.to_has_memory = 1;
- fbsd_thread_ops.to_has_stack = 1;
- fbsd_thread_ops.to_has_registers = 1;
- fbsd_thread_ops.to_has_execution = 1;
- fbsd_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
- fbsd_thread_ops.to_remove_breakpoint = memory_remove_breakpoint;
- fbsd_thread_ops.to_get_thread_local_address = fbsd_thread_get_local_address;
- fbsd_thread_ops.to_magic = OPS_MAGIC;
-}
-
-static int
-thread_db_load (void)
-{
- void *handle;
- td_err_e err;
-
- handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW);
- if (handle == NULL)
- return 0;
-
-#define resolve(X) \
- if (!(X##_p = dlsym (handle, #X))) \
- return 0;
-
- resolve(td_init);
- resolve(td_ta_new);
- resolve(td_ta_delete);
- resolve(td_ta_map_id2thr);
- resolve(td_ta_map_lwp2thr);
- resolve(td_ta_thr_iter);
- resolve(td_thr_get_info);
-#ifdef PT_GETXMMREGS
- resolve(td_thr_getxmmregs);
-#endif
- resolve(td_thr_getfpregs);
- resolve(td_thr_getgregs);
-#ifdef PT_GETXMMREGS
- resolve(td_thr_setxmmregs);
-#endif
- resolve(td_thr_setfpregs);
- resolve(td_thr_setgregs);
- resolve(td_thr_sstep);
- resolve(td_ta_tsd_iter);
- resolve(td_thr_dbsuspend);
- resolve(td_thr_dbresume);
- resolve(td_thr_tls_get_addr);
-
- /* Initialize the library. */
- err = td_init_p ();
- if (err != TD_OK)
- {
- warning ("Cannot initialize libthread_db: %s", thread_db_err_str (err));
- return 0;
- }
-
- /* These are not essential. */
- td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr");
- td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
- td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
- td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
- td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr");
-
- return 1;
-}
-
-/* we suppress the call to add_target of core_ops in corelow because
- if there are two targets in the stratum core_stratum, find_core_target
- won't know which one to return. see corelow.c for an additonal
- comment on coreops_suppress_target. */
-
-int coreops_suppress_target = 1;
-
-/* similarly we allow this target to be completely skipped. This is used
- by kgdb which uses its own core target. */
-
-int fbsdcoreops_suppress_target;
-
-void
-_initialize_thread_db (void)
-{
-
- if (fbsdcoreops_suppress_target)
- return;
- init_fbsd_thread_ops ();
- init_fbsd_core_ops ();
-
- if (thread_db_load ())
- {
- add_target (&fbsd_thread_ops);
-
- /* "thread tsd" command */
- add_cmd ("tsd", class_run, fbsd_thread_tsd_cmd,
- "Show the thread-specific data keys and destructors "
- "for the process.\n",
- &thread_cmd_list);
-
- add_cmd ("signal", class_run, fbsd_thread_signal_cmd,
- "Show the thread signal info.\n",
- &thread_cmd_list);
-
- memcpy (&orig_core_ops, &core_ops, sizeof (struct target_ops));
- memcpy (&core_ops, &fbsd_core_ops, sizeof (struct target_ops));
- add_target (&core_ops);
-
- /* Add ourselves to objfile event chain. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = fbsd_thread_new_objfile;
-
- child_suppress_run = 1;
- }
- else
- {
- fprintf_unfiltered (gdb_stderr,
- "[GDB will not be able to debug user-mode threads: %s]\n", dlerror());
-
- /* allow the user to debug non-threaded core files */
- add_target (&core_ops);
- }
-}
-
-/* proc service functions */
-void
-ps_plog (const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- vfprintf_filtered (gdb_stderr, fmt, args);
- va_end (args);
-}
-
-ps_err_e
-ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj,
- const char *name, psaddr_t *sym_addr)
-{
- struct minimal_symbol *ms;
- CORE_ADDR addr;
-
- ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
- return PS_NOSYM;
-
- addr = SYMBOL_VALUE_ADDRESS (ms);
- store_typed_address(sym_addr, builtin_type_void_data_ptr, addr);
- return PS_OK;
-}
-
-ps_err_e
-ps_pread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t len)
-{
- int err = target_read_memory (
- extract_typed_address(&addr, builtin_type_void_data_ptr), buf, len);
- return (err == 0 ? PS_OK : PS_ERR);
-}
-
-ps_err_e
-ps_pwrite (struct ps_prochandle *ph, psaddr_t addr, const void *buf,
- size_t len)
-{
- int err = target_write_memory (
- extract_typed_address(&addr, builtin_type_void_data_ptr), (void *)buf, len);
- return (err == 0 ? PS_OK : PS_ERR);
-}
-
-ps_err_e
-ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
-
- /* XXX: Target operation isn't lwp aware: replace pid with lwp */
- inferior_ptid = BUILD_LWP (0, lwpid);
-
- target_fetch_registers (-1);
- fill_gregset (gregset, -1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- supply_gregset ((gdb_gregset_t *) gregset);
- target_store_registers (-1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, prfpregset_t *fpregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- target_fetch_registers (-1);
- fill_fpregset (fpregset, -1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
- const prfpregset_t *fpregset)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- supply_fpregset ((gdb_fpregset_t *) fpregset);
- target_store_registers (-1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-#ifdef PT_GETXMMREGS
-ps_err_e
-ps_lgetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid, char *xmmregs)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- target_fetch_registers (-1);
- i387_fill_fxsave (xmmregs, -1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-
-ps_err_e
-ps_lsetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid,
- const char *xmmregs)
-{
- struct cleanup *old_chain;
-
- old_chain = save_inferior_ptid ();
- inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- i387_supply_fxsave (current_regcache, -1, xmmregs);
- target_store_registers (-1);
- do_cleanups (old_chain);
- return PS_OK;
-}
-#endif
-
-ps_err_e
-ps_lstop(struct ps_prochandle *ph, lwpid_t lwpid)
-{
- if (ptrace (PT_SUSPEND, lwpid, 0, 0) == -1)
- return PS_ERR;
- return PS_OK;
-}
-
-ps_err_e
-ps_lcontinue(struct ps_prochandle *ph, lwpid_t lwpid)
-{
- if (ptrace (PT_RESUME, lwpid, 0, 0) == -1)
- return PS_ERR;
- return PS_OK;
-}
-
-ps_err_e
-ps_linfo(struct ps_prochandle *ph, lwpid_t lwpid, void *info)
-{
- if (fbsd_thread_core) {
- /* XXX should verify lwpid and make a pseudo lwp info */
- memset(info, 0, sizeof(struct ptrace_lwpinfo));
- return PS_OK;
- }
-
- if (ptrace (PT_LWPINFO, lwpid, info, sizeof(struct ptrace_lwpinfo)) == -1)
- return PS_ERR;
- return PS_OK;
-}