From 0a8f1742669223640fa8b4509418675cfb3ea5a4 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Sun, 11 Jul 1993 23:29:31 +0000 Subject: [PATCH] * configure.in (m68*-bull-sysv*): added support for Bull dpx2. * config/m68k/{t,x,n}m-dpx2.h, dpx2-nat.c: New files. * config/m68k/dpx2.m{h,t}: New files. --- gdb/.Sanitize | 1 + gdb/ChangeLog | 6 +++ gdb/config/m68k/.Sanitize | 5 +++ gdb/config/m68k/dpx2.mh | 9 +++++ gdb/config/m68k/dpx2.mt | 3 ++ gdb/config/m68k/nm-dpx2.h | 29 ++++++++++++++ gdb/config/m68k/tm-dpx2.h | 32 +++++++++++++++ gdb/config/m68k/xm-dpx2.h | 26 ++++++++++++ gdb/configure.in | 2 + gdb/dpx2-nat.c | 83 +++++++++++++++++++++++++++++++++++++++ 10 files changed, 196 insertions(+) diff --git a/gdb/.Sanitize b/gdb/.Sanitize index 206e31483b..f3cb3cc163 100644 --- a/gdb/.Sanitize +++ b/gdb/.Sanitize @@ -84,6 +84,7 @@ dbxread.c defs.h demangle.c doc +dpx2-nat.c dwarfread.c elfread.c environ.c diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 084206ee8e..b44da7119a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Thu Jul 1 15:50:05 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr) + + * configure.in (m68*-bull-sysv*): added support for Bull dpx2. + * config/m68k/{t,x,n}m-dpx2.h, dpx2-nat.c: New files. + * config/m68k/dpx2.m{h,t}: New files. + Sun Jul 11 12:32:08 1993 Doug Evans (dje@canuck.cygnus.com) * config/sparc/tm-sparc.h (PRINT_REGISTER_HOOK): Fix typo, add diff --git a/gdb/config/m68k/.Sanitize b/gdb/config/m68k/.Sanitize index 2a46c1378d..bba5ae2e65 100644 --- a/gdb/config/m68k/.Sanitize +++ b/gdb/config/m68k/.Sanitize @@ -29,6 +29,8 @@ amix.mh amix.mt apollo68b.mh apollo68v.mh +dpx2.mh +dpx2.mt es1800.mt hp300bsd.mh hp300bsd.mt @@ -43,6 +45,7 @@ news.mt news1000.mh nm-apollo68b.h nm-apollo68v.h +nm-dpx2.h nm-hp300bsd.h nm-hp300hpux.h nm-news.h @@ -64,6 +67,7 @@ tm-m68k-nofp.h tm-m68k.h tm-altos.h tm-amix.h +tm-dpx2.h tm-es1800.h tm-hp300bsd.h tm-hp300hpux.h @@ -82,6 +86,7 @@ xm-altos.h xm-amix.h xm-apollo68b.h xm-apollo68v.h +xm-dpx2.h xm-hp300bsd.h xm-hp300hpux.h xm-isi.h diff --git a/gdb/config/m68k/dpx2.mh b/gdb/config/m68k/dpx2.mh index e69de29bb2..7f5f852bd1 100644 --- a/gdb/config/m68k/dpx2.mh +++ b/gdb/config/m68k/dpx2.mh @@ -0,0 +1,9 @@ +# Host: Bull DPX2 (68k, System V release 3) +XDEPFILES= +XM_FILE= xm-dpx2.h +NAT_FILE= nm-dpx2.h +NATDEPFILES= infptrace.o coredep.o corelow.o inftarg.o dpx2-nat.o \ + inftarg.o fork-child.o +REGEX=regex.o +REGEX1=regex.o +TERMCAP=-lcurses diff --git a/gdb/config/m68k/dpx2.mt b/gdb/config/m68k/dpx2.mt index e69de29bb2..948a851e39 100644 --- a/gdb/config/m68k/dpx2.mt +++ b/gdb/config/m68k/dpx2.mt @@ -0,0 +1,3 @@ +# Target: Bull DPX2 (68k, System V release 3) +TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o +TM_FILE= tm-dpx2.h diff --git a/gdb/config/m68k/nm-dpx2.h b/gdb/config/m68k/nm-dpx2.h index e69de29bb2..7986e4c2be 100644 --- a/gdb/config/m68k/nm-dpx2.h +++ b/gdb/config/m68k/nm-dpx2.h @@ -0,0 +1,29 @@ +/* Native support for a Bull DPX2. + Copyright (C) 1986, 1987, 1989 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. */ + +/* KERNEL_U_ADDR is determined upon startup in dpx2-xdep.c. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ + (addr) = dpx2_register_u_addr ((blockend),(regno)); + +extern int +dpx2_register_u_addr PARAMS ((int, int)); + +/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ +#define ONE_PROCESS_WRITETEXT diff --git a/gdb/config/m68k/tm-dpx2.h b/gdb/config/m68k/tm-dpx2.h index e69de29bb2..1483026bb4 100644 --- a/gdb/config/m68k/tm-dpx2.h +++ b/gdb/config/m68k/tm-dpx2.h @@ -0,0 +1,32 @@ +/* Parameters for targeting to a Bull DPX2. + Copyright (C) 1986, 1987, 1989, 1991 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. */ + +/* Define BPT_VECTOR if it is different than the default. + This is the vector number used by traps to indicate a breakpoint. */ + +#define BPT_VECTOR 0xe + +#define HAVE_68881 + +/* Need to get function ends by adding this to epilogue address from .bf + record, not using x_fsize field. */ +#define FUNCTION_EPILOGUE_SIZE 4 + +#include +#include "tm-68k.h" diff --git a/gdb/config/m68k/xm-dpx2.h b/gdb/config/m68k/xm-dpx2.h index e69de29bb2..f533cd9da0 100644 --- a/gdb/config/m68k/xm-dpx2.h +++ b/gdb/config/m68k/xm-dpx2.h @@ -0,0 +1,26 @@ +/* Parameters for execution on a Bull DPX2. + Copyright (C) 1986, 1987, 1989 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. */ + +#define HOST_BYTE_ORDER BIG_ENDIAN + +#define HAVE_TERMIO +#define USG + +/* Avoid redefinition errors */ +#include diff --git a/gdb/configure.in b/gdb/configure.in index 945cc5c5d9..f5ee1288ba 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -59,6 +59,7 @@ m68*-altos-*) gdb_host=altos ;; m68*-apollo*-sysv*) gdb_host=apollo68v ;; m68*-apollo*-bsd*) gdb_host=apollo68b ;; m68*-att-*) gdb_host=3b1 ;; +m68*-bull*-sysv*) gdb_host=dpx2 ;; m68*-cbm-sysv4*) gdb_host=amix ;; m68*-hp-bsd*) gdb_host=hp300bsd ;; m68*-hp-hpux*) gdb_host=hp300hpux ;; @@ -199,6 +200,7 @@ m68000-*-sunos3*) gdb_target=sun2os3 ;; m68000-*-sunos4*) gdb_target=sun2os4 ;; m68*-cbm-sysv4*) gdb_target=amix ;; +m68*-bull-sysv*) gdb_target=dpx2 ;; m68*-hp-bsd*) gdb_target=hp300bsd ;; m68*-hp-hpux*) gdb_target=hp300hpux ;; diff --git a/gdb/dpx2-nat.c b/gdb/dpx2-nat.c index e69de29bb2..ee1ccb7550 100644 --- a/gdb/dpx2-nat.c +++ b/gdb/dpx2-nat.c @@ -0,0 +1,83 @@ +/* DPX2 host interface. + Copyright (C) 1988, 1989, 1991 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. */ + +#include "defs.h" +#include "gdbcore.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +/* this table must line up with REGISTER_NAMES in tm-68k.h */ +/* symbols like 'A0' come from */ +static int regmap[] = +{ + R0, R1, R2, R3, R4, R5, R6, R7, + A0, A1, A2, A3, A4, A5, A6, SP, + PS, PC, + FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7, + FP_CR, FP_SR, FP_IAR +}; + +/* blockend is the value of u.u_ar0, and points to the + * place where D0 is stored + */ + +int +dpx2_register_u_addr (blockend, regnum) + int blockend; + int regnum; +{ + if (regnum < FP0_REGNUM) + return (blockend + 4 * regmap[regnum]); + else + return (int) &(((struct user *)0)->u_fpstate[regmap[regnum]]); +} + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. + Unfortunately this is not provided in the system header files. + To make matters worse, this value also differs between + the dpx/2200 and dpx/2300 models and nlist is not available on the dpx2. + We use utsname() to decide on which model we are running. + FIXME: This breaks cross examination of core files (it would not be hard + to check whether u.u_ar0 is between 0x7fff5000 and 0x7fffc000 and if so + use 0x7fff5000 and if not use 0x7fffc000. FIXME). */ + +#define KERNEL_U_ADDR_200 0x7fff5000 +#define KERNEL_U_ADDR_300 0x7fffc000 + +CORE_ADDR kernel_u_addr; + +void +_initialize_kernel_u_addr () +{ + struct utsname uts; + + if (uname (&uts) == 0 && strcmp (uts.machine, "DPX/2200") == 0) + kernel_u_addr = KERNEL_U_ADDR_200; + else + kernel_u_addr = KERNEL_U_ADDR_300; +} -- 2.34.1