* Add bmake framework for using gdb alongside binutils. The old bmake

framework was repository copied from gnu/usr.bin/gdb.
* Add alpha support.
This commit is contained in:
Doug Rabson 1999-05-02 11:32:14 +00:00
parent edc87f7d43
commit 5c3925f8f9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46290
15 changed files with 708 additions and 185 deletions

View file

@ -1,48 +1,62 @@
# $Id: Makefile,v 1.38 1998/10/15 14:15:09 bde Exp $
#
# $Id: Makefile,v 1.3 1998/06/03 18:00:57 peter Exp $
#
.include "../Makefile.inc0"
.PATH: ${SRCDIR}/binutils
PROG= nm
PROG = gdb
GDBDIR= ${.CURDIR}/../../../../contrib/gdb
.if ${OBJFORMAT} == elf
BFDDIR= ${.CURDIR}/../../binutils/libbfd/${MACHINE_ARCH}
BINDIR= /usr/libexec/elf
.else
BFDDIR= ${.CURDIR}/../bfd
BINDIR= /usr/libexec/aout
.endif
.PATH: ${GDBDIR}/gdb
.PATH: ${GDBDIR}/opcodes
.if ${OBJFORMAT} == elf
CFLAGS+= -DFREEBSD_ELF
.endif
XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
c-typeprint.c c-valprint.c ch-lang.c ch-typeprint.c \
ch-valprint.c coffread.c command.c complaints.c copying.c \
core-regset.c corelow.c cp-valprint.c \
dcache.c dbxread.c demangle.c dwarfread.c \
elfread.c environ.c eval.c exec.c expprint.c \
findvar.c fork-child.c freebsd-nat.c gdbtypes.c \
i386-tdep.c infcmd.c inflow.c infptrace.c \
infrun.c inftarg.c language.c \
m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
mem-break.c minsyms.c objfiles.c parse.c \
printcmd.c remote.c remote-utils.c solib.c source.c \
stabsread.c stack.c symfile.c symmisc.c \
symtab.c target.c thread.c top.c \
typeprint.c utils.c valarith.c valops.c \
valprint.c values.c version.c \
serial.c ser-unix.c ser-tcp.c mdebugread.c \
c-exp.y f-exp.y m2-exp.y i387-tdep.c \
kvm-fbsd.c bcache.c \
corefile.c ch-exp.c f-lang.c scm-exp.c scm-lang.c \
scm-valprint.c f-typeprint.c f-valprint.c nlmread.c \
callback.c
XSRCS+= i386-dis.c dis-buf.c disassemble.c
XSRCS = annotate.c ax-general.c ax-gdb.c bcache.c blockframe.c \
breakpoint.c buildsym.c c-exp.y c-lang.c c-typeprint.c \
c-valprint.c ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c \
coffread.c command.c complaints.c copying.c corefile.c \
corelow.c cp-valprint.c dcache.c dbxread.c demangle.c \
dwarfread.c dwarf2read.c elfread.c environ.c eval.c exec.c \
expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
findvar.c fork-child.c gdbarch.c gdbtypes.c infcmd.c inflow.c \
infptrace.c infrun.c inftarg.c language.c jv-exp.y jv-lang.c \
jv-valprint.c jv-typeprint.c nlmread.c m2-lang.c m2-exp.y \
m2-typeprint.c m2-valprint.c main.c maint.c mdebugread.c \
mem-break.c minsyms.c objfiles.c parse.c printcmd.c remote.c \
remote-utils.c scm-exp.c scm-lang.c scm-valprint.c solib.c \
source.c stabsread.c stack.c symfile.c symmisc.c symtab.c \
target.c thread.c top.c tracepoint.c typeprint.c utils.c \
valarith.c valops.c valprint.c values.c version.c serial.c \
ser-unix.c ser-tcp.c callback.c
SRCS= init.c ${XSRCS}
CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I${BFDDIR}
.if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
.include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
.endif
#CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils
CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}
CFLAGS+= -I${SRCDIR}/binutils
CFLAGS+= -I${SRCDIR}/bfd
CFLAGS+= -I${GDBDIR}/gdb
CFLAGS+= -I${GDBDIR}/gdb/config
LDADD+= -L${RELTOP}/libbfd -lbfd
LDADD+= -L${RELTOP}/libopcodes -lopcodes
LDADD+= -lreadline
LDADD+= -lgnuregex
LDADD+= -L${RELTOP}/libiberty -liberty
LDADD+= -ltermcap
DPADD+= ${RELTOP}/libbfd/libbfd.a
DPADD+= ${RELTOP}/libopcodes/libopcodes.a
DPADD+= ${LIBREADLINE}
DPADD+= ${LIBGNUREGEX}
DPADD+= ${RELTOP}/libiberty/libiberty.a
DPADD+= ${LIBTERMCAP}
GDBDIR= ${.CURDIR}/../../../../contrib/gdb
.PATH: ${GDBDIR}/gdb
.PATH: ${SRCDIR}/opcodes
CFLAGS+= -DFREEBSD_ELF
CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
# use phkmalloc
CFLAGS+= -DNO_MMALLOC
# uncomment the next line if you want to debug gdb
@ -51,41 +65,6 @@ YFLAGS=
CLEANFILES= init.c init.c-tmp
.if ${OBJFORMAT} == elf
.if exists(${.OBJDIR}/../../binutils/libbfd)
LIBBFD= ${.OBJDIR}/../../binutils/libbfd/libbfd.a
.else
LIBBFD= ${.CURDIR}/../../binutils/libbfd/libbfd.a
.endif
.if exists(${.OBJDIR}/../../binutils/libiberty)
LIBIBERTY= ${.OBJDIR}/../../binutils/libiberty/libiberty.a
.else
LIBIBERTY= ${.CURDIR}/../../binutils/libiberty/libiberty.a
.endif
.else
.if exists(${.OBJDIR}/../bfd)
LIBBFD= ${.OBJDIR}/../bfd/libbfd.a
.else
LIBBFD= ${.CURDIR}/../bfd/libbfd.a
.endif
.if exists(${.OBJDIR}/../libiberty)
LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
.else
LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
.endif
.endif # OBJFORMAT
DPADD= ${LIBBFD} ${LIBREADLINE} ${LIBGNUREGEX} ${LIBIBERTY} ${LIBTERMCAP}
LDADD= ${LIBBFD} -lreadline -lgnuregex ${LIBIBERTY} -ltermcap
DPADD+= ${LIBIBERTY}
LDADD+= ${LIBIBERTY}
# We do this by grepping through sources. If that turns out to be too slow,
# maybe we could just require every .o file to have an initialization routine
# of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
@ -98,7 +77,7 @@ LDADD+= ${LIBIBERTY}
# object files that will be linked into gdb.
init.c: ${XSRCS}
@${ECHO} Making ${.TARGET}
@echo Making ${.TARGET}
@rm -f init.c-tmp
@echo '/* Do not modify this file. */' >init.c-tmp
@echo '/* It is created automatically by the Makefile. */'>>init.c-tmp

