Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/gnu/dist/toolchain/gdb Replace Mark Brinicombe's NetBSD/arm ...
details: https://anonhg.NetBSD.org/src/rev/9316e10606ba
branches: trunk
changeset: 516401:9316e10606ba
user: bjh21 <bjh21%NetBSD.org@localhost>
date: Mon Oct 22 21:09:47 2001 +0000
description:
Replace Mark Brinicombe's NetBSD/arm glue with Richard Earnshaw's, since the
latter is likely to be easier to get into the GNU sources. I believe the only
functional change is the loss of a working get_longjmp_target().
diffstat:
gnu/dist/toolchain/gdb/Makefile.in | 4 +-
gnu/dist/toolchain/gdb/arm-tdep.c | 27 -----
gnu/dist/toolchain/gdb/armnbsd-nat.c | 136 +++++++++++----------------
gnu/dist/toolchain/gdb/config/arm/nbsd.mh | 10 +-
gnu/dist/toolchain/gdb/config/arm/nbsd.mt | 2 +-
gnu/dist/toolchain/gdb/config/arm/nm-nbsd.h | 39 ++++---
gnu/dist/toolchain/gdb/config/arm/tm-nbsd.h | 68 +++++++------
gnu/dist/toolchain/gdb/config/arm/xm-nbsd.h | 27 ++--
gnu/dist/toolchain/gdb/configure.host | 2 +-
gnu/dist/toolchain/gdb/configure.tgt | 2 +-
10 files changed, 140 insertions(+), 177 deletions(-)
diffs (truncated from 490 to 300 lines):
diff -r 99fab8c81b02 -r 9316e10606ba gnu/dist/toolchain/gdb/Makefile.in
--- a/gnu/dist/toolchain/gdb/Makefile.in Mon Oct 22 20:59:02 2001 +0000
+++ b/gnu/dist/toolchain/gdb/Makefile.in Mon Oct 22 21:09:47 2001 +0000
@@ -1060,7 +1060,7 @@
29k-share/udi/udi2go32.c \
a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
altos-xdep.c arm-convert.s \
- arm-linux-nat.c arm-linux-tdep.c arm-tdep.c arm-xdep.c \
+ arm-linux-nat.c arm-linux-tdep.c arm-tdep.c arm-xdep.c armnbsd-nat.c \
coff-solib.c convex-tdep.c convex-xdep.c \
core-sol2.c core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
@@ -1133,6 +1133,8 @@
arm-tdep.o: arm-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \
$(gdbcore_h)
+armnbsd-nat.o: armbsd-nat.c $(defs_h)
+
bcache.o: bcache.c bcache.h $(defs_h)
blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
diff -r 99fab8c81b02 -r 9316e10606ba gnu/dist/toolchain/gdb/arm-tdep.c
--- a/gnu/dist/toolchain/gdb/arm-tdep.c Mon Oct 22 20:59:02 2001 +0000
+++ b/gnu/dist/toolchain/gdb/arm-tdep.c Mon Oct 22 21:09:47 2001 +0000
@@ -2143,30 +2143,3 @@
val == C_THUMBSTATFUNC ||
val == C_THUMBLABEL);
}
-
-#ifdef GET_LONGJMP_TARGET
-
-/* Figure out where the longjmp will land. Slurp the args out of the stack.
- 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(0);
-
- 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;
-
-}
-
-#endif /* GET_LONGJMP_TARGET */
diff -r 99fab8c81b02 -r 9316e10606ba gnu/dist/toolchain/gdb/armnbsd-nat.c
--- a/gnu/dist/toolchain/gdb/armnbsd-nat.c Mon Oct 22 20:59:02 2001 +0000
+++ b/gnu/dist/toolchain/gdb/armnbsd-nat.c Mon Oct 22 21:09:47 2001 +0000
@@ -1,74 +1,71 @@
-/* Native-dependent code for BSD Unix running on i386's, for GDB.
- Copyright 1988, 1989, 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
+/* Native-dependent code for BSD Unix running on ARM's, for GDB.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999 Free Software Foundation, Inc.
+
+ This file is part of GDB.
-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 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.
-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. */
+ 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"
+#ifdef FETCH_INFERIOR_REGISTERS
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/ptrace.h>
#include <sys/sysctl.h>
-#include <sys/user.h>
#include <machine/reg.h>
+#include <machine/frame.h>
#include "inferior.h"
-#include "gdbcore.h"
-#include "target.h"
void
-fetch_inferior_registers(regno)
+fetch_inferior_registers (regno)
int regno;
{
struct reg inferior_registers;
- struct fpreg fp_registers;
- int loop;
+ struct fpreg inferior_fpregisters;
- /* integer registers */
- ptrace(PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
- memcpy(®isters[REGISTER_BYTE(0)], &inferior_registers, 4*16);
- memcpy(®isters[REGISTER_BYTE(PS_REGNUM)], &inferior_registers.r_cpsr, 4);
-
- /* floating point registers */
- ptrace(PT_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fp_registers, 0);
- memcpy(®isters[REGISTER_BYTE(F0_REGNUM)], &fp_registers.fpr[0], 12*8);
- memcpy(®isters[REGISTER_BYTE(FPS_REGNUM)], &fp_registers.fpr_fpsr, 4);
-
+ ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers,
+ 16 * sizeof (unsigned int));
+ memcpy (®isters[REGISTER_BYTE (PS_REGNUM)], &inferior_registers.r_cpsr,
+ sizeof (unsigned int));
+ ptrace (PT_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_fpregisters,
+ 0);
+ memcpy (®isters[REGISTER_BYTE (F0_REGNUM)], &inferior_fpregisters.fpr[0],
+ 8 * sizeof (fp_reg_t));
+ memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)],
+ &inferior_fpregisters.fpr_fpsr, sizeof (unsigned int));
registers_fetched ();
}
void
-store_inferior_registers(regno)
+store_inferior_registers (regno)
int regno;
{
struct reg inferior_registers;
- struct fpreg fp_registers;
- /* integer registers */
- memcpy(&inferior_registers.r_cpsr, ®isters[REGISTER_BYTE(PS_REGNUM)], 4);
- memcpy(&inferior_registers, ®isters[REGISTER_BYTE(0)], 4*16);
- ptrace(PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)],
+ 16 * sizeof (unsigned int));
+ memcpy (&inferior_registers.r_cpsr, ®isters[REGISTER_BYTE (PS_REGNUM)],
+ sizeof (unsigned int));
+ ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
- /* floating point registers */
- memcpy(&fp_registers.fpr_fpsr, ®isters[REGISTER_BYTE(FPS_REGNUM)], 4);
- memcpy(&fp_registers.fpr[0], ®isters[REGISTER_BYTE(F0_REGNUM)], 12*8);
- ptrace(PT_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fp_registers, 0);
+ /* XXX Set FP regs. */
}
-struct md_core {
+struct md_core
+{
struct reg intreg;
struct fpreg freg;
};
@@ -78,53 +75,31 @@
char *core_reg_sect;
unsigned core_reg_size;
int which;
- unsigned int ignore;
+ CORE_ADDR ignore;
{
- struct md_core *core_reg = (struct md_core *)core_reg_sect;
+ struct md_core *core_reg = (struct md_core *) core_reg_sect;
/* integer registers */
- memcpy(®isters[REGISTER_BYTE(0)], &core_reg->intreg, 4*16);
- memcpy(®isters[REGISTER_BYTE(PS_REGNUM)], &core_reg->intreg.r_cpsr, 4);
-
+ memcpy (®isters[REGISTER_BYTE (0)], &core_reg->intreg,
+ sizeof (struct reg));
/* floating point registers */
- memcpy(®isters[REGISTER_BYTE(F0_REGNUM)], &core_reg->freg.fpr[0], 12*8);
- memcpy(®isters[REGISTER_BYTE(FPS_REGNUM)], &core_reg->freg.fpr_fpsr, 4);
-}
-
-int
-kernel_u_size ()
-{
- return (sizeof (struct user));
+ /* XXX */
}
-/*
- * NetBSD core stuf should be in netbsd-core.c
- */
+#else
+#error Not FETCH_INFERIOR_REGISTERS
+#endif /* !FETCH_INFERIOR_REGISTERS */
-static struct core_fns netbsd_core_fns =
+int
+get_longjmp_target (CORE_ADDR *addr)
{
- bfd_target_unknown_flavour,
- default_check_format,
- default_core_sniffer,
- fetch_core_registers,
- NULL
-};
-
-void
-_initialize_core_netbsd ()
-{
- add_core_fns (&netbsd_core_fns);
+ return 0;
}
-/*
- * Temporary routine to warn folks this code is still experimental
- */
-
extern int arm_apcs_32;
-extern char *target_name;
void
-_initialize_armnbsd_nat ()
+_initialize_armnbsd_nat (void)
{
int mib[2];
char machine[16];
@@ -137,9 +112,8 @@
appropriate. */
mib[0] = CTL_HW;
mib[1] = HW_MACHINE;
- len = sizeof(machine);
- if (sysctl(mib, 2, machine, &len, NULL, 0) == 0 &&
- strcmp(machine, "arm26") == 0)
+ len = sizeof (machine);
+ if (sysctl (mib, 2, machine, &len, NULL, 0) == 0 &&
+ strcmp (machine, "arm26") == 0)
arm_apcs_32 = 0;
}
-
diff -r 99fab8c81b02 -r 9316e10606ba gnu/dist/toolchain/gdb/config/arm/nbsd.mh
--- a/gnu/dist/toolchain/gdb/config/arm/nbsd.mh Mon Oct 22 20:59:02 2001 +0000
+++ b/gnu/dist/toolchain/gdb/config/arm/nbsd.mh Mon Oct 22 21:09:47 2001 +0000
@@ -1,5 +1,5 @@
-# Host: ARM running NetBSD
-XDEPFILES=
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o armnbsd-nat.o
-XM_FILE= xm-nbsd.h
-NAT_FILE= nm-nbsd.h
+# Host ARM running NetBSD
+XDEPFILES= ser-tcp.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o armbsd-nat.o
+XM_FILE=xm-nbsd.h
+NAT_FILE=nm-nbsd.h
diff -r 99fab8c81b02 -r 9316e10606ba gnu/dist/toolchain/gdb/config/arm/nbsd.mt
--- a/gnu/dist/toolchain/gdb/config/arm/nbsd.mt Mon Oct 22 20:59:02 2001 +0000
+++ b/gnu/dist/toolchain/gdb/config/arm/nbsd.mt Mon Oct 22 21:09:47 2001 +0000
@@ -1,3 +1,3 @@
# Target: ARM running NetBSD
-TDEPFILES= arm-tdep.o solib.o
+TDEPFILES= arm-tdep.o solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
diff -r 99fab8c81b02 -r 9316e10606ba gnu/dist/toolchain/gdb/config/arm/nm-nbsd.h
--- a/gnu/dist/toolchain/gdb/config/arm/nm-nbsd.h Mon Oct 22 20:59:02 2001 +0000
+++ b/gnu/dist/toolchain/gdb/config/arm/nm-nbsd.h Mon Oct 22 21:09:47 2001 +0000
@@ -1,32 +1,37 @@
-/* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994 Free Software Foundation, Inc.
+/* 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 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 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.
Home |
Main Index |
Thread Index |
Old Index