diff options
Diffstat (limited to 'gdb/config/m68k')
70 files changed, 3081 insertions, 0 deletions
diff --git a/gdb/config/m68k/3b1.mh b/gdb/config/m68k/3b1.mh new file mode 100644 index 0000000..fd484f7 --- /dev/null +++ b/gdb/config/m68k/3b1.mh @@ -0,0 +1,12 @@ +# Host: AT&T 3b1/Unix pc +# I don't think cc has been tried. -traditional for <sys/ioctl.h> +# (not sure whether necessary). +CC= gcc -traditional +# GCC runs out of virtual memory. +# A separate CC for pinsn routines is no longer supported, though. +# FIXME -- someone unlucky enough to have a 3B1, let bug-gcc@prep.ai.mit.edu +# know what works and what fails on the 3B1. +#PINSN_CC= cc + +XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o +XM_FILE= xm-3b1.h diff --git a/gdb/config/m68k/3b1.mt b/gdb/config/m68k/3b1.mt new file mode 100644 index 0000000..bba2ed1 --- /dev/null +++ b/gdb/config/m68k/3b1.mt @@ -0,0 +1,3 @@ +# Target: AT&T 3b1/Unix pc +TDEPFILES= exec.o m68k-pinsn.o +TM_FILE= tm-3b1.h diff --git a/gdb/config/m68k/altos.mh b/gdb/config/m68k/altos.mh new file mode 100644 index 0000000..13c37a7 --- /dev/null +++ b/gdb/config/m68k/altos.mh @@ -0,0 +1,6 @@ +# Host: Altos 3068 (68k, System V release 2) +XDEPFILES= infptrace.o inftarg.o fork-child.o altos-xdep.o +XM_FILE= xm-altos.h +REGEX=regex.o +REGEX1=regex.o +SYSV_DEFINE=-DSYSV diff --git a/gdb/config/m68k/altos.mt b/gdb/config/m68k/altos.mt new file mode 100644 index 0000000..d156615 --- /dev/null +++ b/gdb/config/m68k/altos.mt @@ -0,0 +1,3 @@ +# Target: Altos 3068 (68k, System V release 2) +TDEPFILES= m68k-pinsn.o exec.o +TM_FILE= tm-altos.h diff --git a/gdb/config/m68k/amix.mh b/gdb/config/m68k/amix.mh new file mode 100644 index 0000000..ad3afed --- /dev/null +++ b/gdb/config/m68k/amix.mh @@ -0,0 +1,26 @@ +# Host: Commodore Amiga running SVR4. +NAT_FILE= nm-sysv4.h +NATDEPFILES= corelow.o procfs.o fork-child.o +XDEPFILES= +XM_FILE= xm-amix.h +SYSV_DEFINE=-DSYSV +REGEX=regex.o +REGEX1=regex.o + +# We need to find alloca() somewhere. Gcc has one built in, but most other +# compilers don't. Using the one in /usr/ucblib/libucb.a is tricky because +# we have to be careful not to pull in anything else from the library (lots +# of things are broken in most SVR4 versions). The best solution is to just +# compile alloca.c and link it into the executable. If we end up not needing +# it, then the code is just dead. Once alloca.c moves to libiberty, then we +# can eliminate this semi-kludge. +ALLOCA=alloca.o +ALLOCA1=alloca.o + +# SVR4 comes standard with terminfo, and in some implementations, the +# old termcap descriptions are incomplete. So ensure that we use the +# new terminfo interface and latest terminal descriptions. +TERMCAP=-ltermlib + +# SVR4 puts the BSD compatible install in /usr/ucb. +INSTALL = /usr/ucb/install -c diff --git a/gdb/config/m68k/amix.mt b/gdb/config/m68k/amix.mt new file mode 100644 index 0000000..91166b9 --- /dev/null +++ b/gdb/config/m68k/amix.mt @@ -0,0 +1,3 @@ +# Target: Commodore Amiga running SVR4 +TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o solib.o +TM_FILE= tm-amix.h diff --git a/gdb/config/m68k/apollo68b.mh b/gdb/config/m68k/apollo68b.mh new file mode 100644 index 0000000..58f7313 --- /dev/null +++ b/gdb/config/m68k/apollo68b.mh @@ -0,0 +1,6 @@ +# Host: Apollo 68k, BSD mode. + +XM_FILE= xm-apollo68b.h +XDEPFILES= ser-bsd.o +NAT_FILE= nm-apollo68b.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o diff --git a/gdb/config/m68k/apollo68v.mh b/gdb/config/m68k/apollo68v.mh new file mode 100644 index 0000000..f710724 --- /dev/null +++ b/gdb/config/m68k/apollo68v.mh @@ -0,0 +1,10 @@ +RANLIB=echo >/dev/null +XM_FILE= xm-apollo68v.h +XM_CLIBS= -lPW +SYSV_DEFINE=-DSYSV +REGEX=regex.o +REGEX1=regex.o +CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_SYS_FILE +XDEPFILES= +NAT_FILE= nm-apollo68v.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o diff --git a/gdb/config/m68k/es1800.mt b/gdb/config/m68k/es1800.mt new file mode 100644 index 0000000..fd42163 --- /dev/null +++ b/gdb/config/m68k/es1800.mt @@ -0,0 +1,3 @@ +# Target: Ericcson ES-1800 emulator (remote) for m68k. +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o remote-es1800.o +TM_FILE= tm-es1800.h diff --git a/gdb/config/m68k/hp300bsd.mh b/gdb/config/m68k/hp300bsd.mh new file mode 100644 index 0000000..fd2fa4b --- /dev/null +++ b/gdb/config/m68k/hp300bsd.mh @@ -0,0 +1,7 @@ +# Host: Hewlett-Packard 9000 series 300, running BSD +XDEPFILES= +XM_FILE= xm-hp300bsd.h +NAT_FILE= nm-hp300bsd.h +NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o coredep.o corelow.o +REGEX=regex.o +REGEX1=regex.o diff --git a/gdb/config/m68k/hp300bsd.mt b/gdb/config/m68k/hp300bsd.mt new file mode 100644 index 0000000..7690f09 --- /dev/null +++ b/gdb/config/m68k/hp300bsd.mt @@ -0,0 +1,3 @@ +# Target: Hewlett-Packard 9000 series 300, running BSD +TDEPFILES= m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-hp300bsd.h diff --git a/gdb/config/m68k/hp300hpux.mh b/gdb/config/m68k/hp300hpux.mh new file mode 100644 index 0000000..43e27a3 --- /dev/null +++ b/gdb/config/m68k/hp300hpux.mh @@ -0,0 +1,15 @@ +# Host: Hewlett-Packard 9000 series 300, running HPUX +# The following is true because gcc uses a different .o file format +# than the native HPUX compiler +#msg If you compile GDB with GCC on HPUX, you must make sure +#msg that the `nm' used in `munch' is GNU nm +#msg + +XM_FILE= xm-hp300hpux.h +NAT_FILE= nm-hp300hpux.h +NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o hp300ux-nat.o +SYSV_DEFINE=-DSYSV +REGEX=regex.o +REGEX1=regex.o +ALLOCA=alloca.o +ALLOCA1=alloca.o diff --git a/gdb/config/m68k/hp300hpux.mt b/gdb/config/m68k/hp300hpux.mt new file mode 100644 index 0000000..a8902cd --- /dev/null +++ b/gdb/config/m68k/hp300hpux.mt @@ -0,0 +1,11 @@ +# Target: Hewlett-Packard 9000 series 300, running HPUX + +#msg Note that GDB can only read symbols from programs that were +#msg compiled with GCC +#msg + +# The headers in the directory hp-include override system headers +# and tell GDB to use BSD executable file format (hence -Ihp-include) +MT_CFLAGS=-Ihp-include +TDEPFILES= m68k-pinsn.o +TM_FILE= tm-hp300hpux.h diff --git a/gdb/config/m68k/isi.mh b/gdb/config/m68k/isi.mh new file mode 100644 index 0000000..b0a5bed --- /dev/null +++ b/gdb/config/m68k/isi.mh @@ -0,0 +1,3 @@ +# Host: ISI Optimum V (3.05) under 4.3bsd. +XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o +XM_FILE= xm-isi.h diff --git a/gdb/config/m68k/isi.mt b/gdb/config/m68k/isi.mt new file mode 100644 index 0000000..fb4d83f --- /dev/null +++ b/gdb/config/m68k/isi.mt @@ -0,0 +1,3 @@ +# Target: ISI Optimum V (3.05) under 4.3bsd. +TDEPFILES= exec.o m68k-pinsn.o +TM_FILE= tm-isi.h diff --git a/gdb/config/m68k/m68k-fp.mt b/gdb/config/m68k/m68k-fp.mt new file mode 100644 index 0000000..139595b --- /dev/null +++ b/gdb/config/m68k/m68k-fp.mt @@ -0,0 +1,3 @@ +# Target: Motorola 68xxx with floating point +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-68k-fp.h diff --git a/gdb/config/m68k/m68k-nofp.mt b/gdb/config/m68k/m68k-nofp.mt new file mode 100644 index 0000000..a2465bf --- /dev/null +++ b/gdb/config/m68k/m68k-nofp.mt @@ -0,0 +1,3 @@ +# Target: Motorola 68xxx without floating point +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-68k-nofp.h diff --git a/gdb/config/m68k/news.mh b/gdb/config/m68k/news.mh new file mode 100644 index 0000000..64f8de85 --- /dev/null +++ b/gdb/config/m68k/news.mh @@ -0,0 +1,5 @@ +# Host: Sony news series 700/800/900 (68020) running NewsOS version 3. +XDEPFILES= news-xdep.o +XM_FILE= xm-news.h +NAT_FILE= nm-news.h +NATDEPFILES= exec.o inftarg.o fork-child.o coredep.o corelow.o infptrace.o diff --git a/gdb/config/m68k/news.mt b/gdb/config/m68k/news.mt new file mode 100644 index 0000000..5c595ea --- /dev/null +++ b/gdb/config/m68k/news.mt @@ -0,0 +1,3 @@ +# Target: Sony news series 700/800/900 (68020) running NewsOS version 3. +TDEPFILES= m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-news.h diff --git a/gdb/config/m68k/news1000.mh b/gdb/config/m68k/news1000.mh new file mode 100644 index 0000000..0a03a89 --- /dev/null +++ b/gdb/config/m68k/news1000.mh @@ -0,0 +1,3 @@ +# Host: Sony news series 1000 (68030) running NewsOS version 3. +XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o news-xdep.o +XM_FILE= xm-news1000.h diff --git a/gdb/config/m68k/nm-apollo68b.h b/gdb/config/m68k/nm-apollo68b.h new file mode 100644 index 0000000..ba2998a --- /dev/null +++ b/gdb/config/m68k/nm-apollo68b.h @@ -0,0 +1,23 @@ +/* Macro defintions for an Apollo 68k in BSD mode + Copyright (C) 1992 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 PTRACE_IN_WRONG_PLACE + +#define FETCH_INFERIOR_REGISTERS + diff --git a/gdb/config/m68k/nm-apollo68v.h b/gdb/config/m68k/nm-apollo68v.h new file mode 100644 index 0000000..6c83f38 --- /dev/null +++ b/gdb/config/m68k/nm-apollo68v.h @@ -0,0 +1,20 @@ +/* Macro defintions for an Apollo. + Copyright (C) 1986, 1987, 1989, 1992 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 FETCH_INFERIOR_REGISTERS diff --git a/gdb/config/m68k/nm-hp300bsd.h b/gdb/config/m68k/nm-hp300bsd.h new file mode 100644 index 0000000..3531842 --- /dev/null +++ b/gdb/config/m68k/nm-hp300bsd.h @@ -0,0 +1,97 @@ +/* Parameters for Hewlett-Packard 9000/300 native support under bsd. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 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. */ + +/* This is a hack. This is only a hack. Were this a common source file, + rather than a config file specific to BSD on HP 68k's, you would have + been instructed to clean this up. As it is, clean it up if FSF's + HP's-running-ancient-BSD ever go away. */ + +#include <errno.h> +#ifdef EPROCUNAVAIL + /* BSD 4.4 alpha or better */ + + /* We can attach to processes using ptrace. */ + +#define ATTACH_DETACH +#define PTRACE_ATTACH 10 +#define PTRACE_DETACH 11 + + /* The third argument of ptrace is declared as this type. */ + +#define PTRACE_ARG3_TYPE caddr_t + +/* U_REGS_OFFSET is the offset of the registers within the u area for + ptrace purposes. */ +#define U_REGS_OFFSET \ + ptrace (PT_READ_U, inferior_pid, \ + (PTRACE_ARG3_TYPE) \ + (offsetof (struct user, u_kproc.kp_proc.p_md.md_regs)), 0) \ + - USRSTACK + + /* This is a piece of magic that is given a register number REGNO + and as BLOCKEND the address in the system of the end of the user structure + and stores in ADDR the address in the kernel or core dump + of that register. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ \ + if (regno < PS_REGNUM) \ + addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \ + else if (regno == PS_REGNUM) \ + addr = (int) &((struct frame *)(blockend))->f_stackadj; \ + else if (regno == PC_REGNUM) \ + addr = (int) &((struct frame *)(blockend))->f_pc; \ + else if (regno < FPC_REGNUM) \ + addr = (int) \ + &((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\ + else if (regno == FPC_REGNUM) \ + addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \ + else if (regno == FPS_REGNUM) \ + addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \ + else \ + addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \ +} +#else + +/* THIS IS BSD 4.3 or something like it. */ + +/* This is a piece of magic that is given a register number REGNO + and as BLOCKEND the address in the system of the end of the user structure + and stores in ADDR the address in the kernel or core dump + of that register. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ \ + if (regno < PS_REGNUM) \ + addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \ + else if (regno == PS_REGNUM) \ + addr = (int) &((struct frame *)(blockend))->f_stackadj; \ + else if (regno == PC_REGNUM) \ + addr = (int) &((struct frame *)(blockend))->f_pc; \ + else if (regno < FPC_REGNUM) \ + addr = (int) \ + &((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\ + else if (regno == FPC_REGNUM) \ + addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \ + else if (regno == FPS_REGNUM) \ + addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \ + else \ + addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \ +} +#endif diff --git a/gdb/config/m68k/nm-hp300hpux.h b/gdb/config/m68k/nm-hp300hpux.h new file mode 100644 index 0000000..060f792 --- /dev/null +++ b/gdb/config/m68k/nm-hp300hpux.h @@ -0,0 +1,26 @@ +/* Parameters for native support on HP 9000 model 320, for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1992 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. */ + +/* Do implement the attach and detach commands. */ + +#define ATTACH_DETACH + +/* fetch_inferior_registers is in nat-hp300hpux.c. */ +#define FETCH_INFERIOR_REGISTERS + diff --git a/gdb/config/m68k/nm-news.h b/gdb/config/m68k/nm-news.h new file mode 100644 index 0000000..881b734 --- /dev/null +++ b/gdb/config/m68k/nm-news.h @@ -0,0 +1,20 @@ +/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger. + Copyright 1987, 1989, 1992 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. */ + +/* This file intentionally empty. */ diff --git a/gdb/config/m68k/nm-sun2.h b/gdb/config/m68k/nm-sun2.h new file mode 100644 index 0000000..65ecaed --- /dev/null +++ b/gdb/config/m68k/nm-sun2.h @@ -0,0 +1,33 @@ +/* Parameters for execution on a Sun2, for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1992 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. */ + +/* Do implement the attach and detach commands. */ + +#define ATTACH_DETACH + +/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ +#define FETCH_INFERIOR_REGISTERS + +/* This is a piece of magic that is given a register number REGNO + and as BLOCKEND the address in the system of the end of the user structure + and stores in ADDR the address in the kernel or core dump + of that register. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ addr = blockend + regno * 4; } diff --git a/gdb/config/m68k/nm-sun3.h b/gdb/config/m68k/nm-sun3.h new file mode 100644 index 0000000..31972bb --- /dev/null +++ b/gdb/config/m68k/nm-sun3.h @@ -0,0 +1,26 @@ +/* Host-dependent definitions for Sun-3 for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992 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. */ + +/* Do implement the attach and detach commands. */ + +#define ATTACH_DETACH + +/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ + +#define FETCH_INFERIOR_REGISTERS diff --git a/gdb/config/m68k/os68k.mt b/gdb/config/m68k/os68k.mt new file mode 100644 index 0000000..a921691 --- /dev/null +++ b/gdb/config/m68k/os68k.mt @@ -0,0 +1,3 @@ +# Target: VxWorks running on a 68000 +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-os68k.h diff --git a/gdb/config/m68k/st2000.mt b/gdb/config/m68k/st2000.mt new file mode 100644 index 0000000..d3c21f3 --- /dev/null +++ b/gdb/config/m68k/st2000.mt @@ -0,0 +1,7 @@ +# Target: Tandem ST-2000 phone switch +# These defines should give you a gdb running on anything that will be able to +# communicate with a Tandem ST2000 phone switch debug monitor. Communications +# is facilitated via either a serial line, or a TCP or TELNET connection to +# a serial line on a terminal multiplexor. +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o remote-st2000.o +TM_FILE= tm-st2000.h diff --git a/gdb/config/m68k/sun2os3.mh b/gdb/config/m68k/sun2os3.mh new file mode 100644 index 0000000..a3ef627 --- /dev/null +++ b/gdb/config/m68k/sun2os3.mh @@ -0,0 +1,5 @@ +# Host: Sun 2, running SunOS 3 +XDEPFILES= +XM_FILE= xm-sun2.h +NAT_FILE= nm-sun2.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o diff --git a/gdb/config/m68k/sun2os3.mt b/gdb/config/m68k/sun2os3.mt new file mode 100644 index 0000000..bee830d --- /dev/null +++ b/gdb/config/m68k/sun2os3.mt @@ -0,0 +1,8 @@ +# Target: Sun 2, running SunOS 3 +# The system-supplied assembler re-orders the symbols so that gdb +# can't find "gcc_compiled.". +#msg If you compile your program with GCC, use the GNU assembler. +#msg + +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-sun2.h diff --git a/gdb/config/m68k/sun2os4.mh b/gdb/config/m68k/sun2os4.mh new file mode 100644 index 0000000..617642d --- /dev/null +++ b/gdb/config/m68k/sun2os4.mh @@ -0,0 +1,5 @@ +# Host: Sun 2, running SunOS 4 +XDEPFILES= +XM_FILE= xm-sun2.h +NAT_FILE= nm-sun2.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o diff --git a/gdb/config/m68k/sun2os4.mt b/gdb/config/m68k/sun2os4.mt new file mode 100644 index 0000000..4443c5b --- /dev/null +++ b/gdb/config/m68k/sun2os4.mt @@ -0,0 +1,3 @@ +# Target: Sun 2, running SunOS 4 +TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o +TM_FILE= tm-sun2os4.h diff --git a/gdb/config/m68k/sun3os3.mh b/gdb/config/m68k/sun3os3.mh new file mode 100644 index 0000000..1b93793 --- /dev/null +++ b/gdb/config/m68k/sun3os3.mh @@ -0,0 +1,5 @@ +# Host: Sun 3, running SunOS 3 +XDEPFILES= +XM_FILE= xm-sun3.h +NAT_FILE= nm-sun3.h +NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o diff --git a/gdb/config/m68k/sun3os3.mt b/gdb/config/m68k/sun3os3.mt new file mode 100644 index 0000000..fa3c662 --- /dev/null +++ b/gdb/config/m68k/sun3os3.mt @@ -0,0 +1,8 @@ +# Target: Sun 3, running SunOS 3 +# The system-supplied assembler re-orders the symbols so that gdb +# can't find "gcc_compiled.". +#msg If you compile your program with GCC, use the GNU assembler. +#msg + +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o +TM_FILE= tm-sun3.h diff --git a/gdb/config/m68k/sun3os4.mh b/gdb/config/m68k/sun3os4.mh new file mode 100644 index 0000000..460f302 --- /dev/null +++ b/gdb/config/m68k/sun3os4.mh @@ -0,0 +1,5 @@ +# Host: Sun 3, running SunOS 4 +XDEPFILES= +XM_FILE= xm-sun3os4.h +NAT_FILE= nm-sun3.h +NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o diff --git a/gdb/config/m68k/sun3os4.mt b/gdb/config/m68k/sun3os4.mt new file mode 100644 index 0000000..c249002 --- /dev/null +++ b/gdb/config/m68k/sun3os4.mt @@ -0,0 +1,3 @@ +# Target: Sun 3, running SunOS 4, as a target system +TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o +TM_FILE= tm-sun3os4.h diff --git a/gdb/config/m68k/tm-3b1.h b/gdb/config/m68k/tm-3b1.h new file mode 100644 index 0000000..b9bd4ef --- /dev/null +++ b/gdb/config/m68k/tm-3b1.h @@ -0,0 +1,29 @@ +/* Parameters for targeting GDB to a 3b1. + Copyright 1986, 1987, 1989, 1991, 1993 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 0x1 + +/* Address of end of stack space. */ + +#define STACK_END_ADDR 0x300000 + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-68k-fp.h b/gdb/config/m68k/tm-68k-fp.h new file mode 100644 index 0000000..73e228c --- /dev/null +++ b/gdb/config/m68k/tm-68k-fp.h @@ -0,0 +1,66 @@ +/* Target machine parameters for embedded m68k with 6888x float, for GDB. + Copyright 1986, 1987, 1989, 1992, 1993 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 HAVE_68881 + +#include "m68k/tm-68k.h" + +/* Longjmp info comes from the Sun-3 machine description. Might as well + guess... */ + +/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least + documented in a comment in <machine/setjmp.h>! */ + +#define JB_ELEMENT_SIZE 4 + +#define JB_ONSSTACK 0 +#define JB_SIGMASK 1 +#define JB_SP 2 +#define JB_PC 3 +#define JB_PSL 4 +#define JB_D2 5 +#define JB_D3 6 +#define JB_D4 7 +#define JB_D5 8 +#define JB_D6 9 +#define JB_D7 10 +#define JB_A2 11 +#define JB_A3 12 +#define JB_A4 13 +#define JB_A5 14 +#define JB_A6 15 + +/* 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 ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) + +/* Where is the PC after a call? */ + +#ifdef __STDC__ +struct frame_info; +#endif + +extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); + +#undef SAVED_PC_AFTER_CALL +#define SAVED_PC_AFTER_CALL(frame) \ + m68k_saved_pc_after_call(frame) diff --git a/gdb/config/m68k/tm-68k-nofp.h b/gdb/config/m68k/tm-68k-nofp.h new file mode 100644 index 0000000..0ce320c --- /dev/null +++ b/gdb/config/m68k/tm-68k-nofp.h @@ -0,0 +1,64 @@ +/* Target machine parameters for embedded m68k, without float, for GDB. + Copyright 1986, 1987, 1989, 1992, 1993 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 "m68k/tm-68k.h" + +/* Longjmp info comes from the Sun-3 machine description. Might as well + guess... */ + +/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least + documented in a comment in <machine/setjmp.h>! */ + +#define JB_ELEMENT_SIZE 4 + +#define JB_ONSSTACK 0 +#define JB_SIGMASK 1 +#define JB_SP 2 +#define JB_PC 3 +#define JB_PSL 4 +#define JB_D2 5 +#define JB_D3 6 +#define JB_D4 7 +#define JB_D5 8 +#define JB_D6 9 +#define JB_D7 10 +#define JB_A2 11 +#define JB_A3 12 +#define JB_A4 13 +#define JB_A5 14 +#define JB_A6 15 + +/* 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 ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) + +/* Where is the PC after a call? */ + +#ifdef __STDC__ +struct frame_info; +#endif + +extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); + +#undef SAVED_PC_AFTER_CALL +#define SAVED_PC_AFTER_CALL(frame) \ + m68k_saved_pc_after_call(frame) diff --git a/gdb/config/m68k/tm-68k.h b/gdb/config/m68k/tm-68k.h new file mode 100644 index 0000000..96d71de --- /dev/null +++ b/gdb/config/m68k/tm-68k.h @@ -0,0 +1,525 @@ +/* Parameters for execution on a 68000 series machine. + Copyright 1986, 1987, 1989, 1990, 1992 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. */ + +/* Generic 68000 stuff, to be included by other tm-*.h files. + Define HAVE_68881 if that is the case. */ + +#if defined (HAVE_68881) +#define IEEE_FLOAT 1 +#endif + +/* Define the bit, byte, and word ordering of the machine. */ +#define TARGET_BYTE_ORDER BIG_ENDIAN + +/* Offset from address of function to start of its code. + Zero on most machines. */ + +#define FUNCTION_START_OFFSET 0 + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. */ + +#if !defined(SKIP_PROLOGUE) +#define SKIP_PROLOGUE(ip) {(ip) = m68k_skip_prologue(ip);} +extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip)); +#endif + +/* Immediately after a function call, return the saved pc. + Can't always go through the frames for this because on some machines + the new frame is not set up until the new function executes + some instructions. */ + +#define SAVED_PC_AFTER_CALL(frame) \ +read_memory_integer (read_register (SP_REGNUM), 4) + +/* Stack grows downward. */ + +#define INNER_THAN < + +/* Sequence of bytes for breakpoint instruction. + This is a TRAP instruction. The last 4 bits (0xf below) is the + vector. Systems which don't use 0xf should define BPT_VECTOR + themselves before including this file. */ + +#if !defined (BPT_VECTOR) +#define BPT_VECTOR 0xf +#endif + +#if !defined (BREAKPOINT) +#define BREAKPOINT {0x4e, (0x40 | BPT_VECTOR)} +#endif + +/* If your kernel resets the pc after the trap happens you may need to + define this before including this file. */ + +#if !defined (DECR_PC_AFTER_BREAK) +#define DECR_PC_AFTER_BREAK 2 +#endif + +/* Nonzero if instruction at PC is a return instruction. */ +/* Allow any of the return instructions, including a trapv and a return + from interupt. */ + +#define ABOUT_TO_RETURN(pc) ((read_memory_integer (pc, 2) & ~0x3) == 0x4e74) + +/* Return 1 if P points to an invalid floating point value. */ + +#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */ + +/* Say how long registers are. */ + +#define REGISTER_TYPE long + +#if defined (HAVE_68881) +# if defined (GDB_TARGET_IS_SUN3) + /* Sun3 status includes fpflags, which shows whether the FPU has been used + by the process, and whether the FPU was done with an instruction or + was interrupted in the middle of a long instruction. See + <machine/reg.h>. */ + /* a&d, pc,sr, fp, fpstat, fpflags */ +# define NUM_REGS 31 +# define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4) +# else /* Not sun3. */ +# define NUM_REGS 29 +# define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4) +# endif /* Not sun3. */ +#else /* No 68881. */ +# define NUM_REGS 18 +# define REGISTER_BYTES (16*4 + 8) +#endif /* No 68881. */ + +/* Index within `registers' of the first byte of the space for + register N. */ + +#if defined (HAVE_68881) +#define REGISTER_BYTE(N) \ + ((N) >= FPC_REGNUM ? (((N) - FPC_REGNUM) * 4) + 168 \ + : (N) >= FP0_REGNUM ? (((N) - FP0_REGNUM) * 12) + 72 \ + : (N) * 4) + +/* Number of bytes of storage in the actual machine representation + for register N. On the 68000, all regs are 4 bytes + except the floating point regs which are 12 bytes. */ +/* Note that the unsigned cast here forces the result of the + subtraction to very high positive values if N < FP0_REGNUM */ + +#define REGISTER_RAW_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 12 : 4) + +/* Number of bytes of storage in the program's representation + for register N. On the 68000, all regs are 4 bytes + except the floating point regs which are 8-byte doubles. */ + +#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 8 : 4) + +/* Largest value REGISTER_RAW_SIZE can have. */ + +#define MAX_REGISTER_RAW_SIZE 12 + +/* Largest value REGISTER_VIRTUAL_SIZE can have. */ + +#define MAX_REGISTER_VIRTUAL_SIZE 8 + +/* Nonzero if register N requires conversion + from raw format to virtual format. */ + +#define REGISTER_CONVERTIBLE(N) (((unsigned)(N) - FP0_REGNUM) < 8) + +/* Put the declaration out here because if it's in the macros, PCC + will complain. */ +extern const struct ext_format ext_format_68881; + +/* Convert data from raw format for register REGNUM + to virtual format for register REGNUM. */ + +#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \ +{ \ + if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \ + ieee_extended_to_double (&ext_format_68881, (FROM), (double *)(TO)); \ + else \ + memcpy ((TO), (FROM), 4); \ +} + +/* Convert data from virtual format for register REGNUM + to raw format for register REGNUM. */ + +#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \ +{ \ + if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \ + double_to_ieee_extended (&ext_format_68881, (double *)(FROM), (TO)); \ + else \ + memcpy ((TO), (FROM), 4); \ +} + +/* Return the GDB type object for the "standard" data type + of data in register N. */ +/* Note, for registers which contain addresses return + pointer to void, not pointer to char, because we don't + want to attempt to print the string after printing the address. */ +#define REGISTER_VIRTUAL_TYPE(N) \ + (((unsigned)(N) - FP0_REGNUM) < 8 ? builtin_type_double : \ + (N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \ + lookup_pointer_type (builtin_type_void) : builtin_type_int) + +#else /* no 68881. */ +/* Index within `registers' of the first byte of the space for + register N. */ + +#define REGISTER_BYTE(N) ((N) * 4) + +/* Number of bytes of storage in the actual machine representation + for register N. On the 68000, all regs are 4 bytes. */ + +#define REGISTER_RAW_SIZE(N) 4 + +/* Number of bytes of storage in the program's representation + for register N. On the 68000, all regs are 4 bytes. */ + +#define REGISTER_VIRTUAL_SIZE(N) 4 + +/* Largest value REGISTER_RAW_SIZE can have. */ + +#define MAX_REGISTER_RAW_SIZE 4 + +/* Largest value REGISTER_VIRTUAL_SIZE can have. */ + +#define MAX_REGISTER_VIRTUAL_SIZE 4 + +/* Nonzero if register N requires conversion + from raw format to virtual format. */ + +#define REGISTER_CONVERTIBLE(N) 0 + +/* Convert data from raw format for register REGNUM + to virtual format for register REGNUM. */ + +#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) memcpy ((TO), (FROM), 4); + +/* Convert data from virtual format for register REGNUM + to raw format for register REGNUM. */ + +#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) memcpy ((TO), (FROM), 4); + +/* Return the GDB type object for the "standard" data type + of data in register N. */ + +#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int + +#endif /* No 68881. */ + +/* Initializer for an array of names of registers. + Entries beyond the first NUM_REGS are ignored. */ + +#define REGISTER_NAMES \ + {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", \ + "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp", \ + "ps", "pc", \ + "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", \ + "fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags" } + +/* Register numbers of various important registers. + Note that some of these values are "real" register numbers, + and correspond to the general registers of the machine, + and some are "phony" register numbers which are too large + to be actual register numbers as far as the user is concerned + but do serve to get the desired values when passed to read_register. */ + +#define A1_REGNUM 9 +#define FP_REGNUM 14 /* Contains address of executing stack frame */ +#define SP_REGNUM 15 /* Contains address of top of stack */ +#define PS_REGNUM 16 /* Contains processor status */ +#define PC_REGNUM 17 /* Contains program counter */ +#if defined (HAVE_68881) +#define FP0_REGNUM 18 /* Floating point register 0 */ +#define FPC_REGNUM 26 /* 68881 control register */ +#define FPS_REGNUM 27 /* 68881 status register */ +#define FPI_REGNUM 28 /* 68881 iaddr register */ +#endif /* 68881. */ + +/* Store the address of the place in which to copy the structure the + subroutine will return. This is called from call_function. */ + +#define STORE_STRUCT_RETURN(ADDR, SP) \ + { write_register (A1_REGNUM, (ADDR)); } + +/* Extract from an array REGBUF containing the (raw) register state + a function return value of type TYPE, and copy that, in virtual format, + into VALBUF. This is assuming that floating point values are returned + as doubles in d0/d1. */ + +#if !defined (EXTRACT_RETURN_VALUE) +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + memcpy ((VALBUF), \ + (char *)(REGBUF) + \ + (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \ + TYPE_LENGTH(TYPE)) +#endif + +/* Write into appropriate registers a function return value + of type TYPE, given in virtual format. Assumes floats are passed + in d0/d1. */ + +#if !defined (STORE_RETURN_VALUE) +#define STORE_RETURN_VALUE(TYPE,VALBUF) \ + write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) +#endif + +/* Extract from an array REGBUF containing the (raw) register state + the address in which a function should return its structure value, + as a CORE_ADDR (or an expression that can be used as one). */ + +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF)) + +/* Describe the pointer in each stack frame to the previous stack frame + (its caller). */ + +/* FRAME_CHAIN takes a frame's nominal address and produces the frame's + chain-pointer. + In the case of the 68000, the frame's nominal address + is the address of a 4-byte word containing the calling frame's address. */ + +#define FRAME_CHAIN(thisframe) \ + (!inside_entry_file ((thisframe)->pc) ? \ + read_memory_integer ((thisframe)->frame, 4) :\ + 0) + +/* Define other aspects of the stack frame. */ + +/* A macro that tells us whether the function invocation represented + by FI does not have a frame on the stack associated with it. If it + does not, FRAMELESS is set to 1, else 0. */ +#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \ + (FRAMELESS) = frameless_look_for_prologue(FI) + +#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4)) + +#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) + +#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) + +/* Set VAL to the number of args passed to frame described by FI. + Can set VAL to -1, meaning no way to tell. */ + +/* We can't tell how many args there are + now that the C compiler delays popping them. */ +#if !defined (FRAME_NUM_ARGS) +#define FRAME_NUM_ARGS(val,fi) (val = -1) +#endif + +/* Return number of bytes at start of arglist that are not really args. */ + +#define FRAME_ARGS_SKIP 8 + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +#if !defined (FRAME_FIND_SAVED_REGS) +#if defined (HAVE_68881) +#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ +{ register int regnum; \ + register int regmask; \ + register CORE_ADDR next_addr; \ + register CORE_ADDR pc; \ + int nextinsn; \ + bzero (&frame_saved_regs, sizeof frame_saved_regs); \ + if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM*4 - 8*12 - 4 \ + && (frame_info)->pc <= (frame_info)->frame) \ + { next_addr = (frame_info)->frame; \ + pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 8*12 - 4; }\ + else \ + { pc = get_pc_function_start ((frame_info)->pc); \ + /* Verify we have a link a6 instruction next; \ + if not we lose. If we win, find the address above the saved \ + regs using the amount of storage from the link instruction. */\ + if (044016 == read_memory_integer (pc, 2)) \ + next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 4), pc+=4; \ + else if (047126 == read_memory_integer (pc, 2)) \ + next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 2), pc+=2; \ + else goto lose; \ + /* If have an addal #-n, sp next, adjust next_addr. */ \ + if ((0177777 & read_memory_integer (pc, 2)) == 0157774) \ + next_addr += read_memory_integer (pc += 2, 4), pc += 4; \ + } \ + /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */ \ + regmask = read_memory_integer (pc + 2, 2); \ + /* But before that can come an fmovem. Check for it. */ \ + nextinsn = 0xffff & read_memory_integer (pc, 2); \ + if (0xf227 == nextinsn \ + && (regmask & 0xff00) == 0xe000) \ + { pc += 4; /* Regmask's low bit is for register fp7, the first pushed */ \ + for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr -= 12); \ + regmask = read_memory_integer (pc + 2, 2); } \ + if (0044327 == read_memory_integer (pc, 2)) \ + { pc += 4; /* Regmask's low bit is for register 0, the first written */ \ + for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr += 4) - 4; } \ + else if (0044347 == read_memory_integer (pc, 2)) \ + { pc += 4; /* Regmask's low bit is for register 15, the first pushed */ \ + for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ + else if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2))) \ + { regnum = 0xf & read_memory_integer (pc, 2); pc += 2; \ + (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ + /* fmovemx to index of sp may follow. */ \ + regmask = read_memory_integer (pc + 2, 2); \ + nextinsn = 0xffff & read_memory_integer (pc, 2); \ + if (0xf236 == nextinsn \ + && (regmask & 0xff00) == 0xf000) \ + { pc += 10; /* Regmask's low bit is for register fp0, the first written */ \ + for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr += 12) - 12; \ + regmask = read_memory_integer (pc + 2, 2); } \ + /* clrw -(sp); movw ccr,-(sp) may follow. */ \ + if (0x426742e7 == read_memory_integer (pc, 4)) \ + (frame_saved_regs).regs[PS_REGNUM] = (next_addr -= 4); \ + lose: ; \ + (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 8; \ + (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \ + (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \ +} +#else /* no 68881. */ +#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ +{ register int regnum; \ + register int regmask; \ + register CORE_ADDR next_addr; \ + register CORE_ADDR pc; \ + bzero (&frame_saved_regs, sizeof frame_saved_regs); \ + if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM*4 - 4 \ + && (frame_info)->pc <= (frame_info)->frame) \ + { next_addr = (frame_info)->frame; \ + pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4; }\ + else \ + { pc = get_pc_function_start ((frame_info)->pc); \ + /* Verify we have a link a6 instruction next; \ + if not we lose. If we win, find the address above the saved \ + regs using the amount of storage from the link instruction. */\ + if (044016 == read_memory_integer (pc, 2)) \ + next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 4), pc+=4; \ + else if (047126 == read_memory_integer (pc, 2)) \ + next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 2), pc+=2; \ + else goto lose; \ + /* If have an addal #-n, sp next, adjust next_addr. */ \ + if ((0177777 & read_memory_integer (pc, 2)) == 0157774) \ + next_addr += read_memory_integer (pc += 2, 4), pc += 4; \ + } \ + /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */ \ + regmask = read_memory_integer (pc + 2, 2); \ + if (0044327 == read_memory_integer (pc, 2)) \ + { pc += 4; /* Regmask's low bit is for register 0, the first written */ \ + for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr += 4) - 4; } \ + else if (0044347 == read_memory_integer (pc, 2)) \ + { pc += 4; /* Regmask's low bit is for register 15, the first pushed */ \ + for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ + else if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2))) \ + { regnum = 0xf & read_memory_integer (pc, 2); pc += 2; \ + (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ + /* clrw -(sp); movw ccr,-(sp) may follow. */ \ + if (0x426742e7 == read_memory_integer (pc, 4)) \ + (frame_saved_regs).regs[PS_REGNUM] = (next_addr -= 4); \ + lose: ; \ + (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 8; \ + (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \ + (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \ +} +#endif /* no 68881. */ +#endif /* no FIND_FRAME_SAVED_REGS. */ + + +/* Things needed for making the inferior call functions. + It seems like every m68k based machine has almost identical definitions + in the individual machine's configuration files. Most other cpu types + (mips, i386, etc) have routines in their *-tdep.c files to handle this + for most configurations. The m68k family should be able to do this as + well. These macros can still be overridden when necessary. */ + +/* The CALL_DUMMY macro is the sequence of instructions, as disassembled + by gdb itself: + + fmovemx fp0-fp7,sp@- 0xf227 0xe0ff + moveml d0-a5,sp@- 0x48e7 0xfffc + clrw sp@- 0x4267 + movew ccr,sp@- 0x42e7 + + /..* The arguments are pushed at this point by GDB; + no code is needed in the dummy for this. + The CALL_DUMMY_START_OFFSET gives the position of + the following jsr instruction. *../ + + jsr @#0x32323232 0x4eb9 0x3232 0x3232 + addal #0x69696969,sp 0xdffc 0x6969 0x6969 + trap #<your BPT_VECTOR number here> 0x4e4? + nop 0x4e71 + + Note this is CALL_DUMMY_LENGTH bytes (28 for the above example). + We actually start executing at the jsr, since the pushing of the + registers is done by PUSH_DUMMY_FRAME. If this were real code, + the arguments for the function called by the jsr would be pushed + between the moveml and the jsr, and we could allow it to execute through. + But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is + done, and we cannot allow the moveml to push the registers again lest + they be taken for the arguments. */ + +#if defined (HAVE_68881) + +#define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, (0x4e404e71 | (BPT_VECTOR << 16))} +#define CALL_DUMMY_LENGTH 28 /* Size of CALL_DUMMY */ +#define CALL_DUMMY_START_OFFSET 12 /* Offset to jsr instruction*/ + +#else + +#define CALL_DUMMY {0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, (0x4e404e71 | (BPT_VECTOR << 16))} +#define CALL_DUMMY_LENGTH 24 /* Size of CALL_DUMMY */ +#define CALL_DUMMY_START_OFFSET 8 /* Offset to jsr instruction*/ + +#endif /* HAVE_68881 */ + +/* Insert the specified number of args and function address + into a call sequence of the above form stored at DUMMYNAME. + We use the BFD routines to store a big-endian value of known size. */ + +#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ +{ _do_putb32 (fun, (char *) dummyname + CALL_DUMMY_START_OFFSET + 2); \ + _do_putb32 (nargs*4, (char *) dummyname + CALL_DUMMY_START_OFFSET + 8); } + +/* Push an empty stack frame, to record the current PC, etc. */ + +#define PUSH_DUMMY_FRAME { m68k_push_dummy_frame (); } + +extern void m68k_push_dummy_frame PARAMS ((void)); + +extern void m68k_pop_frame PARAMS ((void)); + +/* Discard from the stack the innermost frame, restoring all registers. */ + +#define POP_FRAME { m68k_pop_frame (); } + +/* Offset from SP to first arg on stack at first instruction of a function */ + +#define SP_ARG0 (1 * 4) diff --git a/gdb/config/m68k/tm-altos.h b/gdb/config/m68k/tm-altos.h new file mode 100644 index 0000000..b1b0733 --- /dev/null +++ b/gdb/config/m68k/tm-altos.h @@ -0,0 +1,54 @@ +/* Target definitions for GDB on an Altos 3068 (m68k running SVR2) + Copyright 1987, 1989, 1991, 1993 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 + +/* Address of end of stack space. */ + +/*#define STACK_END_ADDR (0xffffff)*/ +#define STACK_END_ADDR (0x1000000) + +/* Amount PC must be decremented by after a breakpoint. + On the Altos, the kernel resets the pc to the trap instr */ + +#define DECR_PC_AFTER_BREAK 0 + +/* The only reason this is here is the tm-altos.h reference below. It + was moved back here from tm-68k.h. FIXME? */ + +#define SKIP_PROLOGUE(pc) \ +{ register int op = read_memory_integer (pc, 2); \ + if (op == 0047126) \ + pc += 4; /* Skip link #word */ \ + else if (op == 0044016) \ + pc += 6; /* Skip link #long */ \ + /* Not sure why branches are here. */ \ + /* From tm-isi.h, tm-altos.h */ \ + else if (op == 0060000) \ + pc += 4; /* Skip bra #word */ \ + else if (op == 00600377) \ + pc += 6; /* skip bra #long */ \ + else if ((op & 0177400) == 0060000) \ + pc += 2; /* skip bra #char */ \ +} + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-amix.h b/gdb/config/m68k/tm-amix.h new file mode 100644 index 0000000..b758da7 --- /dev/null +++ b/gdb/config/m68k/tm-amix.h @@ -0,0 +1,77 @@ +/* Macro definitions for GDB on a Commodore Amiga running SVR4 (amix). + Copyright (C) 1991, Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support (fnf@cygint) + +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. */ + +/* All Amiga's (so far) running UNIX have come standard with the floating + point coprocessor. */ + +#define HAVE_68881 + +/* 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 0x1 + +/* How much to decrement the PC after a trap. Depends on kernel. */ + +#define DECR_PC_AFTER_BREAK 0 /* No decrement required */ + +/* Address of end of stack space. Actually one byte past it. + This value is typically very OS dependent. + FIXME: Check to see if SVR4 offers some machine independent way + of discovering this value and use it if so, and if we need it. */ + +/* #define STACK_END_ADDR 0xc0800000 */ + +/* Use the alternate method of determining valid frame chains. */ + +#define FRAME_CHAIN_VALID_ALTERNATE + +#include "tm-sysv4.h" +#include "m68k/tm-68k.h" + +/* Offsets (in target ints) into jmp_buf. Not defined in any system header + file, so we have to step through setjmp/longjmp with a debugger and figure + them out. As a double check, note that <setjmp> defines _JBLEN as 13, + which matches the number of elements we see saved by setjmp(). */ + +#define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */ + +#define JB_D2 0 +#define JB_D3 1 +#define JB_D4 2 +#define JB_D5 3 +#define JB_D6 4 +#define JB_D7 5 +#define JB_A1 6 +#define JB_A2 7 +#define JB_A3 8 +#define JB_A4 9 +#define JB_A5 10 +#define JB_A6 11 +#define JB_A7 12 + +#define JB_PC JB_A1 /* Setjmp()'s return PC saved in A1 */ + +/* 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 ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/m68k/tm-es1800.h b/gdb/config/m68k/tm-es1800.h new file mode 100644 index 0000000..f62f043 --- /dev/null +++ b/gdb/config/m68k/tm-es1800.h @@ -0,0 +1,60 @@ +/* Parameters for execution on ES-1800 emulator for 68000. + The code was originally written by Johan Holmberg TT/SJ Ericsson Telecom + AB and later modified by Johan Henriksson TT/SJ. It was adapted to GDB 4.0 + by Jan Norden TX/DK. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +GDB 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 1, or (at your option) +any later version. + +GDB 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 GDB; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define GDBINIT_FILENAME ".esgdbinit" + +#define DEFAULT_PROMPT "(esgdb) " + +#define HAVE_68881 + +#include "m68k/tm-68k.h" + +/* Longjmp stuff borrowed from sun3 configuration. Don't know if correct. + FIXME. */ +/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least + documented in a comment in <machine/setjmp.h>! */ + +#define JB_ELEMENT_SIZE 4 + +#define JB_ONSSTACK 0 +#define JB_SIGMASK 1 +#define JB_SP 2 +#define JB_PC 3 +#define JB_PSL 4 +#define JB_D2 5 +#define JB_D3 6 +#define JB_D4 7 +#define JB_D5 8 +#define JB_D6 9 +#define JB_D7 10 +#define JB_A2 11 +#define JB_A3 12 +#define JB_A4 13 +#define JB_A5 14 +#define JB_A6 15 + +/* 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 ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/m68k/tm-hp300bsd.h b/gdb/config/m68k/tm-hp300bsd.h new file mode 100644 index 0000000..4dc95e1 --- /dev/null +++ b/gdb/config/m68k/tm-hp300bsd.h @@ -0,0 +1,50 @@ +/* Parameters for target machine Hewlett-Packard 9000/300, running bsd. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 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. */ + +/* + * Configuration file for HP9000/300 series machine running + * University of Utah's 4.3bsd port. This is NOT for HP-UX. + * Problems to hpbsd-bugs@cs.utah.edu + */ + +#define HAVE_68881 + +/* 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 0x2 + +#define TARGET_NBPG 4096 +#define TARGET_UPAGES 3 + +/* On the HP300, sigtramp is in the u area. Gak! User struct is not + mapped to the same virtual address in user/kernel address space + (hence STACK_END_ADDR as opposed to KERNEL_U_ADDR). This tests + for the whole u area, since we don't necessarily have hp300bsd + include files around. */ +#define IN_SIGTRAMP(pc, name) \ + ((pc) >= STACK_END_ADDR \ + && (pc) < STACK_END_ADDR + TARGET_UPAGES * TARGET_NBPG \ + ) + +/* Address of end of stack space. */ + +#define STACK_END_ADDR 0xfff00000 + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-hp300hpux.h b/gdb/config/m68k/tm-hp300hpux.h new file mode 100644 index 0000000..df2df4a --- /dev/null +++ b/gdb/config/m68k/tm-hp300hpux.h @@ -0,0 +1,31 @@ +/* Parameters for execution on an HP 9000 model 320, for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 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 HAVE_68881 + +/* 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 0x1 + +/* Address of end of stack space. */ + +#define STACK_END_ADDR 0xFFF00000 + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-isi.h b/gdb/config/m68k/tm-isi.h new file mode 100644 index 0000000..da28c2f --- /dev/null +++ b/gdb/config/m68k/tm-isi.h @@ -0,0 +1,156 @@ +/* Definitions to target GDB on an ISI Optimum V (3.05) under 4.3bsd. + Copyright (C) 1987, 1989, 1991, 1993 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. */ + +/* This has not been tested on ISI's running BSD 4.2, but it will probably + work. */ + +#define HAVE_68881 + +/* Address of end of stack space. */ + +#define STACK_END_ADDR 0xfffe000 + +/* Data segment starts at etext rounded up to DATAROUND in {N,Z}MAGIC files */ + +#define DATAROUND 0x20000 +#define N_DATADDR(hdr) (hdr.a_magic != OMAGIC ? \ + (hdr.a_text + DATAROUND) & ~(DATAROUND-1) : hdr.a_text) + +/* Text segment starts at sizeof (struct exec) in {N,Z}MAGIC files */ + +#define N_TXTADDR(hdr) (hdr.a_magic != OMAGIC ? sizeof (struct exec) : 0) + +/* Amount PC must be decremented by after a breakpoint. + This is often the number of bytes in BREAKPOINT + but not always. + On the ISI, the kernel resets the pc to the trap instr */ + +#define DECR_PC_AFTER_BREAK 0 + + +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +#define FRAME_NUM_ARGS(val, fi) \ +{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \ + register int insn = 0177777 & read_memory_integer (pc, 2); \ + val = 0; \ + if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \ + val = read_memory_integer (pc + 2, 2); \ + else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \ + || (insn & 0170777) == 0050117) /* addqw */ \ + { val = (insn >> 9) & 7; if (val == 0) val = 8; } \ + else if (insn == 0157774) /* addal #WW, sp */ \ + val = read_memory_integer (pc + 2, 4); \ + val >>= 2; } + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ +{ register int regnum; \ + register int regmask; \ + register CORE_ADDR next_addr; \ + register CORE_ADDR pc; \ + register int insn; \ + register int offset; \ + bzero (&frame_saved_regs, sizeof frame_saved_regs); \ + if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM*4 - 8*12 - 4 \ + && (frame_info)->pc <= (frame_info)->frame) \ + { next_addr = (frame_info)->frame; \ + pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 8*12 - 4; }\ + else \ + { pc = get_pc_function_start ((frame_info)->pc); \ + /* Verify we have a link a6 instruction next, \ + or a branch followed by a link a6 instruction; \ + if not we lose. If we win, find the address above the saved \ + regs using the amount of storage from the link instruction. */\ +retry: \ + insn = read_memory_integer (pc, 2); \ + if (insn == 044016) \ + next_addr = (frame_info)->frame - read_memory_integer (pc += 2, 4), pc+=4; \ + else if (insn == 047126) \ + next_addr = (frame_info)->frame - read_memory_integer (pc += 2, 2), pc+=2; \ + else if ((insn & 0177400) == 060000) /* bra insn */ \ + { offset = insn & 0377; \ + pc += 2; /* advance past bra */ \ + if (offset == 0) /* bra #word */ \ + offset = read_memory_integer (pc, 2), pc += 2; \ + else if (offset == 0377) /* bra #long */ \ + offset = read_memory_integer (pc, 4), pc += 4; \ + pc += offset; \ + goto retry; \ + } else goto lose; \ + /* If have an addal #-n, sp next, adjust next_addr. */ \ + if ((0177777 & read_memory_integer (pc, 2)) == 0157774) \ + next_addr += read_memory_integer (pc += 2, 4), pc += 4; \ + } \ + /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */ \ + insn = read_memory_integer (pc, 2), pc += 2; \ + regmask = read_memory_integer (pc, 2); \ + if ((insn & 0177760) == 022700) /* movl rn, (sp) */ \ + (frame_saved_regs).regs[(insn&7) + ((insn&010)?8:0)] = next_addr; \ + else if ((insn & 0177760) == 024700) /* movl rn, -(sp) */ \ + (frame_saved_regs).regs[(insn&7) + ((insn&010)?8:0)] = next_addr-=4; \ + else if (insn == 0044327) /* moveml mask, (sp) */ \ + { pc += 2; \ + /* Regmask's low bit is for register 0, the first written */ \ + next_addr -= 4; \ + for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr += 4); \ + } else if (insn == 0044347) /* moveml mask, -(sp) */ \ + { pc += 2; \ + /* Regmask's low bit is for register 15, the first pushed */ \ + for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \ + if (regmask & 1) \ + (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ + /* clrw -(sp); movw ccr,-(sp) may follow. */ \ + if (read_memory_integer (pc, 2) == 041147 \ + && read_memory_integer (pc+2, 2) == 042347) \ + (frame_saved_regs).regs[PS_REGNUM] = (next_addr -= 4); \ + lose: ; \ + (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 8; \ + (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \ + (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \ +} + +/* The only reason this is here is the tm-isi.h reference below. It + was moved back here from tm-68k.h. FIXME? */ + +#define SKIP_PROLOGUE(pc) \ +{ register int op = read_memory_integer (pc, 2); \ + if (op == 0047126) \ + pc += 4; /* Skip link #word */ \ + else if (op == 0044016) \ + pc += 6; /* Skip link #long */ \ + /* Not sure why branches are here. */ \ + /* From tm-isi.h, tm-altos.h */ \ + else if (op == 0060000) \ + pc += 4; /* Skip bra #word */ \ + else if (op == 00600377) \ + pc += 6; /* skip bra #long */ \ + else if ((op & 0177400) == 0060000) \ + pc += 2; /* skip bra #char */ \ +} + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-news.h b/gdb/config/m68k/tm-news.h new file mode 100644 index 0000000..7f784f8 --- /dev/null +++ b/gdb/config/m68k/tm-news.h @@ -0,0 +1,85 @@ +/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger. + Copyright 1987, 1989, 1991, 1993 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. */ + +/* See following cpu type determination macro to get the machine type. + +Here is an m-news.h file for gdb. It supports the 68881 registers. + by hikichi@srava.sra.junet + +* Support Sun assembly format instead of Motorola one. +* Ptrace for handling floating register has a bug(before NEWS OS version 2.2), +* After NEWS OS version 3.2, some of ptrace's bug is fixed. + But we cannot change the floating register(see adb(1) in OS 3.2) yet. */ + +#define HAVE_68881 + +/* Use to compute STACK_END_ADDR. */ +#define TARGET_UPAGES 2 +#define TARGET_NBPG 4096 + +/* Address of end of stack space. */ + +#define STACK_END_ADDR (0x80000000 - TARGET_UPAGES * TARGET_NBPG) + +/* Extract from an array REGBUF containing the (raw) register state + a function return value of type TYPE, and copy that, in virtual format, + into VALBUF. */ + +/* when it return the floating value, use the FP0 in NEWS. */ +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ + { \ + REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \ + ®BUF[REGISTER_BYTE (FP0_REGNUM)], VALBUF); \ + } \ + else \ + bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE)); } + +/* Write into appropriate registers a function return value + of type TYPE, given in virtual format. */ + +/* when it return the floating value, use the FP0 in NEWS. */ +#define STORE_RETURN_VALUE(TYPE,VALBUF) \ + { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ + { \ + char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \ + REGISTER_CONVERT_TO_RAW (FP0_REGNUM, VALBUF, raw_buf); \ + write_register_bytes (FP0_REGNUM, \ + raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \ + } \ + else \ + write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); } + +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +#define FRAME_NUM_ARGS(val, fi) \ +{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \ + register int insn = 0177777 & read_memory_integer (pc, 2); \ + val = 0; \ + if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \ + val = read_memory_integer (pc + 2, 2); \ + else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \ + || (insn & 0170777) == 0050117) /* addqw */ \ + { val = (insn >> 9) & 7; if (val == 0) val = 8; } \ + else if (insn == 0157774) /* addal #WW, sp */ \ + val = read_memory_integer (pc + 2, 4); \ + val >>= 2; } + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-os68k.h b/gdb/config/m68k/tm-os68k.h new file mode 100644 index 0000000..bf50c5c --- /dev/null +++ b/gdb/config/m68k/tm-os68k.h @@ -0,0 +1,47 @@ +/* Parameters for execution on VxWorks 68k's, for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + Contributed by Cygnus Support. + +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 GDBINIT_FILENAME ".os68gdbinit" + +#define DEFAULT_PROMPT "(os68k) " + +#include "m68k/tm-68k.h" + +/* We have more complex, useful breakpoints on the target. */ +#undef DECR_PC_AFTER_BREAK +#define DECR_PC_AFTER_BREAK 0 + +/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ +#undef FRAME_CHAIN +#undef FRAME_CHAIN_VALID + +/* Takes the current frame-struct pointer and returns the chain-pointer + to get to the calling frame. + + If our current frame pointer is zero, we're at the top; else read out + the saved FP from memory pointed to by the current FP. */ + +#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) + +/* If the chain pointer is zero (either because the saved value fetched + by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN + never fetched anything), we are at the top of the stack. */ + +#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0) diff --git a/gdb/config/m68k/tm-st2000.h b/gdb/config/m68k/tm-st2000.h new file mode 100644 index 0000000..64467be --- /dev/null +++ b/gdb/config/m68k/tm-st2000.h @@ -0,0 +1,22 @@ +/* Parameters for a Tandem ST2000 phone switch. + Copyright (C) 1986, 1987, 1989, 199 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 HAVE_68881 /* GDB won't compile without this */ + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-sun2.h b/gdb/config/m68k/tm-sun2.h new file mode 100644 index 0000000..1d2f85d --- /dev/null +++ b/gdb/config/m68k/tm-sun2.h @@ -0,0 +1,27 @@ +/* Parameters for execution on a Sun, for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1992 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. */ + +/* Address of the end of stack space. We get this from the system + include files. */ + +#include <sys/types.h> +#include <machine/vmparam.h> +#define STACK_END_ADDR USRSTACK + +#include "m68k/tm-68k.h" diff --git a/gdb/config/m68k/tm-sun2os4.h b/gdb/config/m68k/tm-sun2os4.h new file mode 100644 index 0000000..c492c9c --- /dev/null +++ b/gdb/config/m68k/tm-sun2os4.h @@ -0,0 +1,20 @@ +/* Copyright (C) 1990, 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 "m68k/tm-sun2.h" +#include "tm-sunos.h" diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h new file mode 100644 index 0000000..1a698f3 --- /dev/null +++ b/gdb/config/m68k/tm-sun3.h @@ -0,0 +1,67 @@ +/* Parameters for execution on a Sun, for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1992 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 HAVE_68881 + +/* Let native-versus-cross support code know we are targeting sun3, + and modify registers to include sun3 fpustate register. */ + +#define GDB_TARGET_IS_SUN3 1 + +#include "m68k/tm-68k.h" + +/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least + documented in a comment in <machine/setjmp.h>! */ + +#define JB_ELEMENT_SIZE 4 + +#define JB_ONSSTACK 0 +#define JB_SIGMASK 1 +#define JB_SP 2 +#define JB_PC 3 +#define JB_PSL 4 +#define JB_D2 5 +#define JB_D3 6 +#define JB_D4 7 +#define JB_D5 8 +#define JB_D6 9 +#define JB_D7 10 +#define JB_A2 11 +#define JB_A3 12 +#define JB_A4 13 +#define JB_A5 14 +#define JB_A6 15 + +/* 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 ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) + +#undef SAVED_PC_AFTER_CALL + +#ifdef __STDC__ +struct frame_info; +#endif + +extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); + +#define SAVED_PC_AFTER_CALL(frame) \ + m68k_saved_pc_after_call(frame) diff --git a/gdb/config/m68k/tm-sun3os4.h b/gdb/config/m68k/tm-sun3os4.h new file mode 100644 index 0000000..cd7be01 --- /dev/null +++ b/gdb/config/m68k/tm-sun3os4.h @@ -0,0 +1,21 @@ +/* Target machine parameters for Sun-3 under SunOS 4.x, for GDB. + Copyright (C) 1986, 1987, 1989, 1992 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 "m68k/tm-sun3.h" +#include "tm-sunos.h" diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h new file mode 100644 index 0000000..8ce67a1 --- /dev/null +++ b/gdb/config/m68k/tm-vx68.h @@ -0,0 +1,78 @@ +/* Target machine description for VxWorks 68k's, for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc. + Contributed by Cygnus Support. + +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 GDBINIT_FILENAME ".vxgdbinit" + +#define DEFAULT_PROMPT "(vxgdb) " + +#define HAVE_68881 + +/* We have more complex, useful breakpoints on the target. */ +#define DECR_PC_AFTER_BREAK 0 + +#include "m68k/tm-68k.h" + +/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ +#undef FRAME_CHAIN +#undef FRAME_CHAIN_VALID + +/* Takes the current frame-struct pointer and returns the chain-pointer + to get to the calling frame. + + If our current frame pointer is zero, we're at the top; else read out + the saved FP from memory pointed to by the current FP. */ + +#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0) + +/* If the chain pointer is zero (either because the saved value fetched + by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN + never fetched anything), we are at the top of the stack. */ + +#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0) + +/* FIXME, Longjmp information stolen from Sun-3 config. Dunno if right. */ +/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least + documented in a comment in <machine/setjmp.h>! */ + +#define JB_ELEMENT_SIZE 4 + +#define JB_ONSSTACK 0 +#define JB_SIGMASK 1 +#define JB_SP 2 +#define JB_PC 3 +#define JB_PSL 4 +#define JB_D2 5 +#define JB_D3 6 +#define JB_D4 7 +#define JB_D5 8 +#define JB_D6 9 +#define JB_D7 10 +#define JB_A2 11 +#define JB_A3 12 +#define JB_A4 13 +#define JB_A5 14 +#define JB_A6 15 + +/* 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 ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/m68k/vxworks68.mt b/gdb/config/m68k/vxworks68.mt new file mode 100644 index 0000000..b37edbd --- /dev/null +++ b/gdb/config/m68k/vxworks68.mt @@ -0,0 +1,3 @@ +# Target: VxWorks running on a 68000 +TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o remote-vx.o xdr_ld.o xdr_ptrace.o xdr_rdb.o +TM_FILE= tm-vx68.h diff --git a/gdb/config/m68k/xm-3b1.h b/gdb/config/m68k/xm-3b1.h new file mode 100644 index 0000000..cfd71e0 --- /dev/null +++ b/gdb/config/m68k/xm-3b1.h @@ -0,0 +1,85 @@ +/* Parameters for execution on a 3b1. + 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 + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#define KERNEL_U_ADDR 0x70000 + +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ addr = blockend + regno * 4; } + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel $ end, sp"); \ + asm ("clrl fp"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("movel fp, -(sp)"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("movl (sp), fp"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea 10(sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subil $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } + +#endif diff --git a/gdb/config/m68k/xm-altos.h b/gdb/config/m68k/xm-altos.h new file mode 100644 index 0000000..ea84016 --- /dev/null +++ b/gdb/config/m68k/xm-altos.h @@ -0,0 +1,202 @@ +/* Definitions to make GDB run on an Altos 3068 (m68k running SVR2) + Copyright (C) 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 + +/* The altos support would make a good base for a port to other USGR2 systems + (like the 3b1 and the Convergent miniframe). */ + +/* This is only needed in one file, but it's cleaner to put it here than + putting in more #ifdef's. */ +#include <sys/page.h> +#include <sys/net.h> + +#define USG + +#define HAVE_TERMIO + +#define CBREAK XTABS /* It takes all kinds... */ + +#ifndef R_OK +#define R_OK 4 +#define W_OK 2 +#define X_OK 1 +#define F_OK 0 +#endif + +/* Get sys/wait.h ie. from a Sun and edit it a little (mc68000 to m68k) */ +/* Why bother? */ +#if 0 +#define HAVE_WAIT_STRUCT +#endif + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#define KERNEL_U_ADDR 0x1fbf000 + +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ if (regno <= SP_REGNUM) \ + addr = blockend + regno * 4; \ + else if (regno == PS_REGNUM) \ + addr = blockend + regno * 4 + 4; \ + else if (regno == PC_REGNUM) \ + addr = blockend + regno * 4 + 2; \ +} + +#define REGISTER_ADDR(u_ar0, regno) \ + (((regno) < PS_REGNUM) \ + ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \ + : (((regno) == PS_REGNUM) \ + ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \ + : (&((struct exception_stack *) (u_ar0))->e_PC))) + +#define FP_REGISTER_ADDR(u, regno) \ + (((char *) \ + (((regno) < FPC_REGNUM) \ + ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \ + : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \ + - ((char *) (& u))) + + +#ifndef __GNUC__ +#undef USE_GAS +#define ALTOS_AS +#else +#define USE_GAS +#endif + +/* Motorola assembly format */ +#if !defined(USE_GAS) && !defined(ALTOS) +#define MOTOROLA +#endif + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#ifdef MOTOROLA +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("move.l $ end, sp"); \ + asm ("clr.l fp"); } +#else +#ifdef ALTOS_AS +#define INIT_STACK(beg, end) \ +{ asm ("global end"); \ + asm ("mov.l &end,%sp"); \ + asm ("clr.l %fp"); } +#else +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel $ end, sp"); \ + asm ("clrl fp"); } +#endif +#endif + +/* Push the frame pointer register on the stack. */ +#ifdef MOTOROLA +#define PUSH_FRAME_PTR \ + asm ("move.l fp, -(sp)"); +#else +#ifdef ALTOS_AS +#define PUSH_FRAME_PTR \ + asm ("mov.l %fp, -(%sp)"); +#else +#define PUSH_FRAME_PTR \ + asm ("movel fp, -(sp)"); +#endif +#endif + +/* Copy the top-of-stack to the frame pointer register. */ +#ifdef MOTOROLA +#define POP_FRAME_PTR \ + asm ("move.l (sp), fp"); +#else +#ifdef ALTOS_AS +#define POP_FRAME_PTR \ + asm ("mov.l (%sp), %fp"); +#else +#define POP_FRAME_PTR \ + asm ("movl (sp), fp"); +#endif +#endif + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#ifdef MOTOROLA +#define PUSH_REGISTERS \ +{ asm ("clr.w -(sp)"); \ + asm ("pea (10,sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } +#else +#ifdef ALTOS_AS +#define PUSH_REGISTERS \ +{ asm ("clr.w -(%sp)"); \ + asm ("pea (10,%sp)"); \ + asm ("movm.l &0xfffe,-(%sp)"); } +#else +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea 10(sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } +#endif +#endif + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#ifdef MOTOROLA +#define POP_REGISTERS \ +{ asm ("subi.l $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } +#else +#ifdef ALTOS_AS +#define POP_REGISTERS \ +{ asm ("sub.l &8,28(%sp)"); \ + asm ("movem (%sp),&0xffff"); \ + asm ("rte"); } +#else +#define POP_REGISTERS \ +{ asm ("subil $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } +#endif +#endif diff --git a/gdb/config/m68k/xm-amix.h b/gdb/config/m68k/xm-amix.h new file mode 100644 index 0000000..ffd0192 --- /dev/null +++ b/gdb/config/m68k/xm-amix.h @@ -0,0 +1,45 @@ +/* Macro definitions for GDB on a Commodore Amiga running SVR4 (amix) + Copyright 1991, 1992 Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support (fnf@cygnus.com) + +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. */ + +/* Pick up most of what we need from the generic m68k host include file. */ + +#include "m68k/xm-m68k.h" + +/* Pick up more stuff from the generic SVR4 host include file. */ + +#include "xm-sysv4.h" + +/* The native AT&T compiler for m68k/SVR4 complains about using volatile + to indicate functions that never return. So shut it up by simply + defining away "NORETURN", which is normally defined to "volatile". */ + +#ifndef __GNUC__ +# define NORETURN /**/ +#endif + +/* If you expect to use the mmalloc package to obtain mapped symbol files, + for now you have to specify some parameters that determine how gdb places + the mappings in it's address space. See the comments in map_to_address() + for details. This is expected to only be a short term solution. Yes it + is a kludge. + FIXME: Make this more automatic. */ + +#define MMAP_BASE_ADDRESS 0xC2000000 /* First mapping here */ +#define MMAP_INCREMENT 0x01000000 /* Increment to next mapping */ diff --git a/gdb/config/m68k/xm-apollo68b.h b/gdb/config/m68k/xm-apollo68b.h new file mode 100644 index 0000000..9d1d39c --- /dev/null +++ b/gdb/config/m68k/xm-apollo68b.h @@ -0,0 +1,24 @@ +/* Macro defintions for an Apollo 68k in BSD mode + Copyright (C) 1992 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 ALIGN_STACK_ON_STARTUP + +extern char *strdup(); diff --git a/gdb/config/m68k/xm-apollo68v.h b/gdb/config/m68k/xm-apollo68v.h new file mode 100644 index 0000000..6129523 --- /dev/null +++ b/gdb/config/m68k/xm-apollo68v.h @@ -0,0 +1,44 @@ +/* Macro defintions for an Apollo. + Copyright (C) 1986, 1987, 1989, 1992 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. */ + +/* + * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu) + * July 1988 + */ + +#define HOST_BYTE_ORDER BIG_ENDIAN + +/* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's +Sys V/386 3.2. + +On some machines, gdb crashes when it's starting up while calling the +vendor's termio tgetent() routine. It always works when run under +itself (actually, under 3.2, it's not an infinitely recursive bug.) +After some poking around, it appears that depending on the environment +size, or whether you're running YP, or the phase of the moon or something, +the stack is not always long-aligned when main() is called, and tgetent() +takes strong offense at that. On some machines this bug never appears, but +on those where it does, it occurs quite reliably. */ +#define ALIGN_STACK_ON_STARTUP + +/* define USG if you are using sys5 /usr/include's */ +#define USG + +#define HAVE_TERMIO + diff --git a/gdb/config/m68k/xm-hp300bsd.h b/gdb/config/m68k/xm-hp300bsd.h new file mode 100644 index 0000000..54800fd --- /dev/null +++ b/gdb/config/m68k/xm-hp300bsd.h @@ -0,0 +1,103 @@ +/* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 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. */ + +/* + * Configuration file for HP9000/300 series machine running + * University of Utah's 4.3bsd (or 4.4BSD) port. This is NOT for HP-UX. + * Problems to hpbsd-bugs@cs.utah.edu + */ + +#define HOST_BYTE_ORDER BIG_ENDIAN + +/* Avoid "INT_MIN redefined" preprocessor warnings -- by defining them here, + exactly the same as in the system <limits.h> file. */ +#define UINT_MAX 4294967295 /* max value for an unsigned int */ +#define INT_MAX 2147483647 /* max value for an int */ +#define INT_MIN (-2147483647-1) /* min value for an int */ +#define LONG_MAX 2147483647 /* max value for a long */ + +/* Get rid of any system-imposed stack limit if possible. */ + +#define SET_STACK_LIMIT_HUGE + +/* Get kernel u area address at run-time using BSD style nlist (). */ +#define KERNEL_U_ADDR_BSD + +/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ +#define ONE_PROCESS_WRITETEXT + +/* psignal's definition in 4.4BSD conflicts with the one in defs.h. + But there *is* no psignal definition in 4.3BSD. So we avoid the defs.h + version here, and supply our own (matching) one. */ +#define PSIGNAL_IN_SIGNAL_H +void psignal PARAMS ((unsigned int, const char *)); + +extern char *strdup PARAMS ((const char *)); + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel #end, sp"); \ + asm ("movel #0,a6"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("movel a6,sp@-"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("movl sp@,a6"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea sp@(10)"); \ + asm ("movem #0xfffe,sp@-"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subil #8,sp@(28)"); \ + asm ("movem sp@,#0xffff"); \ + asm ("rte"); } diff --git a/gdb/config/m68k/xm-hp300hpux.h b/gdb/config/m68k/xm-hp300hpux.h new file mode 100644 index 0000000..54979b5 --- /dev/null +++ b/gdb/config/m68k/xm-hp300hpux.h @@ -0,0 +1,173 @@ +/* Parameters for HP 9000 model 320 hosting, for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1992 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. */ + +/* HP/UX is USG, but it does have <ptrace.h> */ +#include <sys/ptrace.h> + +#define HOST_BYTE_ORDER BIG_ENDIAN + +/* Define this to indicate problems with traps after continuing. */ +#define HP_OS_BUG + +/* Set flag to indicate whether HP's assembler is in use. */ +#ifdef __GNUC__ +#ifdef __HPUX_ASM__ +#define HPUX_ASM +#endif +#else /* not GNU C. */ +#define HPUX_ASM +#endif /* not GNU C. */ + +/* Define this for versions of hp-ux older than 6.0 */ +/* #define HPUX_VERSION_5 */ + +/* define USG if you are using sys5 /usr/include's */ +#undef USG /* In case it was defined in the Makefile for cplus-dem.c */ +#define USG + +/* The mem functions are in <string.h>. */ +#undef MEM_FNS_DECLARED +#define MEM_FNS_DECLARED 1 + +#define HAVE_TERMIO + +/* Get rid of any system-imposed stack limit if possible. */ +/* The hp9k320.h doesn't seem to have this feature. */ +/* #define SET_STACK_LIMIT_HUGE */ +/* So we'll just have to avoid big alloca's. */ +#define BROKEN_LARGE_ALLOCA + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#ifdef HPUX_VERSION_5 +#define KERNEL_U_ADDR 0x00979000 +#else /* Not HPUX version 5. */ +/* Use HPUX-style nlist() to get kernel_u_addr. */ +#define KERNEL_U_ADDR_HPUX +#endif /* Not HPUX version 5. */ + +#define REGISTER_ADDR(u_ar0, regno) \ + (unsigned int) \ + (((regno) < PS_REGNUM) \ + ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \ + : (((regno) == PS_REGNUM) \ + ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \ + : (&((struct exception_stack *) (u_ar0))->e_PC))) + +#define FP_REGISTER_ADDR(u, regno) \ + (((char *) \ + (((regno) < FPC_REGNUM) \ + ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \ + : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \ + - ((char *) (& u))) + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +#ifndef HPUX_ASM + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel $ end, sp"); \ + asm ("clrl fp"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("movel fp, -(sp)"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("movl (sp), fp"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea 10(sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subil $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } + +#else /* HPUX_ASM */ + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm ("global end"); \ + asm ("mov.l &end,%sp"); \ + asm ("clr.l %a6"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("mov.l %fp,-(%sp)"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("mov.l (%sp),%fp"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clr.w -(%sp)"); \ + asm ("pea 10(%sp)"); \ + asm ("movm.l &0xfffe,-(%sp)"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subi.l &8,28(%sp)"); \ + asm ("mov.m (%sp),&0xffff"); \ + asm ("rte"); } + +#endif /* HPUX_ASM */ diff --git a/gdb/config/m68k/xm-isi.h b/gdb/config/m68k/xm-isi.h new file mode 100644 index 0000000..1934ff5 --- /dev/null +++ b/gdb/config/m68k/xm-isi.h @@ -0,0 +1,92 @@ +/* Definitions to make GDB run on an ISI Optimum V (3.05) under 4.3bsd. + Copyright 1987, 1989, 1992 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 + +/* This has not been tested on ISI's running BSD 4.2, but it will probably + work. */ + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +/*#define KERNEL_U_ADDR 0x10800000*/ +#define KERNEL_U_ADDR 0 + +/* expects blockend to be u.u_ar0 */ +extern int rloc[]; /* Defined in isi-dep.c */ +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ blockend &= UPAGES*NBPG - 1; \ + if (regno < 18) addr = (int)blockend + rloc[regno]*4; \ + else if (regno < 26) addr = (int) &((struct user *)0)->u_68881_regs \ + + (regno - 18) * 12; \ + else if (regno < 29) addr = (int) &((struct user *)0)->u_68881_regs \ + + 8 * 12 + (regno - 26) * 4; \ +} + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movl $ end, sp"); \ + asm ("clrl fp"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("movel fp, -(sp)"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("movl (sp), fp"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea 10(sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subil $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } diff --git a/gdb/config/m68k/xm-m68k.h b/gdb/config/m68k/xm-m68k.h new file mode 100644 index 0000000..f417e97 --- /dev/null +++ b/gdb/config/m68k/xm-m68k.h @@ -0,0 +1,22 @@ +/* Macro definitions for running gdb on host machines with m68k cpu's. + Copyright (C) 1991, Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support (fnf@cygint) + +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 + diff --git a/gdb/config/m68k/xm-news.h b/gdb/config/m68k/xm-news.h new file mode 100644 index 0000000..147063d --- /dev/null +++ b/gdb/config/m68k/xm-news.h @@ -0,0 +1,140 @@ +/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger. + Copyright 1987, 1989, 1992 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_WAIT_STRUCT + +/* Get rid of any system-imposed stack limit if possible. */ + +#define SET_STACK_LIMIT_HUGE + +/* We can't use "isatty" or "fileno" on this machine. This isn't good, + but it will have to do. */ +#define ISATTY(FP) ((FP) == stdin || (FP) == stdout) + +/* THis is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#define KERNEL_U_ADDR UADDR + +/* The offsets in this macro are from /usr/include/machine/reg.h */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ +{ static char offsets[] = { \ + /*d0-d7:*/1,2,3,4,5,6,7,8, \ + /*a0-a6:*/9,10,11,12,13,14,15, /*sp:*/-4, /*ps:*/0, /*pc:*/-1, \ + /*fp0-fp7:*/19,22,25,28,31,34,37,40, /*fpc:*/16,17,18 }; \ + addr = blockend + 4 * offsets[regno]; \ +} + +/* NewsOS 3 apparently dies on large alloca's -- roland@ai.mit.edu. */ +#define BROKEN_LARGE_ALLOCA + + +/* Interface definitions for kernel debugger KDB. */ + +/* Use GNU assembler instead of standard assembler */ +#define USE_GAS + +/* Motorola assembly format */ +#ifndef USE_GAS +#define MOTOROLA +#endif + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#ifdef MOTOROLA +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("move.l $ end, sp"); \ + asm ("clr.l fp"); } +#else +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel $ end, sp"); \ + asm ("clrl fp"); } +#endif + +/* Push the frame pointer register on the stack. */ +#ifdef MOTOROLA +#define PUSH_FRAME_PTR \ + asm ("move.l fp, -(sp)"); +#else +#define PUSH_FRAME_PTR \ + asm ("movel fp, -(sp)"); +#endif + +/* Copy the top-of-stack to the frame pointer register. */ +#ifdef MOTOROLA +#define POP_FRAME_PTR \ + asm ("move.l (sp), fp"); +#else +#define POP_FRAME_PTR \ + asm ("movl (sp), fp"); +#endif + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#ifdef MOTOROLA +#define PUSH_REGISTERS \ +{ asm ("clr.w -(sp)"); \ + asm ("pea (10,sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } +#else +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea 10(sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } +#endif + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#ifdef MOTOROLA +#define POP_REGISTERS \ +{ asm ("subi.l $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } +#else +#define POP_REGISTERS \ +{ asm ("subil $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } +#endif diff --git a/gdb/config/m68k/xm-news1000.h b/gdb/config/m68k/xm-news1000.h new file mode 100644 index 0000000..40ac415 --- /dev/null +++ b/gdb/config/m68k/xm-news1000.h @@ -0,0 +1,26 @@ +/* Parameters for a Sony/NEWS series 1000 with News-OS version 3, + for GDB, the GNU debugger. + Copyright (C) 1990 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. */ + +/* This is required by Sony include files like <sys/user.h> so we + get the right offset into the u area. Relying on the compiler + to define this only works for cc, not gcc. */ +#undef mc68030 +#define mc68030 +#include "m68k/xm-news.h" diff --git a/gdb/config/m68k/xm-sun2.h b/gdb/config/m68k/xm-sun2.h new file mode 100644 index 0000000..1d6d341 --- /dev/null +++ b/gdb/config/m68k/xm-sun2.h @@ -0,0 +1,82 @@ +/* Parameters for execution on a Sun, for GDB, the GNU debugger. + 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 + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#define KERNEL_U_ADDR 0x2800 + +/* Enable use of alternate code for Sun's format of core dump file. */ + +#define NEW_SUN_CORE + + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel $ end, sp"); \ + asm ("clrl fp"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("movel fp, -(sp)"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("movl (sp), fp"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea 10(sp)"); \ + asm ("movem $ 0xfffe,-(sp)"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subil $8,28(sp)"); \ + asm ("movem (sp),$ 0xffff"); \ + asm ("rte"); } diff --git a/gdb/config/m68k/xm-sun3.h b/gdb/config/m68k/xm-sun3.h new file mode 100644 index 0000000..3970929 --- /dev/null +++ b/gdb/config/m68k/xm-sun3.h @@ -0,0 +1,85 @@ +/* Parameters for execution on a Sun, for GDB, the GNU debugger. + 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 + +/* Get rid of any system-imposed stack limit if possible. */ + +#define SET_STACK_LIMIT_HUGE + +/* Enable use of alternate code for Sun's format of core dump file. */ + +#define NEW_SUN_CORE + +/* We have to grab the regs since we store all regs at once. */ + +#define CHILD_PREPARE_TO_STORE() \ + read_register_bytes (0, (char *)NULL, REGISTER_BYTES) + +/* Interface definitions for kernel debugger KDB. */ + +/* Map machine fault codes into signal numbers. + First subtract 0, divide by 4, then index in a table. + Faults for which the entry in this table is 0 + are not handled by KDB; the program's own trap handler + gets to handle then. */ + +#define FAULT_CODE_ORIGIN 0 +#define FAULT_CODE_UNITS 4 +#define FAULT_TABLE \ +{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ + 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ + 0, 0, 0, 0, 0, 0, 0, 0, \ + SIGILL } + +/* Start running with a stack stretching from BEG to END. + BEG and END should be symbols meaningful to the assembler. + This is used only for kdb. */ + +#define INIT_STACK(beg, end) \ +{ asm (".globl end"); \ + asm ("movel #end, sp"); \ + asm ("movel #0,a6"); } + +/* Push the frame pointer register on the stack. */ +#define PUSH_FRAME_PTR \ + asm ("movel a6,sp@-"); + +/* Copy the top-of-stack to the frame pointer register. */ +#define POP_FRAME_PTR \ + asm ("movl sp@,a6"); + +/* After KDB is entered by a fault, push all registers + that GDB thinks about (all NUM_REGS of them), + so that they appear in order of ascending GDB register number. + The fault code will be on the stack beyond the last register. */ + +#define PUSH_REGISTERS \ +{ asm ("clrw -(sp)"); \ + asm ("pea sp@(10)"); \ + asm ("movem #0xfffe,sp@-"); } + +/* Assuming the registers (including processor status) have been + pushed on the stack in order of ascending GDB register number, + restore them and return to the address in the saved PC register. */ + +#define POP_REGISTERS \ +{ asm ("subil #8,sp@(28)"); \ + asm ("movem sp@,#0xffff"); \ + asm ("rte"); } diff --git a/gdb/config/m68k/xm-sun3os4.h b/gdb/config/m68k/xm-sun3os4.h new file mode 100644 index 0000000..72af7c7 --- /dev/null +++ b/gdb/config/m68k/xm-sun3os4.h @@ -0,0 +1,48 @@ +/* Macro definitions for a sun 3 running os 4. + Copyright (C) 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. */ + +#include "m68k/xm-sun3.h" +#define FPU + +/* Large alloca's fail because the attempt to increase the stack limit in + main() fails because shared libraries are allocated just below the initial + stack limit. The SunOS kernel will not allow the stack to grow into + the area occupied by the shared libraries. Sun knows about this bug + but has no obvious fix for it. */ +#define BROKEN_LARGE_ALLOCA + +/* SunOS 4.x has memory mapped files. */ + +#define HAVE_MMAP + +/* If you expect to use the mmalloc package to obtain mapped symbol files, + for now you have to specify some parameters that determine how gdb places + the mappings in it's address space. See the comments in map_to_address() + for details. This is expected to only be a short term solution. Yes it + is a kludge. + FIXME: Make this more automatic. */ + +#define MMAP_BASE_ADDRESS 0xE0000000 /* First mapping here */ +#define MMAP_INCREMENT 0x01000000 /* Increment to next mapping */ + +/* Prevent type conflicts between yacc malloc decls and defs.h */ +#define MALLOC_INCOMPATIBLE +extern char *malloc(); +extern char *realloc(); +extern void free(); |