View file

@ -0,0 +1,7 @@
#
# $Id$
#
XSRCS+= freebsd-nat.c alpha-tdep.c
.PATH: ${.CURDIR}/alpha

View file

@ -0,0 +1,7 @@
#
# $Id$
#
XSRCS+= freebsd-nat.c i386-tdep.c i387-tdep.c kvm-fbsd.c
.PATH: ${.CURDIR}/i386

View file

@ -0,0 +1,204 @@
/* Native-dependent code for BSD Unix running on i386's, for GDB.
Copyright 1988, 1989, 1991, 1992, 1994, 1996 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 <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include <machine/frame.h>
#include <sys/param.h>
#include <sys/user.h>
#include <string.h>
#include "gdbcore.h"
#include "value.h"
#include "inferior.h"
int kernel_debugging = 0;
/* Size of elements in jmpbuf */
#define JB_ELEMENT_SIZE 8
/* The definition for JB_PC in machine/reg.h is wrong.
And we can't get at the correct definition in setjmp.h as it is
not always available (eg. if _POSIX_SOURCE is defined which is the
default). As the defintion is unlikely to change (see comment
in <setjmp.h>, define the correct value here. */
#undef JB_PC
#define JB_PC 2
/* Figure out where the longjmp will land.
We expect the first arg to be a pointer to the jmp_buf structure from which
we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
This routine returns true on success. */
int
get_longjmp_target (pc)
CORE_ADDR *pc;
{
CORE_ADDR jb_addr;
char raw_buffer[MAX_REGISTER_RAW_SIZE];
jb_addr = read_register(A0_REGNUM);
if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
sizeof(CORE_ADDR)))
return 0;
*pc = extract_address (raw_buffer, sizeof(CORE_ADDR));
return 1;
}
void
fetch_inferior_registers (regno)
int regno;
{
struct reg regs; /* ptrace order, not gcc/gdb order */
struct fpreg fpregs;
int r;
ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
ptrace (PT_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fpregs, 0);
for (r = 0; r < 31; r++)
memcpy (&registers[REGISTER_BYTE (r)],
&regs.r_regs[r], sizeof(u_int64_t));
for (r = 0; r < 32; r++)
memcpy (&registers[REGISTER_BYTE (r + FP0_REGNUM)],
&fpregs.fpr_regs[r], sizeof(u_int64_t));
memcpy (&registers[REGISTER_BYTE (PC_REGNUM)],
&regs.r_regs[31], sizeof(u_int64_t));
memset (&registers[REGISTER_BYTE (ZERO_REGNUM)], 0, sizeof(u_int64_t));
memset (&registers[REGISTER_BYTE (FP_REGNUM)], 0, sizeof(u_int64_t));
registers_fetched ();
}
void
store_inferior_registers (regno)
int regno;
{
struct reg regs; /* ptrace order, not gcc/gdb order */
struct fpreg fpregs;
int r;
for (r = 0; r < 31; r++)
memcpy (&regs.r_regs[r],
&registers[REGISTER_BYTE (r)], sizeof(u_int64_t));
for (r = 0; r < 32; r++)
memcpy (&fpregs.fpr_regs[r],
&registers[REGISTER_BYTE (r + FP0_REGNUM)], sizeof(u_int64_t));
memcpy (&regs.r_regs[31],
&registers[REGISTER_BYTE (PC_REGNUM)], sizeof(u_int64_t));
ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
ptrace (PT_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fpregs, 0);
}
/* Extract the register values out of the core file and store
them where `read_register' will find them.
Extract the floating point state out of the core file and store
it where `float_info' will find it.
CORE_REG_SECT points to the register values themselves, read into memory.
CORE_REG_SIZE is the size of that area.
WHICH says which set of registers we are handling (0 = int, 2 = float
on machines where they are discontiguous).
REG_ADDR is the offset from u.u_ar0 to the register values relative to
core_reg_sect. This is used with old-fashioned core files to
locate the registers in a large upage-plus-stack ".reg" section.
Original upage address X is at location core_reg_sect+x+reg_addr.
*/
static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
int which;
CORE_ADDR reg_addr;
{
#if 0 /* XXX laters */
register int regno;
register int cregno;
register int addr;
int bad_reg = -1;
int offset;
struct user *tmp_uaddr;
/*
* First get virtual address of user structure. Then calculate offset.
*/
memcpy(&tmp_uaddr,
&((struct user *) core_reg_sect)->u_kproc.kp_proc.p_addr,
sizeof(tmp_uaddr));
offset = -reg_addr - (int) tmp_uaddr;
for (regno = 0; regno < NUM_REGS; regno++)
{
cregno = tregmap[regno];
if (cregno == tFS)
addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_fs);
else if (cregno == tGS)
addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
else
addr = offset + 4 * cregno;
if (addr < 0 || addr >= core_reg_size)
{
if (bad_reg < 0)
bad_reg = regno;
}
else
{
supply_register (regno, core_reg_sect + addr);
}
}
if (bad_reg >= 0)
{
error ("Register %s not found in core file.", gdb_register_names[bad_reg]);
}
addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_savefpu);
memcpy (&pcb_savefpu, core_reg_sect + addr, sizeof pcb_savefpu);
#endif
}
int
kernel_u_size ()
{
return (sizeof (struct user));
}
/* Register that we are able to handle aout (trad-core) file formats. */
static struct core_fns aout_core_fns =
{
bfd_target_unknown_flavour,
fetch_core_registers,
NULL
};
void
_initialize_core_aout ()
{
add_core_fns (&aout_core_fns);
}

