diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-10-07 20:13:08 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-10-07 20:13:08 +0000 |
commit | c2d751d5e51893b95c86ada0899d8ed74f4ba9a7 (patch) | |
tree | f169f2c664d75b3c75a6d7e1a42f780a3f574c49 /gdb/config | |
parent | 44a19d2c5b5d1c971ec61c966cd7cebb34996d68 (diff) | |
download | gdb-c2d751d5e51893b95c86ada0899d8ed74f4ba9a7.zip gdb-c2d751d5e51893b95c86ada0899d8ed74f4ba9a7.tar.gz gdb-c2d751d5e51893b95c86ada0899d8ed74f4ba9a7.tar.bz2 |
New Mach stuff:
* config/i386/i386mach.c: Explain this is for the old (probably
non-functional and/or obsolete) Mach stuff.
* m3-nat.c, config/nm-m3.h,
i386m3-nat.c, mipsm3-nat.c, ns32km3-nat.c,
config/i386/{i386m3.mh,i386m3.mt,tm-i386m3.h,xm-i386m3.h},
config/i386/{i386mk.mh,i386mk.mt,tm-i386mk.h,xm-i386mk.h},
config/mips/{mipsm3.mh,mipsm3.mt,tm-mipsm3.h,xm-mipsm3.h},
config/ns32k/{ns32km3.mh,ns32km3.mt,tm-ns32km3.h,xm-ns32km3.h}:
New files.
Diffstat (limited to 'gdb/config')
-rw-r--r-- | gdb/config/.Sanitize | 1 | ||||
-rw-r--r-- | gdb/config/i386/.Sanitize | 8 | ||||
-rw-r--r-- | gdb/config/i386/i386m3.mh | 8 | ||||
-rw-r--r-- | gdb/config/i386/i386m3.mt | 4 | ||||
-rw-r--r-- | gdb/config/i386/i386mach.mh | 4 | ||||
-rw-r--r-- | gdb/config/i386/i386mk.mh | 8 | ||||
-rw-r--r-- | gdb/config/i386/i386mk.mt | 7 | ||||
-rw-r--r-- | gdb/config/i386/tm-i386m3.h | 74 | ||||
-rw-r--r-- | gdb/config/i386/tm-i386mk.h | 25 | ||||
-rw-r--r-- | gdb/config/i386/xm-i386m3.h | 44 | ||||
-rw-r--r-- | gdb/config/i386/xm-i386mk.h | 25 | ||||
-rw-r--r-- | gdb/config/mips/.Sanitize | 4 | ||||
-rw-r--r-- | gdb/config/mips/mipsm3.mh | 9 | ||||
-rw-r--r-- | gdb/config/mips/mipsm3.mt | 4 | ||||
-rw-r--r-- | gdb/config/mips/tm-mipsm3.h | 79 | ||||
-rw-r--r-- | gdb/config/mips/xm-mipsm3.h | 36 | ||||
-rw-r--r-- | gdb/config/nm-m3.h | 133 | ||||
-rw-r--r-- | gdb/config/ns32k/.Sanitize | 4 | ||||
-rw-r--r-- | gdb/config/ns32k/ns32km3.mh | 8 | ||||
-rw-r--r-- | gdb/config/ns32k/ns32km3.mt | 4 | ||||
-rw-r--r-- | gdb/config/ns32k/tm-ns32km3.h | 64 | ||||
-rw-r--r-- | gdb/config/ns32k/xm-ns32km3.h | 37 |
22 files changed, 590 insertions, 0 deletions
diff --git a/gdb/config/.Sanitize b/gdb/config/.Sanitize index 90818b7..175d923 100644 --- a/gdb/config/.Sanitize +++ b/gdb/config/.Sanitize @@ -33,6 +33,7 @@ i960 m68k m88k mips +nm-m3.h nm-sysv4.h nm-trash.h none diff --git a/gdb/config/i386/.Sanitize b/gdb/config/i386/.Sanitize index af89952..153091c 100644 --- a/gdb/config/i386/.Sanitize +++ b/gdb/config/i386/.Sanitize @@ -30,6 +30,10 @@ i386bsd.mt i386lynx.mh i386lynx.mt i386mach.mh +i386m3.mh +i386m3.mt +i386mk.mh +i386mk.mt i386nw.mt i386sco.mh i386sco4.mh @@ -63,6 +67,8 @@ symmetry.mt tm-i386aix.h tm-i386bsd.h tm-i386lynx.h +tm-i386m3.h +tm-i386mk.h tm-i386nw.h tm-i386v.h tm-i386v4.h @@ -73,7 +79,9 @@ xm-go32.h xm-i386aix.h xm-i386bsd.h xm-i386lynx.h +xm-i386m3.h xm-i386mach.h +xm-i386mk.h xm-i386sco.h xm-i386v.h xm-i386v32.h diff --git a/gdb/config/i386/i386m3.mh b/gdb/config/i386/i386m3.mh index e69de29..02e0bd6 100644 --- a/gdb/config/i386/i386m3.mh +++ b/gdb/config/i386/i386m3.mh @@ -0,0 +1,8 @@ +# Host: Intel 386 running Mach3 + +XDEPFILES= os-mach3.o i386mach3-xdep.o i387-tdep.o coredep.o +XM_FILE= xm-i386mach3.h + +# Don't use the mmalloc library in Mach 3. +MMALLOC_LIB = +MMALLOC_DISABLE = -DNO_MMALLOC diff --git a/gdb/config/i386/i386m3.mt b/gdb/config/i386/i386m3.mt index e69de29..a36e9b0 100644 --- a/gdb/config/i386/i386m3.mt +++ b/gdb/config/i386/i386m3.mt @@ -0,0 +1,4 @@ +# Target: Intel 386 with a.out + +TDEPFILES= exec.o i386-pinsn.o i386-tdep.o +TM_FILE= tm-i386mach3.h diff --git a/gdb/config/i386/i386mach.mh b/gdb/config/i386/i386mach.mh index b98c27b..44766c5 100644 --- a/gdb/config/i386/i386mach.mh +++ b/gdb/config/i386/i386mach.mh @@ -1,5 +1,9 @@ # Host: Intel 386 running Mach +# This is for mach2, maybe, or is obsolete (and seems to have only +# host and native, not target). Once we get the mach3 stuff working, +# I think it can go away. + XDEPFILES= XM_FILE= xm-i386mach.h NAT_FILE= nm-i386mach.h diff --git a/gdb/config/i386/i386mk.mh b/gdb/config/i386/i386mk.mh index e69de29..e5d30f8 100644 --- a/gdb/config/i386/i386mk.mh +++ b/gdb/config/i386/i386mk.mh @@ -0,0 +1,8 @@ +# Host: Intel 386 running Mach3 with OSF 1/MK + +XDEPFILES= os-mach3.o i386mach3-xdep.o i387-tdep.o +XM_FILE= xm-i386osf1mk.h + +# Don't use the mmalloc library in Mach 3. +MMALLOC_LIB = +MMALLOC_DISABLE = -DNO_MMALLOC diff --git a/gdb/config/i386/i386mk.mt b/gdb/config/i386/i386mk.mt index e69de29..e9f7373 100644 --- a/gdb/config/i386/i386mk.mt +++ b/gdb/config/i386/i386mk.mt @@ -0,0 +1,7 @@ +# Target: Intel 386 with a.out in osf 1/mk +# +TDEPFILES= exec.o i386-pinsn.o i386-tdep.o +TM_FILE= tm-i386osf1mk.h +TM_CFLAGS= -I/usr/mach3/include +TM_CLIBS= /usr/mach3/ccs/lib/libmachid.a /usr/mach3/ccs/lib/libnetname.a /usr/mach3/ccs/lib/libmach.a +OBJFORMATS= dbxread.o diff --git a/gdb/config/i386/tm-i386m3.h b/gdb/config/i386/tm-i386m3.h index e69de29..0c70930 100644 --- a/gdb/config/i386/tm-i386m3.h +++ b/gdb/config/i386/tm-i386m3.h @@ -0,0 +1,74 @@ +/* Macro definitions for i386, Mach 3.0 + 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. */ + +/* Include common definitions for Mach3 systems */ +#include "os-mach3.h" + +/* Define offsets to access CPROC stack when it does not have + * a kernel thread. + */ +#define MACHINE_CPROC_SP_OFFSET 20 +#define MACHINE_CPROC_PC_OFFSET 16 +#define MACHINE_CPROC_FP_OFFSET 12 + +/* Thread flavors used in re-setting the T bit. + * @@ this is also bad for cross debugging. + */ +#define TRACE_FLAVOR i386_THREAD_STATE +#define TRACE_FLAVOR_SIZE i386_THREAD_STATE_COUNT +#define TRACE_SET(x,state) \ + ((struct i386_thread_state *)state)->efl |= 0x100 +#define TRACE_CLEAR(x,state) \ + ((((struct i386_thread_state *)state)->efl &= ~0x100), 1) + +/* we can do it */ +#define ATTACH_DETACH 1 + +/* number of traps that happen between exec'ing the shell + * to run an inferior, and when we finally get to + * the inferior code. This is 2 on most implementations. + * + * On Mach 3.0 it is the number of exec() system calls before + * the task contains the debugged program. It is always 2 when + * using the shell to start up the program. + */ +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 2 + +/* Define this if the C compiler puts an underscore at the front + of external names before giving them to the linker. */ + +#define NAMES_HAVE_UNDERSCORE + +/* Sigh. There should be a file for i386 but no sysv stuff in it */ +#include "tm-i386v.h" + +/* I want to test this float info code. See comment in tm-i386v.h */ +#undef FLOAT_INFO +#define FLOAT_INFO { i386_mach3_float_info (); } + +/* We use a.out format */ +#undef COFF_NO_LONG_FILE_NAMES + +/* Address of end of stack space. + * for MACH, see <machine/vmparam.h> + * @@@ I don't know what is in the 5 ints... + */ +#undef STACK_END_ADDR +#define STACK_END_ADDR (0xc0000000-sizeof(int [5])) diff --git a/gdb/config/i386/tm-i386mk.h b/gdb/config/i386/tm-i386mk.h index e69de29..8035433 100644 --- a/gdb/config/i386/tm-i386mk.h +++ b/gdb/config/i386/tm-i386mk.h @@ -0,0 +1,25 @@ +/* Macro definitions for i386, Mach 3.0, OSF 1/MK + 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. */ + +/* Until OSF switches to a newer Mach kernel that has + * a different get_emul_vector() interface. + */ +#define MK67 1 + +#include "tm-i386mach3.h" diff --git a/gdb/config/i386/xm-i386m3.h b/gdb/config/i386/xm-i386m3.h index e69de29..639ac8d 100644 --- a/gdb/config/i386/xm-i386m3.h +++ b/gdb/config/i386/xm-i386m3.h @@ -0,0 +1,44 @@ +/* Definitions to make GDB run on Mach 3 on an Intel 386 + Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define HOST_BYTE_ORDER LITTLE_ENDIAN + +/* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly + the same as in the system <machine/machtypes.h> file. */ +#undef INT_MIN +#define INT_MIN 0x80000000 + +/* Get rid of any system-imposed stack limit if possible. */ + +#define SET_STACK_LIMIT_HUGE + +#define BROKEN_LARGE_ALLOCA + +/* Do implement the attach and detach commands. */ +#define ATTACH_DETACH 1 + +/* Not needeed */ +#define KERNEL_U_ADDR 0 + +#ifndef EMULATOR_BASE +/* For EMULATOR_BASE and EMULATOR_END. + * OSF 1/MK has different values in some other place. + */ +#include <machine/vmparam.h> +#endif /* EMULATOR_BASE */ diff --git a/gdb/config/i386/xm-i386mk.h b/gdb/config/i386/xm-i386mk.h index e69de29..7fdf313 100644 --- a/gdb/config/i386/xm-i386mk.h +++ b/gdb/config/i386/xm-i386mk.h @@ -0,0 +1,25 @@ +/* Definitions to make GDB run on Mach 3 OSF 1/MK on an Intel 386 + 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 HAVE_TERMIO 1 + +#define EMULATOR_BASE 0xa0000000 +#define EMULATOR_END 0xa0040000 + +#include "xm-i386mach3.h" diff --git a/gdb/config/mips/.Sanitize b/gdb/config/mips/.Sanitize index 194dc94..541def5 100644 --- a/gdb/config/mips/.Sanitize +++ b/gdb/config/mips/.Sanitize @@ -31,6 +31,8 @@ irix3.mt irix4.mh littlemips.mh littlemips.mt +mipsm3.mh +mipsm3.mt news-mips.mh nm-irix3.h nm-irix4.h @@ -41,10 +43,12 @@ riscos.mh tm-bigmips.h tm-irix3.h tm-mips.h +tm-mipsm3.h xm-irix3.h xm-irix4.h xm-makeva.h xm-mips.h +xm-mipsm3.h xm-news-mips.h xm-riscos.h diff --git a/gdb/config/mips/mipsm3.mh b/gdb/config/mips/mipsm3.mh index e69de29..51a692b 100644 --- a/gdb/config/mips/mipsm3.mh +++ b/gdb/config/mips/mipsm3.mh @@ -0,0 +1,9 @@ +# Host: Little endian MIPS machine such as pmax +# running Mach 3.0 operating system + +XDEPFILES= os-mach3.o mipsmach3-xdep.o coredep.o +XM_FILE= xm-mipsmach3.h + +# Don't use the mmalloc library in Mach 3. +MMALLOC_LIB = +MMALLOC_DISABLE = -DNO_MMALLOC diff --git a/gdb/config/mips/mipsm3.mt b/gdb/config/mips/mipsm3.mt index e69de29..22a240f 100644 --- a/gdb/config/mips/mipsm3.mt +++ b/gdb/config/mips/mipsm3.mt @@ -0,0 +1,4 @@ +# Target: Little-endian MIPS machine such as pmax +# running Mach 3.0 operating system +TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o +TM_FILE= tm-mipsmach3.h diff --git a/gdb/config/mips/tm-mipsm3.h b/gdb/config/mips/tm-mipsm3.h index e69de29..27a03dc 100644 --- a/gdb/config/mips/tm-mipsm3.h +++ b/gdb/config/mips/tm-mipsm3.h @@ -0,0 +1,79 @@ +/* Definitions to make GDB run on a mips box under Mach 3.0 + 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. */ + +/* Mach specific definitions for little endian mips (e.g. pmax) + * running Mach 3.0 + * + * Author: Jukka Virtanen <jtv@hut.fi> + */ + +/* Include common definitions for Mach3 systems */ +#include "os-mach3.h" + +/* Define offsets to access CPROC stack when it does not have + * a kernel thread. + */ + +/* From mk/user/threads/mips/csw.s */ +#define SAVED_FP (12*4) +#define SAVED_PC (13*4) +#define SAVED_BYTES (14*4) + +/* Using these, define our offsets to items strored in + * cproc_switch in csw.s + */ +#define MACHINE_CPROC_SP_OFFSET SAVED_BYTES +#define MACHINE_CPROC_PC_OFFSET SAVED_PC +#define MACHINE_CPROC_FP_OFFSET SAVED_FP + +/* Thread flavors used in setting the Trace state. + * + * In <mach/machine/thread_status.h> + */ +#define TRACE_FLAVOR MIPS_EXC_STATE +#define TRACE_FLAVOR_SIZE MIPS_EXC_STATE_COUNT +#define TRACE_SET(x,state) ((struct mips_exc_state *)state)->cause = EXC_SST; +#define TRACE_CLEAR(x,state) 0 + +/* Mach supports attach/detach */ +#define ATTACH_DETACH 1 + +#include "tm-mips.h" + +/* + * On Mach 3.0 this is the number of exec() system calls before + * the task contains the debugged program. It is always 2 when + * using the shell to start up the program. + */ +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 2 + +/* Address of end of user stack space. + * for MACH, see <machine/vmparam.h> + */ +#undef STACK_END_ADDR +#define STACK_END_ADDR USRSTACK + +/* Don't output r?? names for registers, since they + * can't be used as reg names anyway + */ +#define NUMERIC_REG_NAMES + +/* Output registers in tabular format */ +#define TABULAR_REGISTER_OUTPUT diff --git a/gdb/config/mips/xm-mipsm3.h b/gdb/config/mips/xm-mipsm3.h index e69de29..17ba086 100644 --- a/gdb/config/mips/xm-mipsm3.h +++ b/gdb/config/mips/xm-mipsm3.h @@ -0,0 +1,36 @@ +/* Definitions to make GDB run on a mips box under 4.3bsd. + Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. + Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin(af@cs.cmu.edu) at CMU + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#if !defined (HOST_BYTE_ORDER) +#define HOST_BYTE_ORDER LITTLE_ENDIAN +#endif + +/* Get rid of any system-imposed stack limit if possible */ + +#define SET_STACK_LIMIT_HUGE + +#define KERNEL_U_ADDR 0 /* Not needed. */ + +/* Only used for core files on DECstations. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\ + else addr = 0; /* ..somewhere in the pcb */ diff --git a/gdb/config/nm-m3.h b/gdb/config/nm-m3.h index e69de29..8e2730f 100644 --- a/gdb/config/nm-m3.h +++ b/gdb/config/nm-m3.h @@ -0,0 +1,133 @@ +/* Mach 3.0 common definitions and global vars. + + 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. */ + +#ifndef _OS_MACH3_H_ +#define _OS_MACH3_H + +#include <mach.h> + +/* Mach3 doesn't declare errno in <errno.h>. */ +extern int errno; + +/* Task port of our debugged inferior. */ + +extern task_t inferior_task; + +/* Thread port of the current thread in the inferior. */ + +extern thread_t current_thread; + +/* If nonzero, we must suspend/abort && resume threads + * when setting or getting the state. + */ +extern int must_suspend_thread; + +/* Get relevant ports when creating a new inferior */ + +#define CREATE_INFERIOR_HOOK(pid) mach_create_inferior_hook(pid) + +/* wait for the inferior to change state */ + +#define INFERIOR_WAIT_HOOK(w) mach_really_wait(w) + +/* After fork() call this before exec() in the inferior task */ + +#define PREPARE_INFERIOR prepare_inferior_task + +/* Startup the inferior task and suspend it after the correct code is loaded */ + +#define STARTUP_INFERIOR(x) intercept_exec_calls(x) + +#define PREPARE_TO_PROCEED(select_it) mach3_prepare_to_proceed(select_it) + +/* Try to get the privileged host port for authentication to machid + * + * If you can get this, you may debug anything on this host. + * + * If you can't, gdb gives it's own task port as the + * authentication port + */ +#define mach_privileged_host_port() task_by_pid(-1) + +/* + * This is the MIG ID number of the emulator/server bsd_execve() RPC call. + * + * It SHOULD never change, but if it does, gdb `run' + * command won't work until you fix this define. + * + */ +#define MIG_EXEC_SYSCALL_ID 101000 + +/* If our_message_port gets a msg with this ID, + * GDB suspends it's inferior and enters command level. + * (Useful at least if ^C does not work) + */ +#define GDB_MESSAGE_ID_STOP 0x41151 + +/* wait3 WNOHANG is defined in <sys/wait.h> but + * for some reason gdb does not want to include + * that file. + * + * If your system defines WNOHANG differently, this has to be changed. + */ +#define WNOHANG 1 + +/* Before storing, we need to read all the registers. */ + +#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES) + +/* Check if the inferior exists */ +#define MACH_ERROR_NO_INFERIOR \ + do if (!MACH_PORT_VALID (inferior_task)) \ + error ("Inferior task does not exist."); while(0) + +/* Error handler for mach calls */ +#define CHK(str,ret) \ + do if (ret != KERN_SUCCESS) \ + error ("Gdb %s [%d] %s : %s\n",__FILE__,__LINE__,str, \ + mach_error_string(ret)); while(0) + +/* This is from POE9 emulator/emul_stack.h + */ +/* + * Top of emulator stack holds link and reply port. + */ +struct emul_stack_top { + struct emul_stack_top *link; + mach_port_t reply_port; +}; + +#define EMULATOR_STACK_SIZE (4096*4) + +#define THREAD_ALLOWED_TO_BREAK(mid) mach_thread_for_breakpoint (mid) + +#define THREAD_PARSE_ID(arg) mach_thread_parse_id (arg) + +#define THREAD_OUTPUT_ID(mid) mach_thread_output_id (mid) + +#define ATTACH_TO_THREAD attach_to_thread + +/* Do Mach 3 dependent operations when ^C or a STOP is requested */ +#define DO_QUIT() mach3_quit () + +/* If in mach_msg() and ^C is typed set immediate_quit */ +#define REQUEST_QUIT() mach3_request_quit () + +#endif /* _OS_MACH3_H_ */ diff --git a/gdb/config/ns32k/.Sanitize b/gdb/config/ns32k/.Sanitize index bcf00bb..69b0407 100644 --- a/gdb/config/ns32k/.Sanitize +++ b/gdb/config/ns32k/.Sanitize @@ -24,11 +24,15 @@ Things-to-keep: merlin.mh merlin.mt nm-umax.h +ns32km3.mh +ns32km3.mt tm-merlin.h +tm-ns32km3.h tm-umax.h umax.mh umax.mt xm-merlin.h +xm-ns32km3.h xm-umax.h Things-to-lose: diff --git a/gdb/config/ns32k/ns32km3.mh b/gdb/config/ns32k/ns32km3.mh index e69de29..8fff1a3 100644 --- a/gdb/config/ns32k/ns32km3.mh +++ b/gdb/config/ns32k/ns32km3.mh @@ -0,0 +1,8 @@ +# Host: ns32k running Mach3 + +XDEPFILES= os-mach3.o ns32kmach3-xdep.o +XM_FILE= xm-ns32kmach3.h + +# Don't use the mmalloc library in Mach 3. +MMALLOC_LIB = +MMALLOC_DISABLE = -DNO_MMALLOC diff --git a/gdb/config/ns32k/ns32km3.mt b/gdb/config/ns32k/ns32km3.mt index e69de29..2e36b83 100644 --- a/gdb/config/ns32k/ns32km3.mt +++ b/gdb/config/ns32k/ns32km3.mt @@ -0,0 +1,4 @@ +# Target: ns32k with a.out on Mach 3 + +TDEPFILES= exec.o ns32k-pinsn.o ns32k-tdep.o +TM_FILE= tm-ns32kmach3.h diff --git a/gdb/config/ns32k/tm-ns32km3.h b/gdb/config/ns32k/tm-ns32km3.h index e69de29..8055f7a 100644 --- a/gdb/config/ns32k/tm-ns32km3.h +++ b/gdb/config/ns32k/tm-ns32km3.h @@ -0,0 +1,64 @@ +/* Macro definitions for ns532, Mach 3.0 + 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. */ + +/* Include common definitions for Mach3 systems */ +#include "os-mach3.h" + +/* Define offsets to access CPROC stack when it does not have + * a kernel thread. + */ +#define MACHINE_CPROC_SP_OFFSET 20 +#define MACHINE_CPROC_PC_OFFSET 16 +#define MACHINE_CPROC_FP_OFFSET 12 + +#include <ns532/psl.h> +#include <ns532/vmparam.h> + +/* Thread flavors used in re-setting the T bit. + * @@ this is also bad for cross debugging. + */ +#define TRACE_FLAVOR NS532_THREAD_STATE +#define TRACE_FLAVOR_SIZE NS532_THREAD_STATE_COUNT +#define TRACE_SET(x,state) \ + ((struct ns532_thread_state *)state)->psr |= PSR_T +#define TRACE_CLEAR(x,state) \ + ((((struct ns532_thread_state *)state)->psr &= ~PSR_T), 1) + +/* we can do it */ +#define ATTACH_DETACH 1 + +/* number of traps that happen between exec'ing the shell + * to run an inferior, and when we finally get to + * the inferior code. This is 2 on most implementations. + * + * On Mach 3.0 it is the number of exec() system calls before + * the task contains the debugged program. It is always 2 when + * using the shell to start up the program. + */ +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 2 + +#define INVALID_FLOAT(p, s) isa_NAN(p, s) + +/* Address of end of stack space. + * for MACH, see <ns532/vmparam.h> + */ +#define STACK_END_ADDR USRSTACK + +#include "tm-umax.h" diff --git a/gdb/config/ns32k/xm-ns32km3.h b/gdb/config/ns32k/xm-ns32km3.h index e69de29..9300b2e 100644 --- a/gdb/config/ns32k/xm-ns32km3.h +++ b/gdb/config/ns32k/xm-ns32km3.h @@ -0,0 +1,37 @@ +/* Definitions to make GDB run on Mach 3 on an National ns32k + Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define HOST_BYTE_ORDER LITTLE_ENDIAN + +/* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly + the same as in the system <machine/machtypes.h> file. */ +#undef INT_MIN +#define INT_MIN 0x80000000 + +/* Get rid of any system-imposed stack limit if possible. */ + +#define SET_STACK_LIMIT_HUGE + +#define BROKEN_LARGE_ALLOCA + +/* Do implement the attach and detach commands. */ +#define ATTACH_DETACH 1 + +/* signal.h has declaration for psignal() */ +#define PSIGNAL_IN_SIGNAL_H |