View file

@ -0,0 +1,71 @@
/* Native definitions for alpha running FreeBSD.
Copyright (C) 1993, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the
argument regs. A0_REGNUM points at the jmp_buf structure from which we
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
extern int
get_longjmp_target PARAMS ((CORE_ADDR *));
/* Tell gdb that we can attach and detach other processes */
#define ATTACH_DETACH
/* We define our own fetch/store methods */
#define FETCH_INFERIOR_REGISTERS
extern CORE_ADDR alpha_u_regs_offset();
#define U_REGS_OFFSET alpha_u_regs_offset()
#define PTRACE_ARG3_TYPE char*
/* ptrace transfers longs, the ptrace man page is lying. */
#define PTRACE_XFER_TYPE int
/* The alpha does not step over a breakpoint, the manpage is lying again. */
#define CANNOT_STEP_BREAKPOINT
/* Linux has shared libraries. */
#define GDB_TARGET_HAS_SHARED_LIBS
/* Support for shared libraries. */
#include "solib.h"
#ifdef __ELF__
#define SVR4_SHARED_LIBS
#define TARGET_ELF64
#endif
/* This is a lie. It's actually in stdio.h. */
#define PSIGNAL_IN_SIGNAL_H
/* Given a pointer to either a gregset_t or fpregset_t, return a
pointer to the first register. */
#define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp))
extern int kernel_debugging;
extern int kernel_writablecore;

View file

@ -0,0 +1,33 @@
/* Definitions to make GDB run on an Alpha box under FreeBSD. The
definitions here are used when the _target_ system is running Linux.
Copyright 1996 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_FREEBSDALPHA_H
#define TM_FREEBSDALPHA_H
#include "alpha/tm-alpha.h"
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
on FreeBSD and most implementations. */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
#endif /* TM_FREEBSDALPHA_H */

View file

@ -0,0 +1,3 @@
char *version = "4.18";
char *host_name = "alpha-unknown-freebsd";
char *target_name = "alpha-unknown-freebsd";

View file

@ -0,0 +1,30 @@
/* Host definitions for GDB running on an Alpha under FreeBSD
Copyright (C) 1996 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (HOST_BYTE_ORDER)
#define HOST_BYTE_ORDER LITTLE_ENDIAN
#endif
/* The alpha has no siginterrupt routine. */
#define NO_SIGINTERRUPT
#define HAVE_TERMIOS
#define HAVE_SIGSETMASK 1
#include <limits.h>

View file

@ -1,6 +1,18 @@
/* config.h. Generated automatically by configure. */
/* config.in. Generated automatically from configure.in by autoheader. */
/* Whether malloc must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_MALLOC */
/* Whether realloc must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_REALLOC */
/* Whether free must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_FREE */
/* Whether strerror must be declared even if <string.h> is included. */
/* #undef NEED_DECLARATION_STRERROR */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
@ -8,48 +20,180 @@
/* #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 on MINIX. */
/* #undef _MINIX */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* Define if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_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 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 if fpregset_t type is available. */
#define HAVE_FPREGSET_T 1
/* Define if ioctl argument PIOCSET is available. */
/* #undef HAVE_PROCFS_PIOCSET */
/* Define if gregset_t type is available. */
#define HAVE_GREGSET_T 1
/* /proc PID entries are directories containing the files
ctl as map status */
/* #undef HAVE_MULTIPLE_PROC_FDS */
/* 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 you want to use the memory mapped malloc package (mmalloc). */
/* #undef USE_MMALLOC */
/* Define if the runtime uses a routine from mmalloc before gdb has a chance
to initialize mmalloc, and we want to force checking to be used anyway.
This may cause spurious memory corruption messages if the runtime tries
to explicitly deallocate that memory when gdb calls exit. */
/* #undef MMCHECK_FORCE */
/* Define if you want to use the full-screen terminal user interface. */
/* #undef TUI */
/* Define if <proc_service.h> on solaris uses int instead of
size_t, and assorted other type changes. */
/* #undef PROC_SERVICE_IS_OLD */
/* Set to true if the save_state_t structure is present */
#define HAVE_STRUCT_SAVE_STATE_T 0
/* Set to true if the save_state_t structure has the ss_wide member */
#define HAVE_STRUCT_MEMBER_SS_WIDE 0
/* 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 bcopy function. */
#define HAVE_BCOPY 1
/* Define if you have the btowc function. */
/* #undef HAVE_BTOWC */
/* Define if you have the bzero function. */
#define HAVE_BZERO 1
/* 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 isascii function. */
#define HAVE_ISASCII 1
/* Define if you have the munmap function. */
#define HAVE_MUNMAP 1
/* Define if you have the putenv function. */
#define HAVE_PUTENV 1
/* Define if you have the sbrk function. */
#define HAVE_SBRK 1
/* 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 valloc function. */
#define HAVE_VALLOC 1
/* Define if you have the sigaction function. */
#define HAVE_SIGACTION 1
/* Define if you have the stpcpy function. */
/* #undef HAVE_STPCPY */
/* 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 <argz.h> header file. */
/* #undef HAVE_ARGZ_H */
/* Define if you have the <asm/debugreg.h> header file. */
/* #undef HAVE_ASM_DEBUGREG_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 <endian.h> header file. */
/* #undef HAVE_ENDIAN_H */
@ -60,24 +204,57 @@
/* 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 <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 <nl_types.h> header file. */
#define HAVE_NL_TYPES_H 1
/* Define if you have the <objlist.h> header file. */
/* #undef HAVE_OBJLIST_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 <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/param.h> header file. */
#define HAVE_SYS_PARAM_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/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 */
@ -87,5 +264,63 @@
/* 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 <wchar.h> header file. */
/* #undef HAVE_WCHAR_H */
/* Define if you have the <wctype.h> header file. */
/* #undef HAVE_WCTYPE_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 */
/* #undef HAVE_STPCPY */
/* Define if your locale.h file contains LC_MESSAGES. */
#define HAVE_LC_MESSAGES 1
/* Define to 1 if NLS is requested */
#define ENABLE_NLS 1
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* 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 <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

View file

@ -131,7 +131,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
}
if (bad_reg >= 0)
{
error ("Register %s not found in core file.", reg_names[bad_reg]);
error ("Register %s not found in core file.", gdb_register_names[bad_reg]);
}
addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_savefpu);

View file

@ -945,52 +945,29 @@ kernel_core_file_hook (fd, addr, buf, len)
return (cp - buf);
}
struct target_ops kcore_ops = {
"kcore", /* to_shortname */
"Kernel core dump file", /* to_longname */
"Use a core file as a target. Specify the filename of the core file.", /* to_doc */
kcore_open, /* to_open */
kcore_close, /* to_close */
find_default_attach, /* to_attach */
kcore_detach, /* to_detach */
NULL, /* to_resume */
NULL, /* to_wait */
get_kcore_registers, /* to_fetch_registers */
NULL, /* to_store_registers */
NULL, /* to_prepare_to_store */
kcore_xfer_kmem, /* to_xfer_memory */
kcore_files_info, /* to_files_info */
NULL, /* to_insert_breakpoint */
NULL, /* to_remove_breakpoint */
NULL, /* to_terminal_init */
NULL, /* to_terminal_inferior */
NULL, /* to_terminal_ours_for_output */
NULL, /* to_terminal_ours */
NULL, /* to_terminal_info */
NULL, /* to_kill */
NULL, /* to_load */
NULL, /* to_lookup_symbol */
find_default_create_inferior, /* to_create_inferior */
NULL, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
NULL, /* to_thread_alive */
0, /* to_stop */
kcore_stratum, /* to_stratum */
NULL, /* to_next */
0, /* to_has_all_memory */
1, /* to_has_memory */
1, /* to_has_stack */
1, /* to_has_registers */
0, /* to_has_execution */
NULL, /* sections */
NULL, /* sections_end */
OPS_MAGIC /* to_magic */
};
static struct target_ops kcore_ops;
void
_initialize_kcorelow()
{
kcore_ops.to_shortname = "kcore";
kcore_ops.to_longname = "Kernel core dump file";
kcore_ops.to_doc =
"Use a core file as a target. Specify the filename of the core file.";
kcore_ops.to_open = kcore_open;
kcore_ops.to_close = kcore_close;
kcore_ops.to_attach = find_default_attach;
kcore_ops.to_detach = kcore_detach;
kcore_ops.to_fetch_registers = get_kcore_registers;
kcore_ops.to_xfer_memory = kcore_xfer_kmem;
kcore_ops.to_files_info = kcore_files_info;
kcore_ops.to_create_inferior = find_default_create_inferior;
kcore_ops.to_stratum = kcore_stratum;
kcore_ops.to_has_memory = 1;
kcore_ops.to_has_stack = 1;
kcore_ops.to_has_registers = 1;
kcore_ops.to_magic = OPS_MAGIC;
add_target (&kcore_ops);
add_com ("proc", class_obscure, set_proc_cmd, "Set current process context");
add_com ("cpu", class_obscure, set_cpu_cmd, "Set current cpu");

View file

@ -17,8 +17,8 @@ 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
#ifndef NM_FREEBSD_H
#define NM_FREEBSD_H
#define ATTACH_DETACH
@ -132,4 +132,4 @@ extern int kernel_writablecore;
if (!strcmp(STR, "kgdb")) \
kernel_debugging = 1;
#endif /* NM_FBSD_H */
#endif /* NM_FREEBSD_H */

View file

@ -1,5 +1,5 @@
/* Macro definitions for x86 running under FreeBSD Unix.
Copyright 1996 Free Software Foundation, Inc.
/* Target macro definitions for i386 running FreeBSD
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GDB.
@ -15,7 +15,7 @@ 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. */
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef TM_FBSD_H
#define TM_FBSD_H 1
@ -52,7 +52,7 @@ extern CORE_ADDR fbsd_kern_frame_saved_pc (struct frame_info *);
#undef SIGTRAMP_START
#undef SIGTRAMP_END
#define SIGTRAMP_START 0xefbfdfd8
#define SIGTRAMP_END 0xefbfdff0
#define SIGTRAMP_START(pc) 0xcfbfdfd8
#define SIGTRAMP_END(pc) 0xcfbfdff0
#endif /* ifndef TM_FBSD_H */

View file

@ -1,3 +1,3 @@
char *version = "4.16";
char *version = "4.18";
char *host_name = "i386-unknown-freebsd";
char *target_name = "i386-unknown-freebsd";

View file

@ -945,52 +945,29 @@ kernel_core_file_hook (fd, addr, buf, len)
return (cp - buf);
}
struct target_ops kcore_ops = {
"kcore", /* to_shortname */
"Kernel core dump file", /* to_longname */
"Use a core file as a target. Specify the filename of the core file.", /* to_doc */
kcore_open, /* to_open */
kcore_close, /* to_close */
find_default_attach, /* to_attach */
kcore_detach, /* to_detach */
NULL, /* to_resume */
NULL, /* to_wait */
get_kcore_registers, /* to_fetch_registers */
NULL, /* to_store_registers */
NULL, /* to_prepare_to_store */
kcore_xfer_kmem, /* to_xfer_memory */
kcore_files_info, /* to_files_info */
NULL, /* to_insert_breakpoint */
NULL, /* to_remove_breakpoint */
NULL, /* to_terminal_init */
NULL, /* to_terminal_inferior */
NULL, /* to_terminal_ours_for_output */
NULL, /* to_terminal_ours */
NULL, /* to_terminal_info */
NULL, /* to_kill */
NULL, /* to_load */
NULL, /* to_lookup_symbol */
find_default_create_inferior, /* to_create_inferior */
NULL, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
NULL, /* to_thread_alive */
0, /* to_stop */
kcore_stratum, /* to_stratum */
NULL, /* to_next */
0, /* to_has_all_memory */
1, /* to_has_memory */
1, /* to_has_stack */
1, /* to_has_registers */
0, /* to_has_execution */
NULL, /* sections */
NULL, /* sections_end */
OPS_MAGIC /* to_magic */
};
static struct target_ops kcore_ops;
void
_initialize_kcorelow()
{
kcore_ops.to_shortname = "kcore";
kcore_ops.to_longname = "Kernel core dump file";
kcore_ops.to_doc =
"Use a core file as a target. Specify the filename of the core file.";
kcore_ops.to_open = kcore_open;
kcore_ops.to_close = kcore_close;
kcore_ops.to_attach = find_default_attach;
kcore_ops.to_detach = kcore_detach;
kcore_ops.to_fetch_registers = get_kcore_registers;
kcore_ops.to_xfer_memory = kcore_xfer_kmem;
kcore_ops.to_files_info = kcore_files_info;
kcore_ops.to_create_inferior = find_default_create_inferior;
kcore_ops.to_stratum = kcore_stratum;
kcore_ops.to_has_memory = 1;
kcore_ops.to_has_stack = 1;
kcore_ops.to_has_registers = 1;
kcore_ops.to_magic = OPS_MAGIC;
add_target (&kcore_ops);
add_com ("proc", class_obscure, set_proc_cmd, "Set current process context");
add_com ("cpu", class_obscure, set_cpu_cmd, "Set current cpu");