config files moved to an appropriate config/<cpu> subdirectory.
* nm-*, xm-*, tm-*: All native, host, and target files, which
get linked to nm.h, xm.h, and tm.h respectively by configure,
moved to appropriate config/<cpu> subdirectory.
--- /dev/null
+# Target: Remote AMD 29000 that runs Unix kernel on NYU Ultra3 processor board.
+# This builds a gdb that should run on a host (we use sun3os4) that
+# then communicates over the serial line to either an Adapt or MiniMon,
+# for use in debugging Unix kernels.
+# As compared to ordinary remote 29K debugging, this changes the register
+# numbering a bit, to hold kernel regs, and adds support for looking at
+# the upage.
+TDEPFILES= exec.o am29k-pinsn.o am29k-tdep.o remote-mm.o remote-adapt.o
+TM_FILE= tm-ultra3.h
+MT_CFLAGS = -DKERNEL_DEBUGGING -DNO_HIF_SUPPORT
--- /dev/null
+# Target: AMD 29000 on EB29K board over a serial line.
+TDEPFILES= exec.o am29k-pinsn.o remote-udi.o am29k-tdep.o udip2soc.o udr.o
+TM_FILE= tm-29k.h
+# The following is for ../include/a.out.encap.h
+MT_CFLAGS = -Da29k -DREMOTE -DTARGET=TARGET_AM29K -DAMD_COFF
--- /dev/null
+# Target: AMD 29000.
+# These defines should give you a gdb running on ? (sun3os4 if you like)
+# that will be able to communicate over a serial line with either an
+# EB board (remote-eb.c),
+# Adapt (remote-adapt.c),
+# or a MiniMon debugger (remote-mm.c).
+# Or run native on an Ultracomputer.
+TDEPFILES= exec.o am29k-pinsn.o am29k-tdep.o remote-eb.o remote-mm.o remote-adapt.o
+TM_FILE= tm-29k.h
+MT_CFLAGS = -DNO_HIF_SUPPORT
--- /dev/null
+/* Host definitions for GDB running on a 29k NYU Ultracomputer
+ Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Contributed by David Wood (wood@lab.ultra.nyu.edu).
+
+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 we ever *do* end up using the standard fetch_inferior_registers,
+ this is the right value for U_REGS_OFFSET. */
+#define U_REGS_OFFSET 0
+
+/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
+#define FETCH_INFERIOR_REGISTERS
--- /dev/null
+/* Parameters for target machine of AMD 29000, for GDB, the GNU debugger.
+ Copyright 1990, 1991, 1993 Free Software Foundation, Inc.
+ Contributed by Cygnus Support. Written by Jim Kingdon.
+
+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. */
+
+/* Parameters for an EB29K (a board which plugs into a PC and is
+ accessed through EBMON software running on the PC, which we
+ use as we'd use a remote stub (see remote-eb.c).
+
+ If gdb is ported to other 29k machines/systems, the
+ machine/system-specific parts should be removed from this file (a
+ la tm-68k.h). */
+
+/* Byte order is configurable, but this machine runs big-endian. */
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+/* Floating point uses IEEE representations. */
+#define IEEE_FLOAT
+
+/* Recognize our magic number. */
+#define BADMAG(x) ((x).f_magic != 0572)
+
+/* 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. */
+
+#define SKIP_PROLOGUE(pc) \
+ { pc = skip_prologue (pc); }
+CORE_ADDR skip_prologue ();
+
+/* Immediately after a function call, return the saved pc.
+ Can't 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_register (LR0_REGNUM))
+
+/* I'm not sure about the exact value of this, but based on looking
+ at the stack pointer when we get to main this seems to be right.
+
+ This is the register stack; We call it "CONTROL" in GDB for consistency
+ with Pyramid. */
+#define CONTROL_END_ADDR 0x80200000
+
+/* Memory stack. This is for the default register stack size, which is
+ only 0x800 bytes. Perhaps we should let the user specify stack sizes
+ (and tell EBMON with the "ZS" command). */
+#define STACK_END_ADDR 0x801ff800
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Stack must be aligned on 32-bit word boundaries. */
+#define STACK_ALIGN(ADDR) (((ADDR) + 3) & ~3)
+
+/* Sequence of bytes for breakpoint instruction. */
+/* ASNEQ 0x50, gr1, gr1
+ The trap number 0x50 is chosen arbitrarily.
+ We let the command line (or previously included files) override this
+ setting. */
+#ifndef BREAKPOINT
+#if TARGET_BYTE_ORDER == BIG_ENDIAN
+#define BREAKPOINT {0x72, 0x50, 0x01, 0x01}
+#else /* Target is little-endian. */
+#define BREAKPOINT {0x01, 0x01, 0x50, 0x72}
+#endif /* Target is little-endian. */
+#endif /* BREAKPOINT */
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction.
+ On the 29k, this is a "jmpi l0" instruction. */
+
+#define ABOUT_TO_RETURN(pc) \
+ ((read_memory_integer (pc, 4) & 0xff0000ff) == 0xc0000080)
+
+/* 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 (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Allow the register declarations here to be overridden for remote
+ kernel debugging. */
+#if !defined (REGISTER_NAMES)
+
+/* Number of machine registers */
+
+#define NUM_REGS 205
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer.
+
+ FIXME, add floating point registers and support here.
+
+ Also note that this list does not attempt to deal with kernel
+ debugging (in which the first 32 registers are gr64-gr95). */
+
+#define REGISTER_NAMES \
+{"gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \
+ "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \
+ "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \
+ "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \
+ "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \
+ "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \
+ "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \
+ "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \
+ "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \
+ "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \
+ "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \
+ "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \
+ "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \
+ "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \
+ "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \
+ "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \
+ "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \
+ "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \
+ "lr124", "lr125", "lr126", "lr127", \
+ "AI0", "AI1", "AI2", "AI3", "AI4", "AI5", "AI6", "AI7", "AI8", "AI9", \
+ "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \
+ "bp", "fc", "cr", "q", \
+ "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \
+ "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "inte", "fps", "exo", "gr1", \
+ "alu", "ipc", "ipa", "ipb" }
+
+/*
+ * Converts an sdb register number to an internal gdb register number.
+ * Currently under epi, gr96->0...gr127->31...lr0->32...lr127->159, or...
+ * gr64->0...gr95->31, lr0->32...lr127->159.
+ */
+#define SDB_REG_TO_REGNUM(value) \
+ (((value) >= 96 && (value) <= 127) ? ((value) - 96) : \
+ ((value) >= 128 && (value) <= 255) ? ((value) - 128 + LR0_REGNUM) : \
+ (value))
+
+/*
+ * Provide the processor register numbers of some registers that are
+ * expected/written in instructions that might change under different
+ * register sets. Namely, gcc can compile (-mkernel-registers) so that
+ * it uses gr64-gr95 in stead of gr96-gr127.
+ */
+#define MSP_HW_REGNUM 125 /* gr125 */
+#define RAB_HW_REGNUM 126 /* gr126 */
+
+/* Convert Processor Special register #x to REGISTER_NAMES register # */
+#define SR_REGNUM(x) \
+ ((x) < 15 ? VAB_REGNUM + (x) \
+ : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x) - 128 \
+ : (x) == 131 ? Q_REGNUM \
+ : (x) == 132 ? ALU_REGNUM \
+ : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x) - 133 \
+ : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x) - 160 \
+ : (x) == 164 ? EXO_REGNUM \
+ : (error ("Internal error in SR_REGNUM"), 0))
+#define GR96_REGNUM 0
+/* Define the return register separately, so it can be overridden for
+ kernel procedure calling conventions. */
+#define RETURN_REGNUM GR96_REGNUM
+#define GR1_REGNUM 200
+/* This needs to be the memory stack pointer, not the register stack pointer,
+ to make call_function work right. */
+#define SP_REGNUM MSP_REGNUM
+#define FP_REGNUM 33 /* lr1 */
+/* Large Return Pointer (gr123). */
+#define LRP_REGNUM (123 - 96 + GR96_REGNUM)
+/* Static link pointer (gr124). */
+#define SLP_REGNUM (124 - 96 + GR96_REGNUM)
+/* Memory Stack Pointer (gr125). */
+#define MSP_REGNUM (125 - 96 + GR96_REGNUM)
+/* Register allocate bound (gr126). */
+#define RAB_REGNUM (126 - 96 + GR96_REGNUM)
+/* Register Free Bound (gr127). */
+#define RFB_REGNUM (127 - 96 + GR96_REGNUM)
+/* Register Stack Pointer. */
+#define RSP_REGNUM GR1_REGNUM
+#define LR0_REGNUM 32
+#define BP_REGNUM 177
+#define FC_REGNUM 178
+#define CR_REGNUM 179
+#define Q_REGNUM 180
+#define VAB_REGNUM 181
+#define OPS_REGNUM (VAB_REGNUM + 1)
+#define CPS_REGNUM (VAB_REGNUM + 2)
+#define CFG_REGNUM (VAB_REGNUM + 3)
+#define CHA_REGNUM (VAB_REGNUM + 4)
+#define CHD_REGNUM (VAB_REGNUM + 5)
+#define CHC_REGNUM (VAB_REGNUM + 6)
+#define RBP_REGNUM (VAB_REGNUM + 7)
+#define TMC_REGNUM (VAB_REGNUM + 8)
+#define TMR_REGNUM (VAB_REGNUM + 9)
+#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
+#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
+#define PC2_REGNUM (VAB_REGNUM + 12)
+#define MMU_REGNUM (VAB_REGNUM + 13)
+#define LRU_REGNUM (VAB_REGNUM + 14)
+#define FPE_REGNUM (VAB_REGNUM + 15)
+#define INTE_REGNUM (VAB_REGNUM + 16)
+#define FPS_REGNUM (VAB_REGNUM + 17)
+#define EXO_REGNUM (VAB_REGNUM + 18)
+/* gr1 is defined above as 200 = VAB_REGNUM + 19 */
+#define ALU_REGNUM (VAB_REGNUM + 20)
+#define PS_REGNUM ALU_REGNUM
+#define IPC_REGNUM (VAB_REGNUM + 21)
+#define IPA_REGNUM (VAB_REGNUM + 22)
+#define IPB_REGNUM (VAB_REGNUM + 23)
+
+#endif /* !defined(REGISTER_NAMES) */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (NUM_REGS * 4)
+
+/* 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. */
+
+/* All regs are 4 bytes. */
+
+#define REGISTER_RAW_SIZE(N) (4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+/* 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) \
+{ bcopy ((FROM), (TO), 4); }
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+{ bcopy ((FROM), (TO), 4); }
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ (((N) == PC_REGNUM || (N) == LRP_REGNUM || (N) == SLP_REGNUM \
+ || (N) == MSP_REGNUM || (N) == RAB_REGNUM || (N) == RFB_REGNUM \
+ || (N) == GR1_REGNUM || (N) == FP_REGNUM || (N) == LR0_REGNUM \
+ || (N) == NPC_REGNUM || (N) == PC2_REGNUM) \
+ ? lookup_pointer_type (builtin_type_void) : builtin_type_int)
+\f
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+/* On the 29k the LRP points to the part of the structure beyond the first
+ 16 words. */
+#define STORE_STRUCT_RETURN(ADDR, SP) \
+ write_register (LRP_REGNUM, (ADDR) + 16 * 4);
+
+/* Should call_function allocate stack space for a struct return? */
+/* On the 29k objects over 16 words require the caller to allocate space. */
+#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 16 * 4)
+
+/* 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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ { \
+ int reg_length = TYPE_LENGTH (TYPE); \
+ if (reg_length > 16 * 4) \
+ { \
+ reg_length = 16 * 4; \
+ read_memory (*((int *)(REGBUF) + LRP_REGNUM), (VALBUF) + 16 * 4, \
+ TYPE_LENGTH (TYPE) - 16 * 4); \
+ } \
+ bcopy (((int *)(REGBUF))+RETURN_REGNUM, (VALBUF), reg_length); \
+ }
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ { \
+ int reg_length = TYPE_LENGTH (TYPE); \
+ if (reg_length > 16 * 4) \
+ { \
+ reg_length = 16 * 4; \
+ write_memory (read_register (LRP_REGNUM), \
+ (char *)(VALBUF) + 16 * 4, \
+ TYPE_LENGTH (TYPE) - 16 * 4); \
+ } \
+ write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF), \
+ TYPE_LENGTH (TYPE)); \
+ }
+\f
+/* The am29k user's guide documents well what the stacks look like.
+ But what isn't so clear there is how this interracts with the
+ symbols, or with GDB.
+ In the following saved_msp, saved memory stack pointer (which functions
+ as a memory frame pointer), means either
+ a register containing the memory frame pointer or, in the case of
+ functions with fixed size memory frames (i.e. those who don't use
+ alloca()), the result of the calculation msp + msize.
+
+ LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp.
+ For high C, these are relative to msp (making alloca impossible).
+ LOC_REGISTER, LOC_REGPARM - The register number is the number at the
+ time the function is running (after the prologue), or in the case
+ of LOC_REGPARM, may be a register number in the range 160-175.
+
+ The compilers do things like store an argument into memory, and then put out
+ a LOC_ARG for it, or put it into global registers and put out a
+ LOC_REGPARM. Thus is it important to execute the first line of
+ code (i.e. the line of the open brace, i.e. the prologue) of a function
+ before trying to print arguments or anything.
+
+ The following diagram attempts to depict what is going on in memory
+ (see also the _am29k user's guide_) and also how that interacts with
+ GDB frames. We arbitrarily pick fci->frame to point the same place
+ as the register stack pointer; since we set it ourself in
+ INIT_EXTRA_FRAME_INFO, and access it only through the FRAME_*
+ macros, it doesn't really matter exactly how we
+ do it. However, note that FRAME_FP is used in two ways in GDB:
+ (1) as a "magic cookie" which uniquely identifies frames (even over
+ calls to the inferior), (2) (in PC_IN_CALL_DUMMY [ON_STACK])
+ as the value of SP_REGNUM before the dummy frame was pushed. These
+ two meanings would be incompatible for the 29k if we defined
+ CALL_DUMMY_LOCATION == ON_STACK (but we don't, so don't worry about it).
+ Also note that "lr1" below, while called a frame pointer
+ in the user's guide, has only one function: To determine whether
+ registers need to be filled in the function epilogue.
+
+ Consider the code:
+ < call bar>
+ loc1: . . .
+ bar: sub gr1,gr1,rsize_b
+ . . .
+ add mfp,msp,0
+ sub msp,msp,msize_b
+ . . .
+ < call foo >
+ loc2: . . .
+ foo: sub gr1,gr1,rsize_f
+ . . .
+ add mfp,msp,0
+ sub msp,msp,msize_f
+ . . .
+ loc3: < suppose the inferior stops here >
+
+ memory stack register stack
+ | | |____________|
+ | | |____loc1____|
+ +------->|___________| | | ^
+ | | ^ | | locals_b | |
+ | | | | |____________| |
+ | | | | | | | rsize_b
+ | | | msize_b | | args_to_f | |
+ | | | | |____________| |
+ | | | | |____lr1_____| V
+ | | V | |____loc2____|<----------------+
+ | +--->|___________|<---------mfp | ^ |
+ | | | ^ | | locals_f | | |
+ | | | | msize_f | |____________| | |
+ | | | | | | | | rsize_f |
+ | | | V | | args | | |
+ | | |___________|<msp |____________| | |
+ | | |_____lr1____| V |
+ | | |___garbage__| <- gr1 <----+ |
+ | | | |
+ | | | |
+ | | pc=loc3 | |
+ | | | |
+ | | | |
+ | | frame cache | |
+ | | |_________________| | |
+ | | |rsize=rsize_b | | |
+ | | |msize=msize_b | | |
+ +---|--------saved_msp | | |
+ | |frame------------------------------------|---+
+ | |pc=loc2 | |
+ | |_________________| |
+ | |rsize=rsize_f | |
+ | |msize=msize_f | |
+ +--------saved_msp | |
+ |frame------------------------------------+
+ |pc=loc3 |
+ |_________________|
+
+ So, is that sufficiently confusing? Welcome to the 29000.
+ Notes:
+ * The frame for foo uses a memory frame pointer but the frame for
+ bar does not. In the latter case the saved_msp is
+ computed by adding msize to the saved_msp of the
+ next frame.
+ * msize is in the frame cache only for high C's sake. */
+
+void read_register_stack ();
+long read_register_stack_integer ();
+\f
+#define EXTRA_FRAME_INFO \
+ CORE_ADDR saved_msp; \
+ unsigned int rsize; \
+ unsigned int msize; \
+ unsigned char flags;
+
+/* Bits for flags in EXTRA_FRAME_INFO */
+#define TRANSPARENT 0x1 /* This is a transparent frame */
+#define MFP_USED 0x2 /* A memory frame pointer is used */
+
+/* Because INIT_FRAME_PC gets passed fromleaf, that's where we init
+ not only ->pc and ->frame, but all the extra stuff, when called from
+ get_prev_frame_info, that is. */
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
+void init_extra_frame_info ();
+
+#define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci)
+void init_frame_pc ();
+
+\f
+/* FRAME_CHAIN takes a FRAME
+ and produces the frame's chain-pointer.
+
+ However, if FRAME_CHAIN_VALID returns zero,
+ it means the given frame is the outermost one and has no caller. */
+
+/* On the 29k, the nominal address of a frame is the address on the
+ register stack of the return address (the one next to the incoming
+ arguments, not down at the bottom so nominal address == stack pointer).
+
+ GDB expects "nominal address" to equal contents of FP_REGNUM,
+ at least when it comes time to create the innermost frame.
+ However, that doesn't work for us, so when creating the innermost
+ frame we set ->frame ourselves in INIT_EXTRA_FRAME_INFO. */
+
+/* These are mostly dummies for the 29k because INIT_FRAME_PC
+ sets prev->frame instead. */
+#define FRAME_CHAIN(thisframe) ((thisframe)->frame + (thisframe)->rsize)
+
+/* Determine if the frame has a 'previous' and back-traceable frame. */
+#define FRAME_IS_UNCHAINED(frame) ((frame)->flags & TRANSPARENT)
+
+/* Find the previous frame of a transparent routine.
+ * For now lets not try and trace through a transparent routine (we might
+ * have to assume that all transparent routines are traps).
+ */
+#define FIND_PREV_UNCHAINED_FRAME(frame) 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)
+
+/* Saved pc (i.e. return address). */
+#define FRAME_SAVED_PC(fraim) \
+ (read_register_stack_integer ((fraim)->frame + (fraim)->rsize, 4))
+
+/* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their
+ offsets being relative to the memory stack pointer (high C) or
+ saved_msp (gcc). */
+
+#define FRAME_LOCALS_ADDRESS(fi) frame_locals_address (fi)
+extern CORE_ADDR frame_locals_address ();
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+/* While we could go the effort of finding the tags word and getting
+ the argcount field from it,
+ (1) It only counts arguments in registers, i.e. the first 16 words
+ of arguments
+ (2) It gives the number of arguments the function was declared with
+ not how many it was called with (or some variation, like all 16
+ words for varadic functions). This makes argcount pretty much
+ redundant with -g info, even for varadic functions.
+ So don't bother. */
+#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
+
+#define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient
+ because registers get renumbered on the 29k without getting saved. */
+
+#define GET_SAVED_REGISTER
+\f
+/* Call function stuff. */
+
+/* The dummy frame looks like this (see also the general frame picture
+ above):
+
+ register stack
+
+ | | frame for function
+ | locals_sproc | executing at time
+ |________________| of call_function.
+ | | We must not disturb
+ | args_out_sproc | it.
+ memory stack |________________|
+ |____lr1_sproc___|<-+
+ | | |__retaddr_sproc_| | <-- gr1 (at start)
+ |____________|<-msp 0 <-----------mfp_dummy_____| |
+ | | (at start) | save regs | |
+ | arg_slop | | pc0,pc1 | |
+ | (16 words) | | gr96-gr124 | |
+ |____________|<-msp 1--after | sr160-sr162 | |
+ | | PUSH_DUMMY_FRAME| sr128-sr135 | |
+ | struct ret | |________________| |
+ | 17+ | | | |
+ |____________|<- lrp | args_out_dummy | |
+ | struct ret | | (16 words) | |
+ | 16 | |________________| |
+ | (16 words) | |____lr1_dummy___|--+
+ |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after
+ | | struct ret | | PUSH_DUMMY_FRAME
+ | margs17+ | area allocated | locals_inf |
+ | | |________________| called
+ |____________|<- msp 4--when | | function's
+ | | inf called | args_out_inf | frame (set up
+ | margs16 | |________________| by called
+ | (16 words) | |_____lr1_inf____| function).
+ |____________|<- msp 3--after | . |
+ | | args pushed | . |
+ | | | . |
+ | |
+
+ arg_slop: This area is so that when the call dummy adds 16 words to
+ the msp, it won't end up larger than mfp_dummy (it is needed in the
+ case where margs and struct_ret do not add up to at least 16 words).
+ struct ret: This area is allocated by GDB if the return value is more
+ than 16 words. struct ret_16 is not used on the 29k.
+ margs: Pushed by GDB. The call dummy copies the first 16 words to
+ args_out_dummy.
+ retaddr_sproc: Contains the PC at the time we call the function.
+ set by PUSH_DUMMY_FRAME and read by POP_FRAME.
+ retaddr_dummy: This points to a breakpoint instruction in the dummy. */
+\f
+/* Rsize for dummy frame, in bytes. */
+
+/* Bytes for outgoing args, lr1, and retaddr. */
+#define DUMMY_ARG (2 * 4 + 16 * 4)
+
+/* Number of special registers (sr128-) to save. */
+#define DUMMY_SAVE_SR128 8
+/* Number of special registers (sr160-) to save. */
+#define DUMMY_SAVE_SR160 3
+/* Number of general (gr96- or gr64-) registers to save. */
+#define DUMMY_SAVE_GREGS 29
+
+#define DUMMY_FRAME_RSIZE \
+(4 /* mfp_dummy */ \
+ + 2 * 4 /* pc0, pc1 */ \
+ + DUMMY_SAVE_GREGS * 4 \
+ + DUMMY_SAVE_SR160 * 4 \
+ + DUMMY_SAVE_SR128 * 4 \
+ + DUMMY_ARG \
+ + 4 /* pad to doubleword */ )
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME push_dummy_frame()
+extern void push_dummy_frame ();
+
+/* Discard from the stack the innermost frame,
+ restoring all saved registers. */
+
+#define POP_FRAME pop_frame()
+extern void pop_frame ();
+
+/* This sequence of words is the instructions
+ mtsrim cr, 15
+ loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
+ add msp, msp, 16 * 4 ; point to the remaining arguments
+ CONST_INSN:
+ const lr0,inf ; (replaced by half of target addr)
+ consth lr0,inf ; (replaced by other half of target addr)
+ calli lr0, lr0
+ aseq 0x40,gr1,gr1 ; nop
+ BREAKPT_INSN:
+ asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn)
+ */
+
+#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
+#define BS(const) const
+#else
+#define BS(const) (((const) & 0xff) << 24) | \
+ (((const) & 0xff00) << 8) | \
+ (((const) & 0xff0000) >> 8) | \
+ (((const) & 0xff000000) >> 24)
+#endif
+
+/* Position of the "const" and blkt instructions within CALL_DUMMY in bytes. */
+#define CONST_INSN (3 * 4)
+#define BREAKPT_INSN (7 * 4)
+#define CALL_DUMMY { \
+ BS(0x0400870f),\
+ BS(0x36008200|(MSP_HW_REGNUM)), \
+ BS(0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16)), \
+ BS(0x03ff80ff), \
+ BS(0x02ff80ff), \
+ BS(0xc8008080), \
+ BS(0x70400101), \
+ BS(0x72500101)}
+#define CALL_DUMMY_LENGTH (8 * 4)
+
+#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
+
+/* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a
+ word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with
+ bits 0-7 and 8-15 of DATA (which is in host byte order). */
+
+#if TARGET_BYTE_ORDER == BIG_ENDIAN
+#define STUFF_I16(WORDP, DATA) \
+ { \
+ *((char *)(WORDP) + 3) = ((DATA) & 0xff);\
+ *((char *)(WORDP) + 1) = (((DATA) >> 8) & 0xff);\
+ }
+#else /* Target is little endian. */
+#define STUFF_I16(WORDP, DATA) \
+ {
+ *(char *)(WORDP) = ((DATA) & 0xff);
+ *((char *)(WORDP) + 2) = (((DATA) >> 8) & 0xff);
+ }
+#endif /* Target is little endian. */
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+/* Currently this stuffs in the address of the function that we are calling.
+ Since different 29k systems use different breakpoint instructions, it
+ also stuffs BREAKPOINT in the right place (to avoid having to
+ duplicate CALL_DUMMY in each tm-*.h file). */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+ {\
+ STUFF_I16((char *)dummyname + CONST_INSN, fun); \
+ STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \
+ /* FIXME memcpy ((char *)(dummyname) + BREAKPT_INSN, break_insn, 4); */ \
+ }
+
+/* 29k architecture has separate data & instruction memories -- wired to
+ different pins on the chip -- and can't execute the data memory.
+ Also, there should be space after text_end;
+ we won't get a SIGSEGV or scribble on data space. */
+
+#define CALL_DUMMY_LOCATION AFTER_TEXT_END
+
+/* Because of this, we need (as a kludge) to know the addresses of the
+ text section. */
+
+#define NEED_TEXT_START_END
+
+/* How to translate register numbers in the .stab's into gdb's internal register
+ numbers. We don't translate them, but we warn if an invalid register
+ number is seen. Note that FIXME, we use the value "sym" as an implicit
+ argument in printing the error message. It happens to be available where
+ this macro is used. (This macro definition appeared in a late revision
+ of gdb-3.91.6 and is not well tested. Also, it should be a "complaint".) */
+
+#define STAB_REG_TO_REGNUM(num) \
+ (((num) > LR0_REGNUM + 127) \
+ ? fprintf(stderr, \
+ "Invalid register number %d in symbol table entry for %s\n", \
+ (num), SYMBOL_SOURCE_NAME (sym)), (num) \
+ : (num))
--- /dev/null
+/* Parameters for NYU Ultracomputer 29000 target, for GDB, the GNU debugger.
+ Copyright 1990, 1991 Free Software Foundation, Inc.
+ Contributed by David Wood @ New York University (wood@nyu.edu).
+
+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 includes tm-29k.h, but predefines REGISTER_NAMES and
+ related macros. The file supports a 29k running our flavor of
+ Unix on our Ultra3 PE Boards. */
+
+/* Byte order is configurable, but this machine runs big-endian. */
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer.
+ */
+#define NUM_REGS (EXO_REGNUM + 1)
+
+#define REGISTER_NAMES { \
+ "gr1", \
+ "gr64", "gr65", "gr66", "gr67", "gr68", "gr69", "gr70", "gr71", "gr72", \
+ "gr73", "gr74", "gr75", "gr76", "gr77", "gr78", "gr79", "gr80", "gr81", \
+ "gr82", "gr83", "gr84", "gr85", "gr86", "gr87", "gr88", "gr89", "gr90", \
+ "gr91", "gr92", "gr93", "gr94", "gr95", \
+ "gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \
+ "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \
+ "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \
+ "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \
+ "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \
+ "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \
+ "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \
+ "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \
+ "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \
+ "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \
+ "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \
+ "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \
+ "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \
+ "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \
+ "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \
+ "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \
+ "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \
+ "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \
+ "lr124", "lr125", "lr126", "lr127", \
+ "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \
+ "pc0", "pc1", "pc2", "mmu", "lru", \
+ "ipc", "ipa", "ipb", "q", "alu", "bp", "fc", "cr", \
+ "fpe", "int", "fps", "exo" }
+
+
+#ifdef KERNEL_DEBUGGING
+# define PADDR_U_REGNUM 22 /* gr86 */
+# define RETURN_REGNUM GR64_REGNUM
+#else
+# define RETURN_REGNUM GR96_REGNUM
+#endif /* KERNEL_DEBUGGING */
+
+
+/* Should rename all GR96_REGNUM to RETURN_REGNUM */
+#define GR1_REGNUM (0)
+#define GR64_REGNUM 1
+#define GR96_REGNUM (GR64_REGNUM + 32)
+/* This needs to be the memory stack pointer, not the register stack pointer,
+ to make call_function work right. */
+#define SP_REGNUM MSP_REGNUM
+
+#define FP_REGNUM (LR0_REGNUM + 1) /* lr1 */
+/* Large Return Pointer */
+#define LRP_REGNUM (123 - 96 + RETURN_REGNUM)
+/* Static link pointer */
+#define SLP_REGNUM (124 - 96 + RETURN_REGNUM)
+/* Memory Stack Pointer. */
+#define MSP_REGNUM (125 - 96 + RETURN_REGNUM)
+/* Register allocate bound. */
+#define RAB_REGNUM (126 - 96 + RETURN_REGNUM)
+/* Register Free Bound. */
+#define RFB_REGNUM (127 - 96 + RETURN_REGNUM)
+/* Register Stack Pointer. */
+#define RSP_REGNUM GR1_REGNUM
+#define LR0_REGNUM ( 32 + GR96_REGNUM)
+
+/* Protected Special registers */
+#define VAB_REGNUM (LR0_REGNUM + 128)
+#define OPS_REGNUM (VAB_REGNUM + 1)
+#define CPS_REGNUM (VAB_REGNUM + 2)
+#define CFG_REGNUM (VAB_REGNUM + 3)
+#define CHA_REGNUM (VAB_REGNUM + 4)
+#define CHD_REGNUM (VAB_REGNUM + 5)
+#define CHC_REGNUM (VAB_REGNUM + 6)
+#define RBP_REGNUM (VAB_REGNUM + 7)
+#define TMC_REGNUM (VAB_REGNUM + 8)
+#define TMR_REGNUM (VAB_REGNUM + 9)
+#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
+#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
+#define PC2_REGNUM (VAB_REGNUM + 12) /* pc2 */
+#define MMU_REGNUM (VAB_REGNUM + 13)
+#define LRU_REGNUM (VAB_REGNUM + 14)
+ /* Register sequence gap */
+/* Unprotected Special registers */
+#define IPC_REGNUM (LRU_REGNUM + 1)
+#define IPA_REGNUM (IPC_REGNUM + 1)
+#define IPB_REGNUM (IPC_REGNUM + 2)
+#define Q_REGNUM (IPC_REGNUM + 3)
+#define ALU_REGNUM (IPC_REGNUM + 4)
+#define PS_REGNUM ALU_REGNUM
+#define BP_REGNUM (IPC_REGNUM + 5)
+#define FC_REGNUM (IPC_REGNUM + 6)
+#define CR_REGNUM (IPC_REGNUM + 7)
+ /* Register sequence gap */
+#define FPE_REGNUM (CR_REGNUM + 1)
+#define INT_REGNUM (FPE_REGNUM + 1)
+#define FPS_REGNUM (FPE_REGNUM + 2)
+ /* Register sequence gap */
+#define EXO_REGNUM (FPS_REGNUM + 1)
+
+/* Special register #x. */
+#define SR_REGNUM(x) \
+ ((x) < 15 ? VAB_REGNUM + (x) \
+ : (x) >= 128 && (x) < 136 ? IPC_REGNUM + (x-128) \
+ : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x-160) \
+ : (x) == 164 ? EXO_REGNUM \
+ : (error ("Internal error in SR_REGNUM"), 0))
+
+#ifndef KERNEL_DEBUGGING
+/*
+ * This macro defines the register numbers (from REGISTER_NAMES) that
+ * are effectively unavailable to the user through ptrace(). It allows
+ * us to include the whole register set in REGISTER_NAMES (inorder to
+ * better support remote debugging). If it is used in
+ * fetch/store_inferior_registers() gdb will not complain about I/O errors
+ * on fetching these registers. If all registers in REGISTER_NAMES
+ * are available, then return false (0).
+ */
+#define CANNOT_STORE_REGISTER(regno) \
+ (((regno)>=GR64_REGNUM && (regno)<GR64_REGNUM+32) || \
+ ((regno)==VAB_REGNUM) || \
+ ((regno)==OPS_REGNUM) || \
+ ((regno)>=CFG_REGNUM && (regno)<=TMR_REGNUM) || \
+ ((regno)==MMU_REGNUM) || \
+ ((regno)==LRU_REGNUM) || \
+ ((regno)>=ALU_REGNUM) || \
+ ((regno)==CR_REGNUM) || \
+ ((regno)==EXO_REGNUM))
+#define CANNOT_FETCH_REGISTER(regno) CANNOT_STORE_REGISTER(regno)
+#endif /* KERNEL_DEBUGGING */
+
+/*
+ * Converts an sdb register number to an internal gdb register number.
+ * Currently under gcc, gr96->0...gr128->31...lr0->32...lr127->159, or...
+ * gr64->0...gr95->31, lr0->32...lr127->159.
+ */
+#define SDB_REG_TO_REGNUM(value) (((value)<32) ? ((value)+RETURN_REGNUM) : \
+ ((value)-32+LR0_REGNUM))
+
+#ifdef KERNEL_DEBUGGING
+ /* ublock virtual address as defined in our sys/param.h */
+ /* FIXME: Should get this from sys/param.h */
+# define UVADDR ((32*0x100000)-8192)
+#endif
+
+/*
+ * Are we in sigtramp(), needed in infrun.c. Specific to ultra3, because
+ * we take off the leading '_'.
+ */
+#if !defined(KERNEL_DEBUGGING)
+#ifdef SYM1
+# define IN_SIGTRAMP(pc, name) (name && STREQ ("sigtramp", name))
+#else
+ Need to define IN_SIGTRAMP() for sym2.
+#endif
+#endif /* !KERNEL_DEBUGGING */
+
+#include "a29k/tm-29k.h"
+
+/**** The following are definitions that override those in tm-29k.h ****/
+
+/* This sequence of words is the instructions
+ mtsrim cr, 15
+ loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
+ add msp, msp, 16 * 4 ; point to the remaining arguments
+ CONST_INSN:
+ const gr96,inf
+ consth gr96,inf
+ calli lr0, gr96
+ aseq 0x40,gr1,gr1 ; nop
+ asneq 0x50,gr1,gr1 ; breakpoint
+ When KERNEL_DEBUGGIN is defined, msp -> gr93, gr96 -> gr64,
+ 7d -> 5d, 60 -> 40
+ */
+
+/* Position of the "const" instruction within CALL_DUMMY in bytes. */
+#undef CALL_DUMMY
+#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
+#ifdef KERNEL_DEBUGGING /* gr96 -> gr64 */
+# define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff, \
+ 0x02ff40ff, 0xc8008040, 0x70400101, 0x72500101}
+#else
+# define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \
+ 0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101}
+#endif /* KERNEL_DEBUGGING */
+#else /* Byte order differs. */
+ you lose
+#endif /* Byte order differs. */
+
+#if !defined(KERNEL_DEBUGGING)
+# ifdef SYM1
+# undef DECR_PC_AFTER_BREAK
+# define DECR_PC_AFTER_BREAK 0 /* Sym1 kernel does the decrement */
+# else
+ ->"ULTRA3 running other than sym1 OS"!;
+# endif
+#endif /* !KERNEL_DEBUGGING */
+
--- /dev/null
+# Host: NYU Ultracomputer (AMD 29000 running Unix)
+CC=u3cc
+MUNCH_DEFINE="MUNCH_NM=u3nm"
+XDEPFILES= ultra3-xdep.o
+XM_FILE= xm-ultra3.h
+NAT_FILE= nm-ultra3.h
+NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o ultra3-nat.o
+MH_CFLAGS = -DSYM1
+XM_CLIBS = -lsysv -ljobs -ltermlib
--- /dev/null
+# Target: AMD 29000 running Unix on New York Univerisity processor board.
+TDEPFILES= am29k-pinsn.o am29k-tdep.o
+TM_FILE= tm-ultra3.h
+# SYM1 is some OS they have.
+MT_CFLAGS = -DSYM1
--- /dev/null
+/* Host definitions for GDB running on a 29k NYU Ultracomputer
+ Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
+ Contributed by David Wood (wood@lab.ultra.nyu.edu).
+
+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. */
+
+/* Here at NYU we have what we call an ULTRA3 PE board. So
+ ifdefs for ULTRA3 are my doing. At this point in time,
+ I don't know of any other Unixi running on the 29k. */
+
+#define HOST_BYTE_ORDER BIG_ENDIAN
+
+#define HAVE_WAIT_STRUCT
+
+#ifndef L_SET
+# define L_SET 0 /* set the seek pointer */
+# define L_INCR 1 /* increment the seek pointer */
+# define L_XTND 2 /* extend the file size */
+#endif
+
+#ifndef O_RDONLY
+# define O_RDONLY 0
+# define O_WRONLY 1
+# define O_RDWR 2
+#endif
+
+#ifndef F_OK
+# define R_OK 4
+# define W_OK 2
+# define X_OK 1
+# define F_OK 0
+#endif
+
+/* Get rid of any system-imposed stack limit if possible */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* System doesn't provide siginterrupt(). */
+#define NO_SIGINTERRUPT
+
+/* System uses a `short' to hold a process group ID. */
+#define SHORT_PGRP
--- /dev/null
+# Host: Acorn RISC machine running RISCiX (4.3bsd)
+XDEPFILES= infptrace.o inftarg.o fork-child.o arm-xdep.o arm-convert.o
+XM_FILE= xm-arm.h
--- /dev/null
+# Target: Acorn RISC machine running RISCiX (4.3bsd)
+TDEPFILES= arm-tdep.o arm-pinsn.o
+TM_FILE= tm-arm.h
--- /dev/null
+/* Definitions to make GDB run on an ARM under RISCiX (4.3bsd).
+ 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 LITTLE_ENDIAN
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* 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 (0x01000000 - (UPAGES * NBPG))
+
+/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
+#define FETCH_INFERIOR_REGISTERS
+
+\f
+#if 0
+/* 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, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
+ 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 0, 0}
+
+/* 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 ("pushl fp");
+
+/* 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 ("pushl 8(sp)"); \
+ asm ("pushl 8(sp)"); \
+ asm ("pushal 0x14(sp)"); \
+ asm ("pushr $037777"); }
+
+/* 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 ("popr $037777"); \
+ asm ("subl2 $8,(sp)"); \
+ asm ("movl (sp),sp"); \
+ asm ("rei"); }
+#endif /* 0 */
--- /dev/null
+# Target: H8300 with HMS monitor and H8 simulator
+TDEPFILES= exec.o h8300-tdep.o remote-hms.o remote-sim.o ../sim/h8300/code.o ../sim/h8300/perifs.o
+TM_FILE= tm-h8300.h
--- /dev/null
+/* Parameters for execution on a H8/300 series machine.
+ Copyright 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. */
+
+/* Contributed by Steve Chamberlain sac@cygnus.com */
+
+
+#define UNSIGNED_SHORT(X) ((X) & 0xffff)
+
+
+#define EXTRA_FRAME_INFO \
+ struct frame_saved_regs *fsr; \
+ CORE_ADDR from_pc; \
+ CORE_ADDR args_pointer;\
+ CORE_ADDR locals_pointer ;
+
+
+
+/* Zero the frame_saved_regs pointer when the frame is initialized,
+ so that FRAME_FIND_SAVED_REGS () will know to allocate and
+ initialize a frame_saved_regs struct the first time it is called.
+ Set the arg_pointer to -1, which is not valid; 0 and other values
+ indicate real, cached values. */
+
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
+ init_extra_frame_info (fromleaf, fi)
+
+extern void init_extra_frame_info ();
+
+
+#define IEEE_FLOAT
+/* Define the bit, byte, and word ordering of the machine. */
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+#undef TARGET_INT_BIT
+#define TARGET_INT_BIT 16
+#undef TARGET_PTR_BIT
+#define TARGET_PTR_BIT 16
+
+
+/* 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. */
+
+
+#define SKIP_PROLOGUE(ip) {(ip) = h8300_skip_prologue(ip);}
+extern CORE_ADDR h8300_skip_prologue ();
+
+
+/* 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) \
+UNSIGNED_SHORT(read_memory_integer (read_register (SP_REGNUM), 2))
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+
+#define BREAKPOINT {0x53, 0x00}
+
+
+/* If your kernel resets the pc after the trap happens you may need to
+ define this before including this file. */
+
+
+#define DECR_PC_AFTER_BREAK 0
+
+
+/* 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 unsigned short
+
+/*# define NUM_REGS 20 /* 20 for fake HW support */
+# define NUM_REGS 11
+# define REGISTER_BYTES (NUM_REGS*2)
+
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) ((N) * 2)
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. On the H8/300, all regs are 2 bytes. */
+
+#define REGISTER_RAW_SIZE(N) 2
+
+/* Number of bytes of storage in the program's representation
+ for register N. On the H8/300, all regs are 2 bytes. */
+
+#define REGISTER_VIRTUAL_SIZE(N) 2
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 2
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+
+#define MAX_REGISTER_VIRTUAL_SIZE 2
+
+/* Nonzero if register N requires conversion
+ from raw format to virtual format. */
+
+#define REGISTER_CONVERTIBLE(N) 1
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+/*#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) */
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+/*#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) */
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) builtin_type_unsigned_short
+
+
+/* Initializer for an array of names of registers.
+ Entries beyond the first NUM_REGS are ignored. */
+
+#if NUM_REGS==20
+#define REGISTER_NAMES \
+ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp",\
+ "ccr","pc","cycles","hcheck","tier","tcsr","frc",\
+ "ocra","ocrb","tcr","tocr","icra"}
+#else
+#define REGISTER_NAMES \
+ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "ccr","pc","cycles"}
+#endif
+
+/* 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 FP_REGNUM 6 /* Contains address of executing stack frame */
+#define SP_REGNUM 7 /* Contains address of top of stack */
+#define CCR_REGNUM 8 /* Contains processor status */
+#define PC_REGNUM 9 /* Contains program counter */
+
+/* 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 (0, (ADDR)); abort(); }*/
+
+/* 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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy ((char *)(REGBUF), VALBUF, TYPE_LENGTH(TYPE))
+
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. Assumes floats are passed
+ in d0/d1. */
+
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+
+
+/* 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))
+\f
+/* 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.
+
+ However, if FRAME_CHAIN_VALID returns zero,
+ it means the given frame is the outermost one and has no caller. */
+
+/* In the case of the H8/300, the frame's nominal address
+ is the address of a 2-byte word containing the calling frame's address. */
+
+/* Use the alternate method of avoiding running up off the end of
+ the frame chain or following frames back into the startup code.
+ See the comments in objfile.h */
+
+#define FRAME_CHAIN_VALID_ALTERNATE
+
+/* 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)
+
+/* Any function with a frame looks like this
+ SECOND ARG
+ FIRST ARG
+ RET PC
+ SAVED R2
+ SAVED R3
+ SAVED FP <-FP POINTS HERE
+ LOCALS0
+ LOCALS1 <-SP POINTS HERE
+
+ */
+#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
+
+#define FRAME_ARGS_ADDRESS(fi) frame_args_address(fi)
+
+#define FRAME_LOCALS_ADDRESS(fi) frame_locals_address(fi);
+
+/* 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. */
+
+#define FRAME_NUM_ARGS(val,fi) (val = -1)
+
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* 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) \
+ frame_find_saved_regs(frame_info, &(frame_saved_regs))
+\f
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+/*#define PUSH_DUMMY_FRAME { h8300_push_dummy_frame (); }*/
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME { h8300_pop_frame (); }
+
+#define SHORT_INT_MAX 32767
+#define SHORT_INT_MIN -32768
+
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+{ memcpy((TO), (FROM), 2); }
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+{ memcpy((TO), (FROM), 2); }
+
+#define BEFORE_MAIN_LOOP_HOOK \
+ hms_before_main_loop();
+
+typedef unsigned short INSN_WORD;
+
+#define ADDR_BITS_REMOVE(addr) ((addr) & 0xffff)
+#define ADDR_BITS_SET(addr) (((addr)))
+
+#define read_memory_short(x) (read_memory_integer(x,2) & 0xffff)
+#define DONT_USE_REMOTE
+
+
+#define PRINT_REGISTER_HOOK(regno) print_register_hook(regno)
+
--- /dev/null
+# Target: H8500 with HMS monitor and H8 simulator
+TDEPFILES= exec.o h8500-tdep.o remote-hms.o remote-sim.o ../sim/h8500/compile.o
+TM_FILE= tm-h8500.h
--- /dev/null
+/* Parameters for execution on a H8/500 series machine.
+ Copyright (C) 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. */
+
+/* Contributed by Steve Chamberlain sac@cygnus.com */
+
+
+
+#define IEEE_FLOAT 1
+
+/* Define the bit, byte, and word ordering of the machine. */
+
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+#undef TARGET_INT_BIT
+#define TARGET_INT_BIT 16
+
+#undef TARGET_PTR_BIT
+#define TARGET_PTR_BIT (minimum_mode ? 16 : 32)
+
+
+/* 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. */
+
+#define SKIP_PROLOGUE(ip) {(ip) = h8500_skip_prologue(ip);}
+extern CORE_ADDR h8500_skip_prologue ();
+
+
+/* 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) saved_pc_after_call(frame)
+
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Illegal instruction - used by the simulator for breakpoint
+ detection */
+#define BREAKPOINT {0x0b}
+
+
+/* If your kernel resets the pc after the trap happens you may need to
+ define this before including this file. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+
+/* Nonzero if instruction at PC is a return instruction. */
+
+#define ABOUT_TO_RETURN(pc) about_to_return(pc)
+
+/* 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 unsigned long
+
+/* Say how much memory is needed to store a copy of the register set */
+
+#define REGISTER_BYTES ((NUM_REGS)*4)
+
+/* 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. */
+
+#define REGISTER_RAW_SIZE(N) register_raw_size(N)
+
+#define REGISTER_VIRTUAL_SIZE(N) register_virtual_size(N)
+
+/* 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) 1
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+ register_convert_to_virtual(REGNUM, FROM, TO)
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ register_convert_to_raw(REGNUM, FROM, TO)
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+struct type *register_virtual_type();
+
+#define REGISTER_VIRTUAL_TYPE(N) register_virtual_type(N)
+
+
+/* Initializer for an array of names of registers.
+ Entries beyond the first NUM_REGS are ignored. */
+
+#define REGISTER_NAMES \
+ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "pr0", "pr1","pr2","pr3","pr4","pr5","pr6","pr7", \
+ "ccr","pc", \
+ "cp","dp","ep","tp" }
+
+/* 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 R0 0
+#define R1 1
+#define R2 2
+#define R3 3
+#define R4 4
+#define R5 5
+#define R6 6
+#define R7 7
+
+#define PR0 8 /* R0-R7 with seg prefixed */
+#define PR1 9
+#define PR2 10
+#define PR3 11
+#define PR4 12
+#define PR5 13
+#define PR6 14
+#define PR7 15
+
+#define SP_REGNUM PR7 /* Contains address of top of stack */
+#define FP_REGNUM PR6 /* Contains address of executing stack frame */
+
+#define CCR_REGNUM 16 /* Contains processor status */
+#define PC_REGNUM 17 /* Contains program counter */
+
+#define SEG_C 18 /* Segment registers */
+#define SEG_D 19
+#define SEG_E 20
+#define SEG_T 21
+
+#define NUM_REGS 22
+
+#define PTR_SIZE (minimum_mode ? 2: 4)
+#define PTR_MASK (minimum_mode ? 0x0000ffff : 0x00ffffff)
+
+/* 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 (0, (ADDR)); abort(); }*/
+
+/* 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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy ((char *)(REGBUF), VALBUF, TYPE_LENGTH(TYPE))
+
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. Assumes floats are passed
+ in d0/d1. */
+
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+
+
+/* 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))
+\f
+
+/* 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)
+
+/* Any function with a frame looks like this
+ SECOND ARG
+ FIRST ARG
+ RET PC
+ SAVED R2
+ SAVED R3
+ SAVED FP <-FP POINTS HERE
+ LOCALS0
+ LOCALS1 <-SP POINTS HERE
+
+ */
+#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
+
+#define FRAME_ARGS_ADDRESS(fi) frame_args_address(fi)
+
+#define FRAME_LOCALS_ADDRESS(fi) frame_locals_address(fi);
+
+/* 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. */
+
+#define FRAME_NUM_ARGS(val,fi) (val = -1)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* 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) \
+ frame_find_saved_regs(frame_info, &(frame_saved_regs))
+\f
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+/*#define PUSH_DUMMY_FRAME { h8300_push_dummy_frame (); }*/
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME { h8300_pop_frame (); }
+
+#define SHORT_INT_MAX 32767
+#define SHORT_INT_MIN -32768
+
+
+
+#define BEFORE_MAIN_LOOP_HOOK \
+ hms_before_main_loop();
+
+
+#define NAMES_HAVE_UNDERSCORE
+
+typedef unsigned short INSN_WORD;
+
+#define ADDR_BITS_REMOVE(addr) ((addr) & 0xffffff)
+#define ADDR_BITS_SET(addr) (((addr)))
+
+#define read_memory_short(x) (read_memory_integer(x,2) & 0xffff)
+#define DONT_USE_REMOTE
+
+
+#define PRINT_REGISTER_HOOK(regno) print_register_hook(regno)
+
+
+int minimum_mode;
+
+#define CALL_DUMMY_LENGTH 10
--- /dev/null
+# Target: Intel 386 with a.out
+
+TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
+TM_FILE= tm-i386v.h
--- /dev/null
+# Host: Intel 386 running 386BSD
+XDEPFILES= ser-bsd.o
+NATDEPFILES= exec.o fork-child.o infptrace.o inftarg.o corelow.o coredep.o i386b-nat.o
+XM_FILE= xm-i386bsd.h
+NAT_FILE= nm-i386bsd.h
+REGEX=regex.o
+REGEX1=regex.o
--- /dev/null
+# Target: Intel 386 running BSD
+TDEPFILES= i386-tdep.o i386-pinsn.o
+TM_FILE= tm-i386bsd.h
--- /dev/null
+# Host: Intel 386 running Mach
+
+XDEPFILES=
+XM_FILE= xm-i386mach.h
+NAT_FILE= nm-i386mach.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o
--- /dev/null
+# Host: Intel 386 running SCO Unix (pre-SVR4)
+XDEPFILES= i387-tdep.o
+XM_FILE= xm-i386sco.h
+NAT_FILE= nm-i386sco.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o i386v-nat.o
+XM_CLIBS= -lPW
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
+#msg The SCO C compiler cannot parse symtab.h when value.h has been included.
+#msg This is a bug in the compiler; the code is valid.
+#msg Therefore, you must use GCC to compile GDB on SCO machines.
+CC=gcc -D_POSIX_SOURCE=1
--- /dev/null
+# Host: Intel 386 running SCO Unix 3.2v4
+XDEPFILES= i387-tdep.o
+XM_FILE= xm-i386sco.h
+NAT_FILE= nm-i386sco4.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o i386v-nat.o
+XM_CLIBS= -lPW
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
+# The cc compiler mishandles const in cases like
+# struct type ** const (c_builtin_types[]) =
+MH_CFLAGS=-Dconst=
+# The cc compiler sometimes produces debugging output that nm can not
+# parse. Passing -p to nm makes it not even try, and allows munch to
+# work.
+MUNCH_DEFINE=-p
--- /dev/null
+# Host: Intel 386 running Solaris 2 (SVR4).
+
+# Solaris-2 makes `install' optional in the Berkeley compatability pkg.
+# cp will do fine.
+INSTALL = cp
+
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
+
+# Need to compile and link in support for SVR4's /proc and i386 host dependent
+# routines.
+XDEPFILES=
+
+# Use the i386 SVR4 host configuration file.
+XM_FILE= xm-i386v4.h
+
+NAT_FILE= nm-i386v4.h
+NATDEPFILES= corelow.o exec.o procfs.o fork-child.o i386v4-nat.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
--- /dev/null
+# Target: Intel 386 running SVR4
+TDEPFILES= i386-pinsn.o i386-tdep.o i387-tdep.o solib.o
+TM_FILE= tm-i386v4.h
--- /dev/null
+# Host: Intel 386 running System V
+XDEPFILES=
+XM_FILE= xm-i386v.h
+NAT_FILE= nm-i386v.h
+NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o coredep.o corelow.o i386v-nat.o
+XM_CLIBS= -lPW
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
--- /dev/null
+# Target: Intel 386 running System V
+TDEPFILES= exec.o i386-tdep.o i386-pinsn.o i387-tdep.o
+TM_FILE= tm-i386v.h
--- /dev/null
+# Host: Intel 386 running System V release 3.2
+XDEPFILES=
+XM_FILE= xm-i386v32.h
+NAT_FILE= nm-i386v.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o i386v-nat.o
+XM_CLIBS= -lPW
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
--- /dev/null
+# Host: Intel 386 running SVR4.
+
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
+
+# Need to compile and link in support for SVR4's /proc and i386 host dependent
+# routines.
+XDEPFILES=
+
+# Use the i386 SVR4 host configuration file.
+XM_FILE= xm-i386v4.h
+
+NAT_FILE= nm-i386v4.h
+NATDEPFILES= corelow.o exec.o procfs.o fork-child.o i386v4-nat.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
--- /dev/null
+# Target: Intel 386 running SVR4
+TDEPFILES= i386-pinsn.o i386-tdep.o i387-tdep.o solib.o
+TM_FILE= tm-i386v4.h
--- /dev/null
+# Target: Intel 386 with a.out
+TDEPFILES= i386-tdep.o i386-pinsn.o i387-tdep.o
+TM_FILE= tm-linux.h
--- /dev/null
+# Host: Intel 386 running SVR4.
+
+# The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
+# This compiler not only emits obnoxious copyright messages every time
+# you run it, but it chokes and dies on a whole bunch of GNU source
+# files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
+# Unfortunately though, the AT&T compiler sometimes generates code that
+# the assembler barfs on if -g is used, so disable it by default as well.
+CC = /usr/ccs/ATT/cc
+CFLAGS =
+
+SYSV_DEFINE=-DSYSV
+REGEX=regex.o
+REGEX1=regex.o
+
+# Need to compile and link in support for SVR4's /proc and i386 host dependent
+# routines.
+XDEPFILES=
+
+# Use the i386 SVR4 host configuration file.
+XM_FILE= xm-i386v4.h
+
+NAT_FILE= nm-i386v4.h
+NATDEPFILES= corelow.o exec.o procfs.o fork-child.o i386v4-nat.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
+
+# The /usr/ucb/install program is incompatible (complains about unknown
+# group staff). Use good old cp...
+INSTALL = cp
--- /dev/null
+# Target: Intel 386 running SVR4
+TDEPFILES= i386-pinsn.o i386-tdep.o i387-tdep.o solib.o
+TM_FILE= tm-i386v4.h
--- /dev/null
+/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
+ Copyright 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. */
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+
+#include <machine/vmparam.h>
+#define KERNEL_U_ADDR USRSTACK
+
+#undef FLOAT_INFO /* No float info yet */
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = i386_register_u_addr ((blockend),(regno));
+
+extern int
+i386_register_u_addr PARAMS ((int, int));
+
+#define PTRACE_ARG3_TYPE char*
--- /dev/null
+/* Native definitions for Mach on an Intel 386
+ Copyright (C) 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 1 */
+
+/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
+#define FETCH_INFERIOR_REGISTERS
+
--- /dev/null
+/* Native support for i386.
+ Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
+
+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 0
+/* code to execute to print interesting information about the
+ floating point processor (if any)
+ No need to define if there is nothing to do.
+ On the 386, unfortunately this code is host-dependent (and lives
+ in the i386-xdep.c file), so we can't
+ do this unless we *know* we aren't cross-debugging. FIXME.
+ */
+#define FLOAT_INFO { i386_float_info (); }
+#endif /*0*/
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = i386_register_u_addr ((blockend),(regno));
+
+extern int
+i386_register_u_addr PARAMS ((int, int));
+
+/*
+ * SysV doesn't always have a <ptrace.h> or <sys/ptrace.h> file
+ * (why, I don't know), and we don't need it.
+ */
+#define NO_PTRACE_H
--- /dev/null
+/* Native support for SCO 3.2v4.
+ Copyright 1993 Free Software Foundation, Inc.
+ Contributed by Cygnus Support. By Ian Lance Taylor
+ <ian@cygnus.com> based on work by Martin Walker <maw@netcom.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. */
+
+/* SCO 3.2v4 is actually just like SCO 3.2v2, except that it
+ additionally supports attaching to a process. */
+
+#include "i386/nm-i386sco.h"
+
+#define ATTACH_DETACH
+
+/* SCO, in its wisdom, does not provide <sys/ptrace.h>. infptrace.c
+ does not have defaults for these values. */
+#define PTRACE_ATTACH 10
+#define PTRACE_DETACH 11
--- /dev/null
+/* Native support for i386.
+ Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
+
+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 0
+/* code to execute to print interesting information about the
+ floating point processor (if any)
+ No need to define if there is nothing to do.
+ On the 386, unfortunately this code is host-dependent (and lives
+ in the i386-xdep.c file), so we can't
+ do this unless we *know* we aren't cross-debugging. FIXME.
+ */
+#define FLOAT_INFO { i386_float_info (); }
+#endif /*0*/
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = i386_register_u_addr ((blockend),(regno));
+
+extern int
+i386_register_u_addr PARAMS ((int, int));
--- /dev/null
+/* Native support for i386 running SVR4.
+ Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
+
+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. */
+
--- /dev/null
+/* Native support for Sun 386i, 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
+
--- /dev/null
+# Host: Sun 386i
+XDEPFILES=
+XM_FILE= xm-sun386.h
+NAT_FILE= nm-sun386.h
+NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o sun386-nat.o
--- /dev/null
+# Target: Sun 386i target configuration file.
+TDEPFILES= i386-pinsn.o solib.o
+TM_FILE= tm-sun386.h
--- /dev/null
+# Host: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
+XDEPFILES= infptrace.o inftarg.o fork-child.o symm-xdep.o
+XM_FILE= xm-symmetry.h
--- /dev/null
+# Target: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
+TDEPFILES= symm-tdep.o i386-pinsn.o
+TM_FILE= tm-symmetry.h
--- /dev/null
+/* Macro definitions for i386 running under BSD Unix.
+ 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. */
+
+/* Override number of expected traps from sysv. */
+#define START_INFERIOR_TRAPS_EXPECTED 2
+
+/* Most definitions from sysv could be used. */
+#include "i386/tm-i386v.h"
+
+/* 386BSD cannot handle the segment registers. */
+#undef NUM_REGS
+#define NUM_REGS 11
--- /dev/null
+/* Macro definitions for i386, Unix System V.
+ 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. */
+
+#if !defined (TM_I386V_H)
+#define TM_I386V_H 1
+
+/*
+ * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
+ * July 1988
+ */
+
+#define TARGET_BYTE_ORDER LITTLE_ENDIAN
+
+/* turn this on when rest of gdb is ready */
+#define IEEE_FLOAT
+
+/* 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.
+ */
+#ifndef START_INFERIOR_TRAPS_EXPECTED
+#define START_INFERIOR_TRAPS_EXPECTED 4
+#endif
+
+/* 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. */
+
+#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
+
+extern int
+i386_skip_prologue PARAMS ((int));
+
+/* 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))
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR 0x80000000
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0xcc}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#ifndef DECR_PC_AFTER_BREAK
+#define DECR_PC_AFTER_BREAK 1
+#endif
+
+/* Nonzero if instruction at PC is a return instruction. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
+
+/* Return 1 if P points to an invalid floating point value.
+ LEN is the length in bytes -- not relevant on the 386. */
+
+#define INVALID_FLOAT(p, len) (0)
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 16
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+/* the order of the first 8 registers must match the compiler's
+ * numbering scheme (which is the same as the 386 scheme)
+ * also, this table must match regmap in i386-pinsn.c.
+ */
+#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
+ "esp", "ebp", "esi", "edi", \
+ "eip", "ps", "cs", "ss", \
+ "ds", "es", "fs", "gs", \
+ }
+
+/* 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 FP_REGNUM 5 /* Contains address of executing stack frame */
+#define SP_REGNUM 4 /* Contains address of top of stack */
+
+#define PC_REGNUM 8
+#define PS_REGNUM 9
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (NUM_REGS * 4)
+
+/* 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. */
+
+#define REGISTER_RAW_SIZE(N) (4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+#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. */
+/* Perhaps si and di should go here, but potentially they could be
+ used for things other than address. */
+#define REGISTER_VIRTUAL_TYPE(N) \
+ ((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \
+ lookup_pointer_type (builtin_type_void) : builtin_type_int)
+
+/* 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) \
+ { (SP) -= sizeof (ADDR); \
+ write_memory ((SP), (char *) &(ADDR), sizeof (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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ memcpy ((VALBUF), (REGBUF), TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF))
+
+\f
+/* 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. */
+
+#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)
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
+
+#ifdef __STDC__ /* Forward decl's for prototypes */
+struct frame_info;
+struct frame_saved_regs;
+#endif
+
+extern int
+i386_frame_num_args PARAMS ((struct frame_info *));
+
+/* 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. */
+
+#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
+
+extern void
+i386_frame_find_saved_regs PARAMS ((struct frame_info *,
+ struct frame_saved_regs *));
+
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
+
+extern void
+i386_push_dummy_frame PARAMS ((void));
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME { i386_pop_frame (); }
+
+extern void
+i386_pop_frame PARAMS ((void));
+
+/* this is
+ * call 11223344 (32 bit relative)
+ * int3
+ */
+
+#define CALL_DUMMY { 0x223344e8, 0xcc11 }
+
+#define CALL_DUMMY_LENGTH 8
+
+#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ \
+ int from, to, delta, loc; \
+ loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
+ from = loc + 5; \
+ to = (int)(fun); \
+ delta = to - from; \
+ *((char *)(dummyname) + 1) = (delta & 0xff); \
+ *((char *)(dummyname) + 2) = ((delta >> 8) & 0xff); \
+ *((char *)(dummyname) + 3) = ((delta >> 16) & 0xff); \
+ *((char *)(dummyname) + 4) = ((delta >> 24) & 0xff); \
+}
+
+extern void
+print_387_control_word PARAMS ((unsigned int));
+
+extern void
+print_387_status_word PARAMS ((unsigned int));
+
+/* Offset from SP to first arg on stack at first instruction of a function */
+
+#define SP_ARG0 (1 * 4)
+
+#endif /* !defined (TM_I386V_H) */
--- /dev/null
+/* Macro definitions for GDB on an Intel i386 running SVR4.
+ 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. */
+
+/* Use the alternate method of determining valid frame chains. */
+
+#define FRAME_CHAIN_VALID_ALTERNATE
+
+/* 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.
+ */
+#define START_INFERIOR_TRAPS_EXPECTED 2
+
+/* Pick up most of what we need from the generic i386 target include file. */
+
+#include "i386/tm-i386v.h"
+
+/* Pick up more stuff from the generic SVR4 host include file. */
+
+#include "tm-sysv4.h"
+
+/* We can't tell how many args there are
+ now that the C compiler delays popping them. */
+
+#undef FRAME_NUM_ARGS
+#define FRAME_NUM_ARGS(val,fi) (val = -1)
+
+/* 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. Note that <setjmp> defines _JBLEN as 10, which is the default
+ if no specific machine is selected, even though we only use 6 slots. */
+
+#define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */
+
+#define JB_EBX 0
+#define JB_ESI 1
+#define JB_EDI 2
+#define JB_EBP 3
+#define JB_ESP 4
+#define JB_EDX 5
+
+#define JB_PC JB_EDX /* Setjmp()'s return PC saved in EDX */
+
+/* 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 */
+
+extern int
+get_longjmp_target PARAMS ((CORE_ADDR *));
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
--- /dev/null
+/* Parameters for a Sun 386i target machine, for GDB, the GNU debugger.
+ Copyright 1986, 1987, 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 TARGET_BYTE_ORDER LITTLE_ENDIAN
+
+#ifndef sun386
+#define sun386
+#endif
+#define GDB_TARGET_IS_SUN386 1
+#define SUNOS4
+#define USE_MACHINE_REG_H
+
+/* Perhaps some day this will work even without the following #define */
+#define COFF_ENCAPSULATE
+
+#ifdef COFF_ENCAPSULATE
+/* Avoid conflicts between our include files and <sys/exec.h>
+ (maybe not needed anymore). */
+#define _EXEC_
+#endif
+
+/* sun386 ptrace seems unable to change the frame pointer */
+#define PTRACE_FP_BUG
+
+/* 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. */
+
+#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
+
+extern int
+i386_skip_prologue PARAMS ((int));
+
+/* 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))
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR 0xfc000000
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0xcc}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 1
+
+/* Nonzero if instruction at PC is a return instruction. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
+
+/* Return 1 if P points to an invalid floating point value.
+ LEN is the length in bytes -- not relevant on the 386. */
+
+#define INVALID_FLOAT(p, len) (0)
+
+/* Largest integer type */
+#define LONGEST long
+
+/* Name of the builtin type for the LONGEST type above. */
+#define BUILTIN_TYPE_LONGEST builtin_type_long
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 35
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+/* the order of the first 8 registers must match the compiler's
+ * numbering scheme (which is the same as the 386 scheme)
+ * also, this table must match regmap in i386-pinsn.c.
+ */
+#define REGISTER_NAMES { "gs", "fs", "es", "ds", \
+ "edi", "esi", "ebp", "esp", \
+ "ebx", "edx", "ecx", "eax", \
+ "retaddr", "trapnum", "errcode", "ip", \
+ "cs", "ps", "sp", "ss", \
+ "fst0", "fst1", "fst2", "fst3", \
+ "fst4", "fst5", "fst6", "fst7", \
+ "fctrl", "fstat", "ftag", "fip", \
+ "fcs", "fopoff", "fopsel" \
+ }
+
+/* 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 FP_REGNUM 6 /* Contains address of executing stack frame */
+#define SP_REGNUM 18 /* Contains address of top of stack */
+#define PS_REGNUM 17 /* Contains processor status */
+#define PC_REGNUM 15 /* Contains program counter */
+#define FP0_REGNUM 20 /* Floating point register 0 */
+#define FPC_REGNUM 28 /* 80387 control register */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (20*4+8*10+7*4)
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) \
+ ((N) >= FPC_REGNUM ? (((N) - FPC_REGNUM) * 4) + 160 \
+ : (N) >= FP0_REGNUM ? (((N) - FP0_REGNUM) * 10) + 80 \
+ : (N) * 4)
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. */
+
+#define REGISTER_RAW_SIZE(N) (((unsigned)((N) - FP0_REGNUM)) < 8 ? 10 : 4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)((N) - FP0_REGNUM)) < 8 ? 8 : 4)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 10
+
+/* 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)
+
+/* 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) \
+ i387_to_double ((FROM), (TO)); \
+ else \
+ bcopy ((FROM), (TO), 4); }
+
+extern void
+i387_to_double PARAMS ((char *, char *));
+
+/* 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_i387 ((FROM), (TO)); \
+ else \
+ bcopy ((FROM), (TO), 4); }
+
+extern void
+double_to_i387 PARAMS ((char *, char *));
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ (((unsigned)((N) - FP0_REGNUM)) < 8 ? builtin_type_double : builtin_type_int)
+
+/* 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) \
+ { (SP) -= sizeof (ADDR); \
+ write_memory ((SP), &(ADDR), sizeof (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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF + REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 11), VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 11), VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF))
+\f
+/* 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. */
+
+#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)
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
+
+#ifdef __STDC__ /* Forward decl's for prototypes */
+struct frame_info;
+struct frame_saved_regs;
+#endif
+
+extern int
+i386_frame_num_args PARAMS ((struct frame_info *));
+
+/* 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. */
+
+#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
+
+extern void
+i386_frame_find_saved_regs PARAMS ((struct frame_info *,
+ struct frame_saved_regs *));
+
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
+
+extern void
+i386_push_dummy_frame PARAMS ((void));
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME { i386_pop_frame (); }
+
+extern void
+i386_pop_frame PARAMS ((void));
+
+/* this is
+ * call 11223344 (32 bit relative)
+ * int3
+ */
+
+#define CALL_DUMMY { 0x223344e8, 0xcc11 }
+
+#define CALL_DUMMY_LENGTH 8
+
+#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ \
+ *(int *)((char *)(dummyname) + 1) = (int)(fun) - (pc) - 5; \
+}
--- /dev/null
+/* Target machine definitions for GDB on a Sequent Symmetry under dynix 3.0,
+ with Weitek 1167 and i387 support.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Symmetry version by Jay Vosburgh (uunet!sequent!fubar).
+
+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. */
+
+/* I don't know if this will work for cross-debugging, even if you do get
+ a copy of the right include file. */
+#include <machine/reg.h>
+
+#define TARGET_BYTE_ORDER LITTLE_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. From m-i386.h */
+
+#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
+
+extern int
+i386_skip_prologue PARAMS ((int));
+
+/* 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)
+
+/* I don't know the real values for these. */
+#define TARGET_UPAGES UPAGES
+#define TARGET_NBPG NBPG
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR (0x40000000 - (TARGET_UPAGES * TARGET_NBPG))
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0xcc}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+/* For Symmetry, this is really the 'leave' instruction, which */
+/* is right before the ret */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc9)
+
+/* Return 1 if P points to an invalid floating point value.
+*/
+
+#define INVALID_FLOAT(p, len) (0)
+
+#if 0
+ --- this code can't be used unless we know we are running native,
+ since it uses host specific ptrace calls.
+/* code for 80387 fpu. Functions are from i386-dep.c, copied into
+ * symm-dep.c.
+ */
+#define FLOAT_INFO { i386_float_info(); }
+#endif
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+#define NUM_REGS 49
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+/* Symmetry registers are in this weird order to match the register
+ numbers in the symbol table entries. If you change the order,
+ things will probably break mysteriously for no apparent reason.
+ Also note that the st(0)...st(7) 387 registers are represented as
+ st0...st7. */
+
+#define REGISTER_NAMES { "eax", "edx", "ecx", "st0", "st1", \
+ "ebx", "esi", "edi", "st2", "st3", \
+ "st4", "st5", "st6", "st7", "esp", \
+ "ebp", "eip", "eflags", "fp1", "fp2", \
+ "fp3", "fp4", "fp5", "fp6", "fp7", \
+ "fp8", "fp9", "fp10", "fp11", "fp12", \
+ "fp13", "fp14", "fp15", "fp16", "fp17", \
+ "fp18", "fp19", "fp20", "fp21", "fp22", \
+ "fp23", "fp24", "fp25", "fp26", "fp27", \
+ "fp28", "fp29", "fp30", "fp31" }
+
+/* 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 FP1_REGNUM 18 /* first 1167 register */
+#define SP_REGNUM 14 /* Contains address of top of stack */
+#define FP_REGNUM 15 /* Contains address of executing stack frame */
+#define PC_REGNUM 16 /* Contains program counter */
+#define PS_REGNUM 17 /* Contains processor status */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+/* 10 i386 registers, 8 i387 registers, and 31 Weitek 1167 registers */
+#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) \
+((N < 3) ? (N * 4) : \
+(N < 5) ? (((N - 2) * 10) + 2) : \
+(N < 8) ? (((N - 5) * 4) + 32) : \
+(N < 14) ? (((N - 8) * 10) + 44) : \
+ (((N - 14) * 4) + 104))
+
+/* Number of bytes of storage in the actual machine representation
+ * for register N. All registers are 4 bytes, except 387 st(0) - st(7),
+ * which are 80 bits each.
+ */
+
+#define REGISTER_RAW_SIZE(N) \
+((N < 3) ? 4 : \
+(N < 5) ? 10 : \
+(N < 8) ? 4 : \
+(N < 14) ? 10 : \
+ 4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. On the vax, all regs are 4 bytes. */
+
+#define REGISTER_VIRTUAL_SIZE(N) 4
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 10
+
+/* 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) \
+((N < 3) ? 0 : \
+(N < 5) ? 1 : \
+(N < 8) ? 0 : \
+(N < 14) ? 1 : \
+ 0)
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+((REGNUM < 3) ? bcopy ((FROM), (TO), 4) : \
+(REGNUM < 5) ? i387_to_double((FROM), (TO)) : \
+(REGNUM < 8) ? bcopy ((FROM), (TO), 4) : \
+(REGNUM < 14) ? i387_to_double((FROM), (TO)) : \
+ bcopy ((FROM), (TO), 4))
+
+extern void
+i387_to_double PARAMS ((char *, char *));
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+((REGNUM < 3) ? bcopy ((FROM), (TO), 4) : \
+(REGNUM < 5) ? double_to_i387((FROM), (TO)) : \
+(REGNUM < 8) ? bcopy ((FROM), (TO), 4) : \
+(REGNUM < 14) ? double_to_i387((FROM), (TO)) : \
+ bcopy ((FROM), (TO), 4))
+
+extern void
+double_to_i387 PARAMS ((char *, char *));
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+((N < 3) ? builtin_type_int : \
+(N < 5) ? builtin_type_double : \
+(N < 8) ? builtin_type_int : \
+(N < 14) ? builtin_type_double : \
+ builtin_type_int)
+
+/* from m-i386.h */
+/* 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) \
+ { (SP) -= sizeof (ADDR); \
+ write_memory ((SP), &(ADDR), sizeof (ADDR)); \
+ write_register(0, (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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF))
+
+\f
+/* 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.
+
+ However, if FRAME_CHAIN_VALID returns zero,
+ it means the given frame is the outermost one and has no caller. */
+
+/* On Symmetry, %ebp points to caller's %ebp, and the return address
+ is right on top of that. */
+
+#define FRAME_CHAIN(thisframe) \
+ (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer((thisframe)->frame, 4) :\
+ 0)
+
+#define FRAME_CHAIN_VALID(chain, thisframe) \
+ (chain != 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(fi) (read_memory_integer((fi)->frame + 4, 4))
+
+#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
+
+#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell.
+
+ The weirdness in the "addl $imm8" case is due to gcc sometimes
+ issuing "addl $-int" after function call returns; this would
+ produce ridiculously huge arg counts. */
+
+#define FRAME_NUM_ARGS(numargs, fi) \
+{ \
+ int op = read_memory_integer(FRAME_SAVED_PC((fi)), 4); \
+ int narg; \
+ if ((op & 0xff) == 0x59) /* 0x59 'popl %ecx' */ \
+ { \
+ numargs = 1; \
+ } \
+ else if ((op & 0xffff) == 0xc483) /* 0xc483 'addl $imm8' */ \
+ { \
+ narg = ((op >> 16) & 0xff); \
+ numargs = (narg >= 128) ? -1 : narg / 4; \
+ } \
+ else if ((op & 0xffff) == 0xc481) /* 0xc481 'addl $imm32' */ \
+ { \
+ narg = read_memory_integer(FRAME_SAVED_PC((fi))+2,4); \
+ numargs = (narg < 0) ? -1 : narg / 4; \
+ } \
+ else \
+ { \
+ numargs = -1; \
+ } \
+}
+
+/* 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. */
+
+#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
+
+#ifdef __STDC__ /* Forward decl's for prototypes */
+struct frame_info;
+struct frame_saved_regs;
+#endif
+
+extern void
+i386_frame_find_saved_regs PARAMS ((struct frame_info *,
+ struct frame_saved_regs *));
+
+\f
+/* Things needed for making the inferior call functions. */
+
+#define PUSH_DUMMY_FRAME \
+{ CORE_ADDR sp = read_register (SP_REGNUM); \
+ int regnum; \
+ sp = push_word (sp, read_register (PC_REGNUM)); \
+ sp = push_word (sp, read_register (FP_REGNUM)); \
+ write_register (FP_REGNUM, sp); \
+ for (regnum = 0; regnum < NUM_REGS; regnum++) \
+ sp = push_word (sp, read_register (regnum)); \
+ write_register (SP_REGNUM, sp); \
+}
+
+#define POP_FRAME \
+{ \
+ FRAME frame = get_current_frame (); \
+ CORE_ADDR fp; \
+ int regnum; \
+ struct frame_saved_regs fsr; \
+ struct frame_info *fi; \
+ fi = get_frame_info (frame); \
+ fp = fi->frame; \
+ get_frame_saved_regs (fi, &fsr); \
+ for (regnum = 0; regnum < NUM_REGS; regnum++) { \
+ CORE_ADDR adr; \
+ adr = fsr.regs[regnum]; \
+ if (adr) \
+ write_register (regnum, read_memory_integer (adr, 4)); \
+ } \
+ write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
+ write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
+ write_register (SP_REGNUM, fp + 8); \
+ flush_cached_frames (); \
+ set_current_frame ( create_new_frame (read_register (FP_REGNUM), \
+ read_pc ())); \
+}
+
+/* from i386-dep.c, worked better than my original... */
+/* This sequence of words is the instructions
+ * call (32-bit offset)
+ * int 3
+ * This is 6 bytes.
+ */
+
+#define CALL_DUMMY { 0x223344e8, 0xcc11 }
+
+#define CALL_DUMMY_LENGTH 8
+
+#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ \
+ int from, to, delta, loc; \
+ loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
+ from = loc + 5; \
+ to = (int)(fun); \
+ delta = to - from; \
+ *(int *)((char *)(dummyname) + 1) = delta; \
+}
+
+extern void
+print_387_control_word PARAMS ((unsigned int));
+
+extern void
+print_387_status_word PARAMS ((unsigned int));
--- /dev/null
+/* Definitions for hosting on GO32, for GDB.
+ Copyright 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. */
+
+#undef EIO
+#define EIO 0
+#define SYS_SIGLIST_MISSING 1
+#define HOST_BYTE_ORDER LITTLE_ENDIAN
+#include "fopen-bin.h"
+
+/* Define this lseek(n) != nth byte of file */
+#define LSEEK_NOT_LINEAR
+
+#define CANT_FORK
+
+#undef QUIT
+#define QUIT { pollquit(); }
--- /dev/null
+/* Host-dependent definitions for Intel 386 running BSD Unix, for GDB.
+ Copyright 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 HOST_BYTE_ORDER LITTLE_ENDIAN
+
+#include <machine/limits.h> /* for INT_MIN, to avoid "INT_MIN
+ redefined" warnings from defs.h */
+
+/* psignal() is in <signal.h>. */
+
+#define PSIGNAL_IN_SIGNAL_H
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
--- /dev/null
+/* Definitions to make GDB run on Mach on an Intel 386
+ Copyright (C) 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. */
+
+#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
+
+/* 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 (0x80000000 - (UPAGES * NBPG))
+
+#define BROKEN_LARGE_ALLOCA
+
+#define PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+
+/* <errno.h> only defines this if __STDC__!!! */
+extern int errno;
+
+extern char *strdup();
--- /dev/null
+/* Macro defintions for i386, running SCO Unix System V/386 3.2.
+ 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. */
+
+/* In 3.2v4 <sys/user.h> requires on <sys/dir.h>. */
+#include <sys/types.h>
+#include <sys/dir.h>
+
+#include "i386/xm-i386v.h"
+
+/* Apparently there is inconsistency among various System V's about what
+ the name of this field is. */
+#define U_FPSTATE(u) u.u_fps.u_fpstate
+
+/* TIOCGETC is defined in System V 3.2 termio.h, but struct tchars
+ is not. This makes problems for inflow.c. */
+#define TIOCGETC_BROKEN
+
+/* All the job control definitions exist in SCO Unix, but the standard
+ shells don't use them. So we must disable job control. */
+/* This is no longer true with 3.2v2 and later */
+/* #define NO_JOB_CONTROL */
+
+/* SCO's assembler doesn't grok dollar signs in identifiers.
+ So we use dots instead. This item must be coordinated with G++. */
+#undef CPLUS_MARKER
+#define CPLUS_MARKER '.'
+#define HAVE_STRSTR
+
+/* Use setpgid instead of setpgrp on SCO */
+#define NEED_POSIX_SETPGID
--- /dev/null
+/* Host support for i386.
+ Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
+
+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
+
+/* 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
+
+/* 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 0xe0000000
+
--- /dev/null
+/* Macro defintions for i386, running System V 3.2.
+ 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 "i386/xm-i386v.h"
+
+/* Apparently there is inconsistency among various System V's about what
+ the name of this field is. */
+#define U_FPSTATE(u) u.u_fps.u_fpstate
+
+/* TIOCGETC is defined in System V 3.2 termio.h, but struct tchars
+ is not. This makes problems for inflow.c. */
+#define TIOCGETC_BROKEN
--- /dev/null
+/* Macro definitions for GDB on an Intel i386 running SVR4.
+ 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 i386 host include file. */
+
+#include "i386/xm-i386v.h"
+
+/* Pick up more stuff from the generic SVR4 host include file. */
+
+#include "xm-sysv4.h"
+
+/* The native AT&T compiler for i386/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 0x81000000 /* First mapping here */
+#define MMAP_INCREMENT 0x01000000 /* Increment to next mapping */
--- /dev/null
+/* Native support for linux, 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. */
+
+#include "i386/xm-i386v.h"
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+#undef KERNEL_U_ADDR
+#define KERNEL_U_ADDR 0x0
+#define PSIGNAL_IN_SIGNAL_H
--- /dev/null
+/* Host support for Sun 386i, 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 HOST_BYTE_ORDER LITTLE_ENDIAN
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+/* If I do this on SunOS 4.0.1, I get SIGSEGV's on (some) instructions which
+ try to access the stack. */
+/* #define SET_STACK_LIMIT_HUGE */
+
+#define BROKEN_LARGE_ALLOCA
+
+/* Enable use of alternate code for Sun's format of core dump file. */
+
+#define NEW_SUN_CORE
+
+#define PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
--- /dev/null
+/* Definitions to make GDB run on a Sequent Symmetry under dynix 3.0,
+ with Weitek 1167 and i387 support.
+ Copyright 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. */
+
+/* Symmetry version by Jay Vosburgh (uunet!sequent!fubar) */
+
+/* This machine doesn't have the siginterrupt call. */
+#define NO_SIGINTERRUPT
+
+#define HAVE_WAIT_STRUCT
+
+/* XPT_DEBUG doesn't work yet under Dynix 3.0.12, but UNDEBUG does... */
+/* #define PTRACE_ATTACH XPT_DEBUG
+#define PTRACE_DETACH XPT_UNDEBUG
+#define ATTACH_DETACH */
+
+#define HOST_BYTE_ORDER LITTLE_ENDIAN
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* 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 (0x80000000 - (UPAGES * NBPG))
+
+/* The magic numbers below are offsets into u_ar0 in the user struct.
+ They live in <machine/reg.h>. Gdb calls this macro with blockend
+ holding u.u_ar0 - KERNEL_U_ADDR. Only the registers listed are
+ saved in the u area (along with a few others that aren't useful
+ here. See <machine/reg.h>). */
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ struct user foo; /* needed for finding fpu regs */ \
+switch (regno) { \
+ case 0: \
+ addr = blockend + EAX * sizeof(int); break; \
+ case 1: \
+ addr = blockend + EDX * sizeof(int); break; \
+ case 2: \
+ addr = blockend + ECX * sizeof(int); break; \
+ case 3: /* st(0) */ \
+ addr = blockend - \
+ ((int)&foo.u_fpusave.fpu_stack[0][0] - (int)&foo); \
+ break; \
+ case 4: /* st(1) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[1][0] - (int)&foo); \
+ break; \
+ case 5: \
+ addr = blockend + EBX * sizeof(int); break; \
+ case 6: \
+ addr = blockend + ESI * sizeof(int); break; \
+ case 7: \
+ addr = blockend + EDI * sizeof(int); break; \
+ case 8: /* st(2) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[2][0] - (int)&foo); \
+ break; \
+ case 9: /* st(3) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[3][0] - (int)&foo); \
+ break; \
+ case 10: /* st(4) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[4][0] - (int)&foo); \
+ break; \
+ case 11: /* st(5) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[5][0] - (int)&foo); \
+ break; \
+ case 12: /* st(6) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[6][0] - (int)&foo); \
+ break; \
+ case 13: /* st(7) */ \
+ addr = blockend - \
+ ((int) &foo.u_fpusave.fpu_stack[7][0] - (int)&foo); \
+ break; \
+ case 14: \
+ addr = blockend + ESP * sizeof(int); break; \
+ case 15: \
+ addr = blockend + EBP * sizeof(int); break; \
+ case 16: \
+ addr = blockend + EIP * sizeof(int); break; \
+ case 17: \
+ addr = blockend + FLAGS * sizeof(int); break; \
+ case 18: /* fp1 */ \
+ case 19: /* fp2 */ \
+ case 20: /* fp3 */ \
+ case 21: /* fp4 */ \
+ case 22: /* fp5 */ \
+ case 23: /* fp6 */ \
+ case 24: /* fp7 */ \
+ case 25: /* fp8 */ \
+ case 26: /* fp9 */ \
+ case 27: /* fp10 */ \
+ case 28: /* fp11 */ \
+ case 29: /* fp12 */ \
+ case 30: /* fp13 */ \
+ case 31: /* fp14 */ \
+ case 32: /* fp15 */ \
+ case 33: /* fp16 */ \
+ case 34: /* fp17 */ \
+ case 35: /* fp18 */ \
+ case 36: /* fp19 */ \
+ case 37: /* fp20 */ \
+ case 38: /* fp21 */ \
+ case 39: /* fp22 */ \
+ case 40: /* fp23 */ \
+ case 41: /* fp24 */ \
+ case 42: /* fp25 */ \
+ case 43: /* fp26 */ \
+ case 44: /* fp27 */ \
+ case 45: /* fp28 */ \
+ case 46: /* fp29 */ \
+ case 47: /* fp30 */ \
+ case 48: /* fp31 */ \
+ addr = blockend - \
+ ((int) &foo.u_fpasave.fpa_regs[(regno)-18] - (int)&foo); \
+ } \
+}
+
+/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
+
+#define FETCH_INFERIOR_REGISTERS
+
+/* We must fetch all the regs before storing, since we store all at once. */
+
+#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+\f
+/* Interface definitions for kernel debugger KDB. */
+/* This doesn't work... */
+/* 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, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
+ 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 0, 0}
+
+/* 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, %esp"); \
+ asm ("movl %ebp, $0"); }
+
+/* Push the frame pointer register on the stack. */
+#define PUSH_FRAME_PTR \
+ asm ("pushl %ebp");
+
+/* Copy the top-of-stack to the frame pointer register. */
+#define POP_FRAME_PTR \
+ asm ("movl (%esp), %ebp");
+
+/* 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("pushad"); }
+/*
+{ asm("pushl %eax"); \
+ asm("pushl %edx"); \
+ asm("pushl %ecx"); \
+ asm("pushl %st(0)"); \
+ asm("pushl %st(1)"); \
+ asm("pushl %ebx"); \
+ asm("pushl %esi"); \
+ asm("pushl %edi"); \
+ asm("pushl %st(2)"); \
+ asm("pushl %st(3)"); \
+ asm("pushl %st(4)"); \
+ asm("pushl %st(5)"); \
+ asm("pushl %st(6)"); \
+ asm("pushl %st(7)"); \
+ asm("pushl %esp"); \
+ asm("pushl %ebp"); \
+ asm("pushl %eip"); \
+ asm("pushl %eflags"); \
+ asm("pushl %fp1"); \
+ asm("pushl %fp2"); \
+ asm("pushl %fp3"); \
+ asm("pushl %fp4"); \
+ asm("pushl %fp5"); \
+ asm("pushl %fp6"); \
+ asm("pushl %fp7"); \
+ asm("pushl %fp8"); \
+ asm("pushl %fp9"); \
+ asm("pushl %fp10"); \
+ asm("pushl %fp11"); \
+ asm("pushl %fp12"); \
+ asm("pushl %fp13"); \
+ asm("pushl %fp14"); \
+ asm("pushl %fp15"); \
+ asm("pushl %fp16"); \
+ asm("pushl %fp17"); \
+ asm("pushl %fp18"); \
+ asm("pushl %fp19"); \
+ asm("pushl %fp20"); \
+ asm("pushl %fp21"); \
+ asm("pushl %fp22"); \
+ asm("pushl %fp23"); \
+ asm("pushl %fp24"); \
+ asm("pushl %fp25"); \
+ asm("pushl %fp26"); \
+ asm("pushl %fp27"); \
+ asm("pushl %fp28"); \
+ asm("pushl %fp29"); \
+ asm("pushl %fp30"); \
+ asm("pushl %fp31"); \
+}
+*/
+/* 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 ("popad"); }
--- /dev/null
+# Target: Intel 80960, in an embedded system under the NINDY monitor
+TDEPFILES= exec.o i960-pinsn.o i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttybreak.o ttyflush.o
+TM_FILE= tm-nindy960.h
--- /dev/null
+/* Parameters for target machine Intel 960, for GDB, the GNU debugger.
+ Copyright (C) 1990, 1991, 1993 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+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. */
+
+/* Definitions to target GDB to any i960. */
+
+#ifndef I80960
+#define I80960
+#endif
+
+/* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol
+ information. In the i960, parameters can be stored as locals or as
+ args, depending on the type of the debug record.
+
+ From empirical observation, gcc960 uses N_LSYM to indicate
+ arguments passed in registers and then copied immediately
+ to the frame, and N_PSYM to indicate arguments passed in a
+ g14-relative argument block. */
+
+#define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG)
+
+/* Byte order is configurable, but this machine runs little-endian. */
+#define TARGET_BYTE_ORDER LITTLE_ENDIAN
+
+/* We have IEEE floating point, if we have any float at all. */
+
+#define IEEE_FLOAT
+
+/* Offset from address of function to start of its code.
+ Zero on most machines. */
+
+#define FUNCTION_START_OFFSET 0
+
+/* Advance ip across any function entry prologue instructions
+ to reach some "real" code. */
+
+#define SKIP_PROLOGUE(ip) { ip = skip_prologue (ip); }
+extern CORE_ADDR skip_prologue ();
+
+/* Immediately after a function call, return the saved ip.
+ 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) (saved_pc_after_call (frame))
+extern CORE_ADDR saved_pc_after_call ();
+
+/* Stack grows upward */
+
+#define INNER_THAN >
+
+/* Nonzero if instruction at ip is a return instruction. */
+
+#define ABOUT_TO_RETURN(ip) (read_memory_integer(ip,4) == 0x0a000000)
+
+/* Return 1 if P points to an invalid floating point value.
+ LEN is the length in bytes. */
+
+#define INVALID_FLOAT(p, len) (0)
+
+/* How long (ordinary) registers are */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+#define NUM_REGS 40
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES { \
+ /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
+ /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
+ /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
+ /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
+ /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
+}
+
+/* Register numbers of various important registers (used to index
+ into arrays of register names and register values). */
+
+#define R0_REGNUM 0 /* First local register */
+#define SP_REGNUM 1 /* Contains address of top of stack */
+#define RIP_REGNUM 2 /* Return instruction pointer (local r2) */
+#define R15_REGNUM 15 /* Last local register */
+#define G0_REGNUM 16 /* First global register */
+#define G13_REGNUM 29 /* g13 - holds struct return address */
+#define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */
+#define FP_REGNUM 31 /* Contains address of executing stack frame */
+#define PCW_REGNUM 32 /* process control word */
+#define ACW_REGNUM 33 /* arithmetic control word */
+#define TCW_REGNUM 34 /* trace control word */
+#define IP_REGNUM 35 /* instruction pointer */
+#define FP0_REGNUM 36 /* First floating point register */
+
+/* Some registers have more than one name */
+
+#define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */
+#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES ((36*4) + (4*10))
+
+/* Index within `registers' of the first byte of the space for register N. */
+
+#define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \
+ (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) )
+
+/* The i960 has register windows, sort of. */
+
+#define HAVE_REGISTER_WINDOWS
+
+/* Is this register part of the register window system? A yes answer
+ implies that 1) The name of this register will not be the same in
+ other frames, and 2) This register is automatically "saved" upon
+ subroutine calls and thus there is no need to search more than one
+ stack frame for it.
+
+ On the i960, in fact, the name of this register in another frame is
+ "mud" -- there is no overlap between the windows. Each window is
+ simply saved into the stack (true for our purposes, after having been
+ flushed; normally they reside on-chip and are restored from on-chip
+ without ever going to memory). */
+
+#define REGISTER_IN_WINDOW_P(regnum) ((regnum) <= R15_REGNUM)
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. On the i960, all regs are 4 bytes except for floating
+ point, which are 10. NINDY only sends us 8 byte values for these,
+ which is a pain, but VxWorks handles this correctly, so we must. */
+
+#define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 )
+
+/* Number of bytes of storage in the program's representation for register N. */
+
+#define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 )
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 10
+
+/* 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) ((N) >= FP0_REGNUM)
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+extern struct ext_format ext_format_i960;
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+{ \
+ if ((REGNUM) >= FP0_REGNUM) \
+ ieee_extended_to_double (&ext_format_i960, (FROM), (double *)(TO)); \
+ else \
+ bcopy ((FROM), (TO), 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) \
+ double_to_ieee_extended (&ext_format_i960, (double *)(FROM), (TO)); \
+ else \
+ bcopy ((FROM), (TO), 4); \
+}
+
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) ((N) < FP0_REGNUM ? \
+ builtin_type_int : builtin_type_double)
+\f
+/* Macros for understanding function return values... */
+
+/* Does the specified function use the "struct returning" convention
+ or the "value returning" convention? The "value returning" convention
+ almost invariably returns the entire value in registers. The
+ "struct returning" convention often returns the entire value in
+ memory, and passes a pointer (out of or into the function) saying
+ where the value (is or should go).
+
+ Since this sometimes depends on whether it was compiled with GCC,
+ this is also an argument. This is used in call_function to build a
+ stack, and in value_being_returned to print return values.
+
+ On i960, a structure is returned in registers g0-g3, if it will fit.
+ If it's more than 16 bytes long, g13 pointed to it on entry. */
+
+#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 16)
+
+/* 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 only called if USE_STRUCT_CONVENTION for this
+ type is 0.
+
+ On the i960 we just take as many bytes as we need from G0 through G3. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy(REGBUF+REGISTER_BYTE(G0_REGNUM), VALBUF, TYPE_LENGTH (TYPE))
+
+/* If USE_STRUCT_CONVENTION produces a 1,
+ 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).
+
+ Address of where to put structure was passed in in global
+ register g13 on entry. God knows what's in g13 now. The
+ (..., 0) below is to make it appear to return a value, though
+ actually all it does is call error(). */
+
+#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+ (error("Don't know where large structure is returned on i960"), 0)
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format, for "value returning" functions.
+
+ For 'return' command: not (yet) implemented for i960. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ error ("Returning values from functions is not implemented in i960 gdb")
+
+/* 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) \
+ error ("Returning values from functions is not implemented in i960 gdb")
+\f
+/* 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.
+
+ However, if FRAME_CHAIN_VALID returns zero,
+ it means the given frame is the outermost one and has no caller. */
+
+/* We cache information about saved registers in the frame structure,
+ to save us from having to re-scan function prologues every time
+ a register in a non-current frame is accessed. */
+
+#define EXTRA_FRAME_INFO \
+ struct frame_saved_regs *fsr; \
+ CORE_ADDR arg_pointer;
+
+/* Zero the frame_saved_regs pointer when the frame is initialized,
+ so that FRAME_FIND_SAVED_REGS () will know to allocate and
+ initialize a frame_saved_regs struct the first time it is called.
+ Set the arg_pointer to -1, which is not valid; 0 and other values
+ indicate real, cached values. */
+
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
+ ((fi)->fsr = 0, (fi)->arg_pointer = -1)
+
+/* On the i960, we get the chain pointer by reading the PFP saved
+ on the stack and clearing the status bits. */
+
+#define FRAME_CHAIN(thisframe) \
+ (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)
+
+/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
+ and has no caller.
+
+ On the i960, each various target system type must define FRAME_CHAIN_VALID,
+ since it differs between NINDY and VxWorks, the two currently supported
+ targets types. We leave it undefined here. */
+
+
+/* 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) = (leafproc_return ((FI)->pc) != 0); }
+
+/* Note that in the i960 architecture the return pointer is saved in the
+ *caller's* stack frame.
+
+ Make sure to zero low-order bits because of bug in 960CA A-step part
+ (instruction addresses should always be word-aligned anyway). */
+
+#define FRAME_SAVED_PC(frame) \
+ ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)
+
+/* On the i960, FRAME_ARGS_ADDRESS should return the value of
+ g14 as passed into the frame, if known. We need a function for this.
+ We cache this value in the frame info if we've already looked it up. */
+
+#define FRAME_ARGS_ADDRESS(fi) \
+ (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))
+extern CORE_ADDR frame_args_address (); /* i960-tdep.c */
+
+/* This is the same except it should return 0 when
+ it does not really know where the args are, rather than guessing.
+ This value is not cached since it is only used infrequently. */
+
+#define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1))
+
+#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
+
+/* Set NUMARGS to the number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* Produce the positions of the saved registers in a stack frame. */
+
+#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
+ frame_find_saved_regs (frame_info_addr, &sr)
+extern void frame_find_saved_regs(); /* See i960-tdep.c */
+
+
+/* Print status when we get a random unexpected signal. We have more
+ kinds of signals than Unix does... */
+
+#define PRINT_RANDOM_SIGNAL(stop_signal) print_fault (stop_signal)
+\f
+/* Things needed for making calls to functions in the inferior process */
+
+/* Push an empty stack frame, to record the current ip, etc.
+
+ Not (yet?) implemented for i960. */
+
+#define PUSH_DUMMY_FRAME \
+error("Function calls into the inferior process are not supported on the i960")
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME \
+ pop_frame ()
+
+
+/* This sequence of words is the instructions
+
+ callx 0x00000000
+ fmark
+ */
+
+/* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
+
+/* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
+
+/* Indicate that we don't support calling inferior child functions. */
+
+#undef CALL_DUMMY
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at 'dummyname'.
+
+ Ignore arg count on i960. */
+
+/* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */
+
+#undef FIX_CALL_DUMMY
+
+
+/* Interface definitions for kernel debugger KDB */
+/* (Not relevant to i960.) */
--- /dev/null
+/* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger.
+ Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Contributed by Intel Corporation and 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. */
+
+/*****************************************************************************
+ * Definitions to target GDB to an i960 debugged over a serial line.
+ ******************************************************************************/
+
+#include "i960/tm-i960.h"
+
+/* Override the standard gdb prompt when compiled for this target. */
+
+#define DEFAULT_PROMPT "(gdb960) "
+
+/* Additional command line options accepted by nindy gdb's, for handling
+ the remote-nindy.c interface. These should really be target-specific
+ rather than architecture-specific. */
+
+extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */
+extern int nindy_initial_brk; /* Send a BREAK to reset board first */
+extern char *nindy_ttyname; /* Name of serial port to talk to nindy */
+
+#define ADDITIONAL_OPTIONS \
+ {"O", no_argument, &nindy_old_protocol, 1}, \
+ {"brk", no_argument, &nindy_initial_brk, 1}, \
+ {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */
+
+#define ADDITIONAL_OPTION_CASES \
+ case 1004: /* -ser option: remote nindy auto-start */ \
+ nindy_ttyname = optarg; \
+ break;
+
+#define ADDITIONAL_OPTION_HELP \
+ "\
+ -O Use old protocol to talk to a Nindy target\n\
+ -brk Send a break to a Nindy target to reset it.\n\
+ -ser SERIAL Open remote Nindy session to SERIAL port.\n\
+"
+
+/* If specified on the command line, open tty for talking to nindy,
+ and download the executable file if one was specified. */
+
+#define ADDITIONAL_OPTION_HANDLER \
+ if (!setjmp (to_top_level) && nindy_ttyname) { \
+ nindy_open (nindy_ttyname, !batch); \
+ if ( !setjmp(to_top_level) && execarg ) { \
+ target_load (execarg, !batch); \
+ } \
+ }
+
+/* If configured for i960 target, we take control before main loop
+ and demand that we configure for a nindy target. */
+
+#define BEFORE_MAIN_LOOP_HOOK \
+ nindy_before_main_loop();
+
+extern void
+nindy_before_main_loop(); /* In remote-nindy.c */
+
+/* Address of end of stack space.
+ * This probably doesn't matter for nindy, because it's only used
+ * in manipulation of core files, which we don't support.
+ */
+
+#define STACK_END_ADDR (0xfe000000)
+
+/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
+ and has no caller.
+
+ On the i960, each various target system type defines FRAME_CHAIN_VALID,
+ since it differs between NINDY and VxWorks, the two currently supported
+ targets types. */
+
+#define FRAME_CHAIN_VALID(chain, thisframe) \
+ nindy_frame_chain_valid (chain, thisframe)
+
+extern int
+nindy_frame_chain_valid(); /* See nindy-tdep.c */
+
+/* Sequence of bytes for breakpoint instruction */
+
+#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
+
+/* Amount ip must be decremented by after a breakpoint.
+ * This is often the number of bytes in BREAKPOINT but not always.
+ */
+
+#define DECR_PC_AFTER_BREAK 0
--- /dev/null
+/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
+ Copyright (C) 1986-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. */
+
+#include "i960/tm-i960.h"
+
+/* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has
+ the real value. */
+#undef PC_REGNUM
+#define PC_REGNUM RIP_REGNUM
+
+#define GDBINIT_FILENAME ".vxgdbinit"
+
+#define DEFAULT_PROMPT "(vxgdb) "
+
+/* We have more complex, useful breakpoints on the target.
+ Amount ip must be decremented by after a breakpoint. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
+
+#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0)
+
+/* Breakpoint patching is handled at the target end in VxWorks. */
+/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
--- /dev/null
+# Target: VxWorks running on an Intel 960
+TDEPFILES= exec.o i960-pinsn.o i960-tdep.o remote-vx.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
+TM_FILE= tm-vx960.h
+# Define this for the vx-share routines, which don't see param.h.
+MT_CFLAGS= -DI80960
--- /dev/null
+# 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
--- /dev/null
+# Target: AT&T 3b1/Unix pc
+TDEPFILES= exec.o m68k-pinsn.o
+TM_FILE= tm-3b1.h
--- /dev/null
+# 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
--- /dev/null
+# Target: Altos 3068 (68k, System V release 2)
+TDEPFILES= m68k-pinsn.o exec.o
+TM_FILE= tm-altos.h
--- /dev/null
+# 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
--- /dev/null
+# Target: Commodore Amiga running SVR4
+TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o solib.o
+TM_FILE= tm-amix.h
--- /dev/null
+# 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
--- /dev/null
+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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# Target: Hewlett-Packard 9000 series 300, running BSD
+TDEPFILES= m68k-pinsn.o m68k-tdep.o
+TM_FILE= tm-hp300bsd.h
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# Target: ISI Optimum V (3.05) under 4.3bsd.
+TDEPFILES= exec.o m68k-pinsn.o
+TM_FILE= tm-isi.h
--- /dev/null
+# Target: Motorola 68xxx with floating point
+TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
+TM_FILE= tm-68k-fp.h
--- /dev/null
+# Target: Motorola 68xxx without floating point
+TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
+TM_FILE= tm-68k-nofp.h
--- /dev/null
+# 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
--- /dev/null
+# Target: Sony news series 700/800/900 (68020) running NewsOS version 3.
+TDEPFILES= m68k-pinsn.o m68k-tdep.o
+TM_FILE= tm-news.h
--- /dev/null
+# 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
--- /dev/null
+/* 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
+
--- /dev/null
+/* 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
--- /dev/null
+/* 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
--- /dev/null
+/* 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
+
--- /dev/null
+/* 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. */
--- /dev/null
+/* 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; }
--- /dev/null
+/* 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
--- /dev/null
+# Target: VxWorks running on a 68000
+TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
+TM_FILE= tm-os68k.h
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# Target: Sun 2, running SunOS 4
+TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o
+TM_FILE= tm-sun2os4.h
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+/* 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"
--- /dev/null
+/* 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)
--- /dev/null
+/* 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)
--- /dev/null
+/* 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))
+\f
+/* 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. */
+
+\f
+/* 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)
--- /dev/null
+/* 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"
--- /dev/null
+/* 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)
--- /dev/null
+/* 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)
--- /dev/null
+/* 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"
--- /dev/null
+/* 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"
--- /dev/null
+/* 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
+
+\f
+/* 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"
--- /dev/null
+/* 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"
--- /dev/null
+/* 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)
--- /dev/null
+/* 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"
--- /dev/null
+/* 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"
--- /dev/null
+/* 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"
--- /dev/null
+/* 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)
--- /dev/null
+/* 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"
--- /dev/null
+/* 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)
--- /dev/null
+# 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
--- /dev/null
+/* 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; }
+\f
+/* 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
--- /dev/null
+/* 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)))
+
+\f
+#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
--- /dev/null
+/* 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 */
--- /dev/null
+/* 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();
--- /dev/null
+/* 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
+
--- /dev/null
+/* 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 *));
+\f
+/* 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"); }
--- /dev/null
+/* 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)))
+\f
+/* 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 */
--- /dev/null
+/* 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; \
+}
+\f
+/* 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"); }
--- /dev/null
+/* 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
+
--- /dev/null
+/* 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
+
+\f
+/* 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
--- /dev/null
+/* 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"
--- /dev/null
+/* 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
+
+\f
+/* 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"); }
--- /dev/null
+/* 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)
+\f
+/* 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"); }
--- /dev/null
+/* 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();
--- /dev/null
+# Host: Motorola 88000 running DGUX
+XDEPFILES=
+XM_FILE= xm-delta88.h
+NAT_FILE= nm-m88k.h
+NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o m88k-nat.o
+REGEX=regex.o
+REGEX1=regex.o
+ALLOCA=alloca.o
+ALLOCA1=alloca.o
+# Have to use /bin/nm because a bfd nm won't do the right thing
+MUNCH_DEFINE=MUNCH_NM=/bin/nm
+M_INSTALL=cp gdb.z $(ddestdir)/man/man1
--- /dev/null
+# Target: Motorola 88000
+TDEPFILES= m88k-tdep.o m88k-pinsn.o
+TM_FILE= tm-delta88.h
--- /dev/null
+# Host: Motorola 88000 running DGUX
+XDEPFILES=
+XM_FILE= xm-m88k.h
+NAT_FILE= nm-m88k.h
+NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o m88k-nat.o
--- /dev/null
+# Target: Motorola 88000 Binary Compatability Standard
+TDEPFILES= m88k-tdep.o m88k-pinsn.o
+TM_FILE= tm-m88k.h
--- /dev/null
+/* Native support macros for m88k, for GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 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. */
+
+#define FETCH_INFERIOR_REGISTERS
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = m88k_register_u_addr ((blockend),(regno));
--- /dev/null
+/* Target machine description for Motorola Delta 88 box, for GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "m88k/tm-m88k.h"
+
+/* BCS is a standard for binary compatibility. This machine uses it. */
+#if !defined (BCS)
+#define BCS 1
+#endif
+
+#define DELTA88
--- /dev/null
+/* Target machine description for generic Motorola 88000, for GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 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. */
+
+/* g++ support is not yet included. */
+
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+/* We cache information about saved registers in the frame structure,
+ to save us from having to re-scan function prologues every time
+ a register in a non-current frame is accessed. */
+
+#define EXTRA_FRAME_INFO \
+ struct frame_saved_regs *fsr; \
+ CORE_ADDR locals_pointer; \
+ CORE_ADDR args_pointer;
+
+/* Zero the frame_saved_regs pointer when the frame is initialized,
+ so that FRAME_FIND_SAVED_REGS () will know to allocate and
+ initialize a frame_saved_regs struct the first time it is called.
+ Set the arg_pointer to -1, which is not valid; 0 and other values
+ indicate real, cached values. */
+
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
+ init_extra_frame_info (fromleaf, fi)
+extern void init_extra_frame_info ();
+
+#define IEEE_FLOAT
+
+/* 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. */
+
+#define SKIP_PROLOGUE(frompc) \
+ skip_prologue (frompc)
+extern CORE_ADDR skip_prologue ();
+
+/* The m88k kernel aligns all instructions on 4-byte boundaries. The
+ kernel also uses the least significant two bits for its own hocus
+ pocus. When gdb receives an address from the kernel, it needs to
+ preserve those right-most two bits, but gdb also needs to be careful
+ to realize that those two bits are not really a part of the address
+ of an instruction. Shrug. */
+
+#define ADDR_BITS_REMOVE(addr) ((addr) & ~3)
+#define ADDR_BITS_SET(addr) (((addr) | 0x00000002) - 4)
+
+/* 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) \
+ (ADDR_BITS_REMOVE (read_register (SRP_REGNUM)))
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+/* instruction 0xF000D1FF is 'tb0 0,r0,511'
+ If Bit bit 0 of r0 is clear (always true),
+ initiate exception processing (trap).
+ */
+#define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+/* 'jmp r1' or 'jmp.n r1' is used to return from a subroutine. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 2) == 0xF800)
+
+/* Return 1 if P points to an invalid floating point value.
+ LEN is the length in bytes. */
+
+#define INVALID_FLOAT(p, len) IEEE_isNAN(p,len)
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 38
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES {\
+ "r0",\
+ "r1",\
+ "r2",\
+ "r3",\
+ "r4",\
+ "r5",\
+ "r6",\
+ "r7",\
+ "r8",\
+ "r9",\
+ "r10",\
+ "r11",\
+ "r12",\
+ "r13",\
+ "r14",\
+ "r15",\
+ "r16",\
+ "r17",\
+ "r18",\
+ "r19",\
+ "r20",\
+ "r21",\
+ "r22",\
+ "r23",\
+ "r24",\
+ "r25",\
+ "r26",\
+ "r27",\
+ "r28",\
+ "r29",\
+ "r30",\
+ "r31",\
+ "psr",\
+ "fpsr",\
+ "fpcr",\
+ "sxip",\
+ "snip",\
+ "sfip",\
+ "vbr",\
+ "dmt0",\
+ "dmd0",\
+ "dma0",\
+ "dmt1",\
+ "dmd1",\
+ "dma1",\
+ "dmt2",\
+ "dmd2",\
+ "dma2",\
+ "sr0",\
+ "sr1",\
+ "sr2",\
+ "sr3",\
+ "fpecr",\
+ "fphs1",\
+ "fpls1",\
+ "fphs2",\
+ "fpls2",\
+ "fppt",\
+ "fprh",\
+ "fprl",\
+ "fpit",\
+ "fpsr",\
+ "fpcr",\
+ }
+
+
+/* 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 SRP_REGNUM 1 /* Contains subroutine return pointer */
+#define RV_REGNUM 2 /* Contains simple return values */
+#define SRA_REGNUM 12 /* Contains address of struct return values */
+#define FP_REGNUM 31 /* Reg fetched to locate frame when pgm stops */
+#define SP_REGNUM 31 /* Contains address of top of stack */
+#define SXIP_REGNUM 35 /* Contains Shadow Execute Instruction Pointer */
+#define SNIP_REGNUM 36 /* Contains Shadow Next Instruction Pointer */
+#define PC_REGNUM SXIP_REGNUM /* Program Counter */
+#define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */
+#define PSR_REGNUM 32 /* Processor Status Register */
+#define FPSR_REGNUM 33 /* Floating Point Status Register */
+#define FPCR_REGNUM 34 /* Floating Point Control Register */
+#define SFIP_REGNUM 37 /* Contains Shadow Fetched Intruction pointer */
+#define NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */
+
+/* PSR status bit definitions. */
+
+#define PSR_MODE 0x80000000
+#define PSR_BYTE_ORDER 0x40000000
+#define PSR_SERIAL_MODE 0x20000000
+#define PSR_CARRY 0x10000000
+#define PSR_SFU_DISABLE 0x000003f0
+#define PSR_SFU1_DISABLE 0x00000008
+#define PSR_MXM 0x00000004
+#define PSR_IND 0x00000002
+#define PSR_SFRZ 0x00000001
+
+/* BCS requires that the SXIP_REGNUM (or PC_REGNUM) contain the address
+ of the next instr to be executed when a breakpoint occurs. Because
+ the kernel gets the next instr (SNIP_REGNUM), the instr in SNIP needs
+ to be put back into SFIP, and the instr in SXIP should be shifted
+ to SNIP */
+
+/* Are you sitting down? It turns out that the 88K BCS (binary compatibility
+ standard) folks originally felt that the debugger should be responsible
+ for backing up the IPs, not the kernel (as is usually done). Well, they
+ have reversed their decision, and in future releases our kernel will be
+ handling the backing up of the IPs. So, eventually, we won't need to
+ do the SHIFT_INST_REGS stuff. But, for now, since there are 88K systems out
+ there that do need the debugger to do the IP shifting, and since there
+ will be systems where the kernel does the shifting, the code is a little
+ more complex than perhaps it needs to be (we still go inside SHIFT_INST_REGS,
+ and if the shifting hasn't occurred then gdb goes ahead and shifts). */
+
+#define SHIFT_INST_REGS
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. */
+
+#define REGISTER_RAW_SIZE(N) 4
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+
+#define REGISTER_BYTES (NUM_REGS * REGISTER_RAW_SIZE(0))
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) ((N)*REGISTER_RAW_SIZE(0))
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+#define REGISTER_VIRTUAL_SIZE(N) (REGISTER_RAW_SIZE(N))
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE (REGISTER_RAW_SIZE(0))
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have.
+/* Are FPS1, FPS2, FPR "virtual" regisers? */
+
+#define MAX_REGISTER_VIRTUAL_SIZE (REGISTER_RAW_SIZE(0))
+
+/* 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) \
+ {bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM));}
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ {bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM));}
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
+
+/* The 88k call/return conventions call for "small" values to be returned
+ into consecutive registers starting from r2. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (&(((char *)REGBUF)[REGISTER_BYTE(RV_REGNUM)]), (VALBUF), TYPE_LENGTH (TYPE))
+
+#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (2*REGISTER_RAW_SIZE(0), (VALBUF), TYPE_LENGTH (TYPE))
+
+/* In COFF, if PCC says a parameter is a short or a char, do not
+ change it to int (it seems the convention is to change it). */
+
+#define BELIEVE_PCC_PROMOTION 1
+
+/* 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.
+
+ However, if FRAME_CHAIN_VALID returns zero,
+ it means the given frame is the outermost one and has no caller. */
+
+extern CORE_ADDR frame_chain ();
+extern int frame_chain_valid ();
+extern int frameless_function_invocation ();
+
+#define FRAME_CHAIN(thisframe) \
+ frame_chain (thisframe)
+
+#define FRAME_CHAIN_VALID(chain, thisframe) \
+ frame_chain_valid (chain, thisframe)
+
+#define FRAMELESS_FUNCTION_INVOCATION(frame, fromleaf) \
+ fromleaf = frameless_function_invocation (frame)
+
+/* Define other aspects of the stack frame. */
+
+#define FRAME_SAVED_PC(FRAME) \
+ frame_saved_pc (FRAME)
+extern CORE_ADDR frame_saved_pc ();
+
+#define FRAME_ARGS_ADDRESS(fi) \
+ frame_args_address (fi)
+extern CORE_ADDR frame_args_address ();
+
+#define FRAME_LOCALS_ADDRESS(fi) \
+ frame_locals_address (fi)
+extern CORE_ADDR frame_locals_address ();
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* 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. */
+
+/* On the 88k, parameter registers get stored into the so called "homing"
+ area. This *always* happens when you compiled with GCC and use -g.
+ Also, (with GCC and -g) the saving of the parameter register values
+ always happens right within the function prologue code, so these register
+ values can generally be relied upon to be already copied into their
+ respective homing slots by the time you will normally try to look at
+ them (we hope).
+
+ Note that homing area stack slots are always at *positive* offsets from
+ the frame pointer. Thus, the homing area stack slots for the parameter
+ registers (passed values) for a given function are actually part of the
+ frame area of the caller. This is unusual, but it should not present
+ any special problems for GDB.
+
+ Note also that on the 88k, we are only interested in finding the
+ registers that might have been saved in memory. This is a subset of
+ the whole set of registers because the standard calling sequence allows
+ the called routine to clobber many registers.
+
+ We could manage to locate values for all of the so called "preserved"
+ registers (some of which may get saved within any particular frame) but
+ that would require decoding all of the tdesc information. Tht would be
+ nice information for GDB to have, but it is not strictly manditory if we
+ can live without the ability to look at values within (or backup to)
+ previous frames.
+*/
+
+#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+ frame_find_saved_regs (frame_info, &frame_saved_regs)
+
+\f
+/* There is not currently a functioning way to call functions in the
+ inferior. */
+
+/* But if there was this is where we'd put the call dummy. */
+/* #define CALL_DUMMY_LOCATION AFTER_TEXT_END */
+
+/* When popping a frame on the 88k (say when doing a return command), the
+ calling function only expects to have the "preserved" registers restored.
+ Thus, those are the only ones that we even try to restore here. */
+
+#define POP_FRAME pop_frame ()
+extern void pop_frame ();
--- /dev/null
+/* Host machine description for Motorola Delta 88 system, for GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 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. */
+
+#define HOST_BYTE_ORDER BIG_ENDIAN
+
+#if !defined (USG)
+#define USG 1
+#endif
+
+#include <sys/param.h>
+#include <sys/time.h>
+
+#define HAVE_TERMIO
+
+/*#define USIZE 2048*/
+#define NBPG NBPC
+#define UPAGES USIZE
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+
+/* Since registers r0 through r31 are stored directly in the struct ptrace_user,
+ (for m88k BCS)
+ the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */
+
+#define KERNEL_U_ADDR 0
+
--- /dev/null
+/* Host-machine dependent parameters for Motorola 88000, for GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 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 BIG_ENDIAN
+
+#if !defined (USG)
+#define USG 1
+#endif
+
+#include <sys/param.h>
+
+#ifdef __GNUC__
+#define memcpy __builtin_memcpy
+/* gcc doesn't have this, at least not gcc 1.92. */
+/* #define memset __builtin_memset */
+#define strcmp __builtin_strcmp
+#endif
+
+#ifdef DGUX
+#define x_foff _x_x._x_offset
+#define x_fname _x_name
+#define USER ptrace_user
+#define _BSD_WAIT_FLAVOR
+#endif
+
+#define HAVE_TERMIO
+
+#ifndef USIZE
+#define USIZE 2048
+#endif
+#define NBPG NBPC
+#define UPAGES USIZE
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+
+/* Since registers r0 through r31 are stored directly in the struct ptrace_user,
+ (for m88k BCS)
+ the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */
+
+#define KERNEL_U_ADDR 0
+
--- /dev/null
+# Host: Big-endian MIPS machine such as Sony News
+XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+XM_FILE= xm-bigmips.h
--- /dev/null
+# Target: Big-endian MIPS machine such as Sony News
+TDEPFILES= mips-pinsn.o mips-tdep.o exec.o
+TM_FILE= tm-bigmips.h
--- /dev/null
+# Host: Little-endian MIPS machine such as DECstation.
+XDEPFILES=
+XM_FILE= xm-mips.h
+NAT_FILE= nm-mips.h
+NATDEPFILES= infptrace.o inftarg.o corelow.o mips-nat.o fork-child.o
+
+# We can't use MMALLOC because the DECstation RPC library can't cope
+# with a malloc(0) that returns 0. Besides, it's useless on a machine
+# without a real mmap().
+MMALLOC_LIB =
+MMALLOC_DISABLE = -DNO_MMALLOC
--- /dev/null
+# Target: Little-endian MIPS machine such as DECstation.
+TDEPFILES= mips-pinsn.o mips-tdep.o exec.o
+TM_FILE= tm-mips.h
--- /dev/null
+# Target: Big-endian IDT board.
+TDEPFILES= mips-pinsn.o mips-tdep.o exec.o remote-mips.o
+TM_FILE= tm-bigmips.h
--- /dev/null
+# Host: SGI Iris running irix 3.x
+XDEPFILES=
+XM_FILE= xm-irix3.h
+NAT_FILE= nm-irix3.h
+NATDEPFILES= fork-child.o corelow.o infptrace.o inftarg.o mips-nat.o
+ALLOCA=alloca.o
+ALLOCA1=alloca.o
+MUNCH_DEFINE=-B
+XM_CLIBS=-lbsd
--- /dev/null
+# Target: SGI mips
+TDEPFILES= mips-pinsn.o mips-tdep.o exec.o
+TM_FILE= tm-irix3.h
--- /dev/null
+# Host: SGI Iris running irix 4.x
+XDEPFILES=
+XM_FILE= xm-irix4.h
+NAT_FILE= nm-irix4.h
+NATDEPFILES= fork-child.o procfs.o irix4-nat.o
+ALLOCA=alloca.o
+ALLOCA1=alloca.o
+MUNCH_DEFINE=-B
+XM_CLIBS=-lbsd -lsun
+INSTALL = cp
+# use cc in K&R mode, bump up some static compiler tables.
+CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1100
--- /dev/null
+# Host: Little-endian MIPS machine such as DECstation.
+XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+XM_FILE= xm-mips.h
--- /dev/null
+# Target: Little-endian MIPS machine such as DECstation.
+TDEPFILES= mips-pinsn.o mips-tdep.o exec.o
+TM_FILE= tm-mips.h
--- /dev/null
+/* Definitions for SGI irix3 native support.
+ Copyright 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. */
+
+/* Don't need special routines for Irix v3 -- we can use infptrace.c */
+#undef FETCH_INFERIOR_REGISTERS
+
+#define U_REGS_OFFSET 0
+
+/* Figure out where the longjmp will land. We expect that we have just entered
+ longjmp and haven't yet setup the stack frame, so the args are still in the
+ argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we
+ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
+ This routine returns true on success */
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
--- /dev/null
+/* Definitions for native support of irix4.
+
+Copyright (C) 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. */
+
+/*
+ * Let's use /debug instead of all this dangerous mucking about
+ * with ptrace(), which seems *extremely* fragile, anyway.
+ */
+#define USE_PROC_FS
+#define PROC_NAME_FMT "/debug/%d"
+
+/* Don't need special routines for the SGI -- we can use infptrace.c */
+#undef FETCH_INFERIOR_REGISTERS
+
+#define U_REGS_OFFSET 0
--- /dev/null
+/* Definitions for GDB on mips.
+ Copyright (C) 1986, 1987, 1989, 1992 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. */
+
+/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
+#define FETCH_INFERIOR_REGISTERS
+
+/* Figure out where the longjmp will land. We expect that we have just entered
+ longjmp and haven't yet setup the stack frame, so the args are still in the
+ argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we
+ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
+ This routine returns true on success */
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
--- /dev/null
+/* 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. */
+
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+#include "mips/tm-mips.h"
--- /dev/null
+/* Target machine description for SGI Iris under Irix, for GDB.
+ Copyright 1990, 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. */
+
+#include "coff/sym.h" /* Needed for PDR below. */
+#include "coff/symconst.h"
+
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+/* Floating point is IEEE compliant */
+#define IEEE_FLOAT
+
+/* SGI's assembler doesn't grok dollar signs in identifiers.
+ So we use dots instead. This item must be coordinated with G++. */
+#undef CPLUS_MARKER
+#define CPLUS_MARKER '.'
+
+/* 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. */
+
+#define SKIP_PROLOGUE(pc) pc = mips_skip_prologue(pc)
+
+/* 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_register(RA_REGNUM)
+
+/* Are we currently handling a signal */
+
+#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name)
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR (0x7ffff000)
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+#define BREAKPOINT {0, 0x5, 0, 0xd}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. "j ra" on mips. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x3e00008)
+
+/* Return 1 if P points to an invalid floating point value. */
+
+#define INVALID_FLOAT(p,l) isa_NAN(p,l)
+
+/* Say how long (all) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 71
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES \
+ { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
+ "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
+ "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
+ "pc", "cause", "bad", "hi", "lo", "fsr", "fir" \
+ }
+
+/* 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 ZERO_REGNUM 0 /* read-only register, always 0 */
+#define A0_REGNUM 4 /* Loc of first arg during a subr call */
+#define SP_REGNUM 29 /* Contains address of top of stack */
+#define FP_REGNUM 30 /* Pseudo register that contains true address of executing stack frame */
+#define RA_REGNUM 31 /* Contains return address value */
+#define FP0_REGNUM 32 /* Floating point register 0 (single float) */
+#define PC_REGNUM 64 /* Contains program counter */
+#define PS_REGNUM 65 /* Contains processor status */
+#define HI_REGNUM 67 /* Multiple/divide temp */
+#define LO_REGNUM 68 /* ... */
+#define FCRCS_REGNUM 69 /* FP control/status */
+#define FCRIR_REGNUM 70 /* FP implementation/revision */
+
+/* Define DO_REGISTERS_INFO() to do machine-specific formatting
+ of register dumps. */
+
+#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (NUM_REGS*4)
+
+/* 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 mips, 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 mips, 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) \
+ bcopy ((FROM), (TO), 4);
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), 4);
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
+/* 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) \
+ { sp = push_word(sp, 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. XXX floats */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF+REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF+16))
+
+/* Structures are returned by ref in extra arg0 */
+#define USE_STRUCT_CONVENTION(gcc_p, type) 1
+
+\f
+/* 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. */
+
+#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
+
+/* 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. */
+/* We handle this differently for mips, and maybe we should not */
+
+#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
+
+/* Saved Pc. */
+
+#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME))
+
+#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
+
+#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(num, fi) (num = mips_frame_num_args(fi))
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* 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) ( \
+ (frame_saved_regs) = *(frame_info)->saved_regs, \
+ (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame)
+
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Stack has strict alignment. However, use PUSH_ARGUMENTS
+ to take care of it. */
+/*#define STACK_ALIGN(addr) (((addr)+3)&~3)*/
+
+#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+ sp = mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME mips_push_dummy_frame()
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME mips_pop_frame()
+
+#define MK_OP(op,rs,rt,offset) (((op)<<26)|((rs)<<21)|((rt)<<16)|(offset))
+#define CALL_DUMMY_SIZE (16*4)
+#define Dest_Reg 2
+#define CALL_DUMMY {\
+ MK_OP(0,RA_REGNUM,0,8), /* jr $ra # Fake ABOUT_TO_RETURN ...*/\
+ 0, /* nop # ... to stop raw backtrace*/\
+ 0x27bd0000, /* addu sp,?0 # Pseudo prologue */\
+/* Start here: */\
+ MK_OP(061,SP_REGNUM,12,0), /* lwc1 $f12,0(sp) # Reload first 4 args*/\
+ MK_OP(061,SP_REGNUM,13,4), /* lwc1 $f13,4(sp) */\
+ MK_OP(061,SP_REGNUM,14,8), /* lwc1 $f14,8(sp) */\
+ MK_OP(061,SP_REGNUM,15,12), /* lwc1 $f15,12(sp) */\
+ MK_OP(043,SP_REGNUM,4,0), /* lw $r4,0(sp) # Re-load FP regs*/\
+ MK_OP(043,SP_REGNUM,5,4), /* lw $r5,4(sp) */\
+ MK_OP(043,SP_REGNUM,6,8), /* lw $r6,8(sp) */\
+ MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
+ (017<<26)| (Dest_Reg << 16), /* lui $r31,<target upper 16 bits>*/\
+ MK_OP(13,Dest_Reg,Dest_Reg,0), /* ori $r31,$r31,<lower 16 bits>*/ \
+ (Dest_Reg<<21) | (31<<11) | 9, /* jalr $r31 */\
+ MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
+ 0x5000d, /* bpt */\
+}
+
+#define CALL_DUMMY_START_OFFSET 12
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p)\
+ (((int*)dummyname)[11] |= (((unsigned long)(fun)) >> 16), \
+ ((int*)dummyname)[12] |= (unsigned short)(fun))
+
+/* Specific information about a procedure.
+ This overlays the MIPS's PDR records,
+ mipsread.c (ab)uses this to save memory */
+
+typedef struct mips_extra_func_info {
+ long numargs; /* number of args to procedure (was iopt) */
+ PDR pdr; /* Procedure descriptor record */
+} *mips_extra_func_info_t;
+
+#define EXTRA_FRAME_INFO \
+ mips_extra_func_info_t proc_desc; \
+ int num_args;\
+ struct frame_saved_regs *saved_regs;
+
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
+
+/* Special symbol found in blocks associated with routines. We can hang
+ mips_extra_func_info_t's off of this. */
+
+#define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"
--- /dev/null
+/* Definitions to make GDB run on a mips box under 4.3bsd.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993 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. */
+
+#include "coff/sym.h" /* Needed for PDR below. */
+#include "coff/symconst.h"
+
+#if !defined (TARGET_BYTE_ORDER)
+#define TARGET_BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+/* Floating point is IEEE compliant */
+#define IEEE_FLOAT
+
+/* Some MIPS boards are provided both with and without a floating
+ point coprocessor; we provide a user settable variable to tell gdb
+ whether there is one or not. */
+extern int mips_fpu;
+
+/* 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. */
+
+#define SKIP_PROLOGUE(pc) pc = mips_skip_prologue(pc)
+
+/* 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_register(RA_REGNUM)
+
+/* Are we currently handling a signal */
+
+#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name)
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR (0x7ffff000)
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+#define BIG_ENDIAN 4321
+#if TARGET_BYTE_ORDER == BIG_ENDIAN
+#define BREAKPOINT {0, 0x5, 0, 0xd}
+#else
+#define BREAKPOINT {0xd, 0, 0x5, 0}
+#endif
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. "j ra" on mips. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x3e00008)
+
+/* Return 1 if P points to an invalid floating point value. */
+
+#define INVALID_FLOAT(p,l) isa_NAN(p,l)
+
+/* Say how long (all) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 80
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES \
+ { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
+ "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
+ "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \
+ "sr", "lo", "hi", "bad", "cause","pc", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
+ "fsr", "fir", "fp", "inx", "rand", "tlblo","ctxt", "tlbhi",\
+ "epc", "prid"\
+ }
+
+/* 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 ZERO_REGNUM 0 /* read-only register, always 0 */
+#define A0_REGNUM 4 /* Loc of first arg during a subr call */
+#define SP_REGNUM 29 /* Contains address of top of stack */
+#define RA_REGNUM 31 /* Contains return address value */
+#define PS_REGNUM 32 /* Contains processor status */
+#define HI_REGNUM 34 /* Multiple/divide temp */
+#define LO_REGNUM 33 /* ... */
+#define BADVADDR_REGNUM 35 /* bad vaddr for addressing exception */
+#define CAUSE_REGNUM 36 /* describes last exception */
+#define PC_REGNUM 37 /* Contains program counter */
+#define FP0_REGNUM 38 /* Floating point register 0 (single float) */
+#define FCRCS_REGNUM 70 /* FP control/status */
+#define FCRIR_REGNUM 71 /* FP implementation/revision */
+#define FP_REGNUM 72 /* Pseudo register that contains true address of executing stack frame */
+#define FIRST_EMBED_REGNUM 73 /* First supervisor register for embedded use */
+#define LAST_EMBED_REGNUM 79 /* Last one */
+
+/* Define DO_REGISTERS_INFO() to do machine-specific formatting
+ of register dumps. */
+
+#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (NUM_REGS*4)
+
+/* 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 mips, 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 mips, 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) \
+ bcopy ((FROM), (TO), 4);
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), 4);
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) \
+ ? builtin_type_float : builtin_type_int) \
+
+/* 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) \
+ { sp = push_word(sp, 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. XXX floats */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF + REGISTER_BYTE ((TYPE_CODE (TYPE) == TYPE_CODE_FLT && mips_fpu) ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (REGISTER_BYTE ((TYPE_CODE (TYPE) == TYPE_CODE_FLT && mips_fpu) ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF+16))
+
+/* Structures are returned by ref in extra arg0 */
+#define USE_STRUCT_CONVENTION(gcc_p, type) 1
+
+\f
+/* 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. */
+
+#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
+
+/* 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. */
+/* We handle this differently for mips, and maybe we should not */
+
+#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
+
+/* Saved Pc. */
+
+#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME))
+
+#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
+
+#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(num, fi) (num = mips_frame_num_args(fi))
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* 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) ( \
+ (frame_saved_regs) = *(frame_info)->saved_regs, \
+ (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame)
+
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Stack has strict alignment. However, use PUSH_ARGUMENTS
+ to take care of it. */
+/*#define STACK_ALIGN(addr) (((addr)+3)&~3)*/
+
+#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+ sp = mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME mips_push_dummy_frame()
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME mips_pop_frame()
+
+#define MK_OP(op,rs,rt,offset) (((op)<<26)|((rs)<<21)|((rt)<<16)|(offset))
+#define CALL_DUMMY_SIZE (16*4)
+#define Dest_Reg 2
+#define CALL_DUMMY {\
+ MK_OP(0,RA_REGNUM,0,8), /* jr $ra # Fake ABOUT_TO_RETURN ...*/\
+ 0, /* nop # ... to stop raw backtrace*/\
+ 0x27bd0000, /* addu sp,?0 # Pseudo prologue */\
+/* Start here: */\
+ MK_OP(061,SP_REGNUM,12,0), /* lwc1 $f12,0(sp) # Reload FP regs*/\
+ MK_OP(061,SP_REGNUM,13,4), /* lwc1 $f13,4(sp) */\
+ MK_OP(061,SP_REGNUM,14,8), /* lwc1 $f14,8(sp) */\
+ MK_OP(061,SP_REGNUM,15,12), /* lwc1 $f15,12(sp) */\
+ MK_OP(043,SP_REGNUM,4,0), /* lw $r4,0(sp) # Reload first 4 args*/\
+ MK_OP(043,SP_REGNUM,5,4), /* lw $r5,4(sp) */\
+ MK_OP(043,SP_REGNUM,6,8), /* lw $r6,8(sp) */\
+ MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
+ (017<<26)| (Dest_Reg << 16), /* lui $r31,<target upper 16 bits>*/\
+ MK_OP(13,Dest_Reg,Dest_Reg,0), /* ori $r31,$r31,<lower 16 bits>*/ \
+ (Dest_Reg<<21) | (31<<11) | 9, /* jalr $r31 */\
+ MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
+ 0x5000d, /* bpt */\
+}
+
+#define CALL_DUMMY_START_OFFSET 12
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p)\
+ do \
+ { \
+ ((int*)(dummyname))[11] |= ((unsigned long)(fun)) >> 16; \
+ ((int*)(dummyname))[12] |= (unsigned short)(fun); \
+ if (! mips_fpu) \
+ { \
+ ((int *) (dummyname))[3] = 0; \
+ ((int *) (dummyname))[4] = 0; \
+ ((int *) (dummyname))[5] = 0; \
+ ((int *) (dummyname))[6] = 0; \
+ } \
+ } \
+ while (0)
+
+/* There's a mess in stack frame creation. See comments in blockframe.c
+ near reference to INIT_FRAME_PC_FIRST. */
+
+#define INIT_FRAME_PC(fromleaf, prev) /* nada */
+
+#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
+ (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
+ (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ());
+
+/* Special symbol found in blocks associated with routines. We can hang
+ mips_extra_func_info_t's off of this. */
+
+#define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"
+
+/* Specific information about a procedure.
+ This overlays the MIPS's PDR records,
+ mipsread.c (ab)uses this to save memory */
+
+typedef struct mips_extra_func_info {
+ long numargs; /* number of args to procedure (was iopt) */
+ PDR pdr; /* Procedure descriptor record */
+} *mips_extra_func_info_t;
+
+#define EXTRA_FRAME_INFO \
+ mips_extra_func_info_t proc_desc; \
+ int num_args;\
+ struct frame_saved_regs *saved_regs;
+
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
+
+#define PRINT_EXTRA_FRAME_INFO(fi) \
+ { \
+ if (fi && fi->proc_desc && fi->proc_desc->pdr.framereg < NUM_REGS) \
+ printf_filtered (" frame pointer is at %s+%d\n", \
+ reg_names[fi->proc_desc->pdr.framereg], \
+ fi->proc_desc->pdr.frameoffset); \
+ }
+
+/* It takes two values to specify a frame on the MIPS. Sigh.
+
+ In fact, at the moment, the *PC* is the primary value that sets up
+ a frame. The PC is looked up to see what function it's in; symbol
+ information from that function tells us which register is the frame
+ pointer base, and what offset from there is the "virtual frame pointer".
+ (This is usually an offset from SP.) FIXME -- this should be cleaned
+ up so that the primary value is the SP, and the PC is used to disambiguate
+ multiple functions with the same SP that are at different stack levels. */
+
+#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
+/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
+ and equivalence between CORE_ADDR and FRAME_ADDR. */
+extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
+
+#define STAB_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)
--- /dev/null
+/* 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. */
+
+#define HOST_BYTE_ORDER BIG_ENDIAN
+
+#include "mips/xm-mips.h"
--- /dev/null
+/* Copyright (C) 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. */
+
+/* This is for the iris. */
+
+#define HAVE_TERMIO
+
+#include "mips/xm-bigmips.h"
+
+/* Override register locations in upage for SGI machines */
+#undef REGISTER_U_ADDR
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ if (regno < PC_REGNUM) \
+ addr = regno; \
+ else \
+ addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
+
--- /dev/null
+/* Definitions for irix4 hosting support.
+
+Copyright (C) 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. */
+
+/* This is for the iris. */
+
+#define HAVE_TERMIO
+
+#include "mips/xm-bigmips.h"
+
+/* Override register locations in upage for SGI machines */
+#undef REGISTER_U_ADDR
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ if (regno < PC_REGNUM) \
+ addr = regno; \
+ else \
+ addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
+
+/* BEGIN GW MODS */
+/* Irix defines psignal() in signal.h, which gets gcc rather angry at us
+ * because their definition is markedly different.
+ */
+#define PSIGNAL_IN_SIGNAL_H
+
+#define BROKEN_SIGINFO_H /* <sys/siginfo.h> si_pid & si_uid are bogus */
--- /dev/null
+/* 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
+
+#ifdef ultrix
+/* Needed for DECstation core files. */
+#include <machine/param.h>
+#define KERNEL_U_ADDR UADDR
+#endif
+
+#ifdef ultrix
+extern char *strdup();
+#endif
+
+/* DECstation memcpy and memset return void *, not char *. */
+
+extern void *memcpy();
+extern void *memset();
+#define MEM_FNS_DECLARED
+
+#if ! defined (__STDC__) && ! defined (offsetof)
+# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
+
+/* Only used for core files on DECstations.
+ First four registers at u.u_ar0 are saved arguments, and
+ there is no r0 saved. Float registers are saved
+ in u_pcb.pcb_fpregs, not relative to u.u_ar0. */
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ { \
+ if (regno < FP0_REGNUM) \
+ addr = blockend + sizeof(int) * (4 + regno - 1); \
+ else \
+ addr = offsetof (struct user, u_pcb.pcb_fpregs[0]) + \
+ sizeof (int) * (regno - FP0_REGNUM); \
+ }
+
+/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
+#define ONE_PROCESS_WRITETEXT
--- /dev/null
+# Host: "no target". This can be used to build you
+# a Makefile that only runs administrative commands like 'clean',
+# 'gdb.tar.Z', etc.
--- /dev/null
+# Target: "no target".
+# This can be used to build you a Makefile that only runs administrative
+# commands like 'clean', 'gdb.tar.Z', etc.
--- /dev/null
+# Host: Merlin running utek 2.1
+XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+XM_FILE= xm-merlin.h
+# See SHELL_FILE in m-merlin.h for a explanation of this.
+M_INSTALL=cp /bin/sh /usr/local/lib/gdb-sh; \
+chmod ogu+rw /usr/local/lib/gdb-sh
--- /dev/null
+# Target: Merlin running utek 2.1
+TDEPFILES= exec.o ns32k-pinsn.o
+TM_FILE= tm-merlin.h
--- /dev/null
+/* Definitions to make GDB run on an encore under umax 4.2
+ 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. */
+
+/* Do implement the attach and detach commands... */
+#define ATTACH_DETACH
+
+/* Offset of registers within u area. */
+#define U_REGS_OFFSET 0
+
+/* called from register_addr() -- blockend not used for now */
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ \
+ switch (regno) { \
+ case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: \
+ addr = PU_R0 - (regno * sizeof (int)); break; \
+ case SP_REGNUM: \
+ addr = PU_SP; break; \
+ case PC_REGNUM: \
+ addr = PU_PC; break; \
+ case FP_REGNUM: \
+ addr = PU_FP; break; \
+ case PS_REGNUM: \
+ addr = PU_PSL; break; \
+ case FPS_REGNUM: \
+ addr = PU_FSR; break; \
+ case FP0_REGNUM + 0: case FP0_REGNUM + 1: \
+ case FP0_REGNUM + 2: case FP0_REGNUM + 3: \
+ case FP0_REGNUM + 4: case FP0_REGNUM + 5: \
+ case FP0_REGNUM + 6: case FP0_REGNUM + 7: \
+ addr = PU_F0 + (regno - FP0_REGNUM) * sizeof (float); break; \
+ case LP0_REGNUM + 0: case LP0_REGNUM + 1: \
+ case LP0_REGNUM + 2: case LP0_REGNUM + 3: \
+ addr = PU_F0 + (regno - LP0_REGNUM) * sizeof (double); break; \
+ default: \
+ printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
+ abort (); \
+ } \
+}
--- /dev/null
+/* Definitions to target GDB to a merlin under utek 2.1
+ 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 TARGET_BYTE_ORDER LITTLE_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. */
+
+#define SKIP_PROLOGUE(pc) \
+{ register int op = read_memory_integer (pc, 1); \
+ if (op == 0x82) \
+ { op = read_memory_integer (pc+2,1); \
+ if ((op & 0x80) == 0) pc += 3; \
+ else if ((op & 0xc0) == 0x80) pc += 4; \
+ else pc += 6; \
+ }}
+
+/* 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)
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR (0x800000)
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0xf2}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)
+
+/* Return 1 if P points to an invalid floating point value. */
+
+#define INVALID_FLOAT(p, len) 0
+
+/* Define this to say that the "svc" insn is followed by
+ codes in memory saying which kind of system call it is. */
+
+#define NS32K_SVC_IMMED_OPERANDS
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 25
+
+#define NUM_GENERAL_REGS 8
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "pc", "sp", "fp", "ps", \
+ "fsr", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "l0", "l1", "l2", "l3", "l4", \
+ }
+
+/* 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 AP_REGNUM FP_REGNUM
+#define FP_REGNUM 10 /* Contains address of executing stack frame */
+#define SP_REGNUM 9 /* Contains address of top of stack */
+#define PC_REGNUM 8 /* Contains program counter */
+#define PS_REGNUM 11 /* Contains processor status */
+#define FPS_REGNUM 12 /* Floating point status register */
+#define FP0_REGNUM 13 /* Floating point register 0 */
+#define LP0_REGNUM 21 /* Double register 0 (same as FP0) */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES ((NUM_REGS - 4) * sizeof (int) + 4 * sizeof (double))
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) ((N) >= LP0_REGNUM ? \
+ LP0_REGNUM * 4 + ((N) - LP0_REGNUM) * 8 : (N) * 4)
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. On the 32000, all regs are 4 bytes
+ except for the doubled floating registers. */
+
+#define REGISTER_RAW_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. On the 32000, all regs are 4 bytes
+ except for the doubled floating registers. */
+
+#define REGISTER_VIRTUAL_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 8
+
+/* 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) 0
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ ((N) >= FP0_REGNUM ? \
+ ((N) >= LP0_REGNUM ? \
+ builtin_type_double \
+ : builtin_type_float) \
+ : builtin_type_int)
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function.
+
+ On this machine this is a no-op, as gcc doesn't run on it yet.
+ This calling convention is not used. */
+
+#define STORE_STRUCT_RETURN(ADDR, SP)
+
+/* 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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF))
+\f
+/* 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 Merlin, the frame's nominal address is the FP value,
+ and at that address is saved previous FP value as a 4-byte word. */
+
+#define FRAME_CHAIN(thisframe) \
+ (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer ((thisframe)->frame, 4) :\
+ 0)
+
+/* Define other aspects of the stack frame. */
+
+#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
+
+/* compute base of arguments */
+#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
+
+#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(numargs, fi) \
+{ CORE_ADDR pc; \
+ int insn; \
+ int addr_mode; \
+ int width; \
+ \
+ pc = FRAME_SAVED_PC (fi); \
+ insn = read_memory_integer (pc,2); \
+ addr_mode = (insn >> 11) & 0x1f; \
+ insn = insn & 0x7ff; \
+ if ((insn & 0x7fc) == 0x57c \
+ && addr_mode == 0x14) /* immediate */ \
+ { if (insn == 0x57c) /* adjspb */ \
+ width = 1; \
+ else if (insn == 0x57d) /* adjspw */ \
+ width = 2; \
+ else if (insn == 0x57f) /* adjspd */ \
+ width = 4; \
+ numargs = read_memory_integer (pc+2,width); \
+ if (width > 1) \
+ flip_bytes (&numargs, width); \
+ numargs = - sign_extend (numargs, width*8) / 4; } \
+ else numargs = -1; \
+}
+
+/* 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. */
+
+#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+{ int regmask,regnum; \
+ int localcount; \
+ CORE_ADDR enter_addr; \
+ CORE_ADDR next_addr; \
+ \
+ enter_addr = get_pc_function_start ((frame_info)->pc); \
+ regmask = read_memory_integer (enter_addr+1, 1); \
+ localcount = ns32k_localcount (enter_addr); \
+ next_addr = (frame_info)->frame + localcount; \
+ for (regnum = 0; regnum < 8; regnum++, regmask >>= 1) \
+ (frame_saved_regs).regs[regnum] \
+ = (regmask & 1) ? (next_addr -= 4) : 0; \
+ (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4; \
+ (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \
+ (frame_saved_regs).regs[FP_REGNUM] \
+ = read_memory_integer ((frame_info)->frame, 4); }
+
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME \
+{ register CORE_ADDR sp = read_register (SP_REGNUM); \
+ register int regnum; \
+ sp = push_word (sp, read_register (PC_REGNUM)); \
+ sp = push_word (sp, read_register (FP_REGNUM)); \
+ write_register (FP_REGNUM, sp); \
+ for (regnum = 0; regnum < 8; regnum++) \
+ sp = push_word (sp, read_register (regnum)); \
+ write_register (SP_REGNUM, sp); \
+}
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME \
+{ register FRAME frame = get_current_frame (); \
+ register CORE_ADDR fp; \
+ register int regnum; \
+ struct frame_saved_regs fsr; \
+ struct frame_info *fi; \
+ fi = get_frame_info (frame); \
+ fp = fi->frame; \
+ get_frame_saved_regs (fi, &fsr); \
+ for (regnum = 0; regnum < 8; regnum++) \
+ if (fsr.regs[regnum]) \
+ write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
+ write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
+ write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
+ write_register (SP_REGNUM, fp + 8); \
+ flush_cached_frames (); \
+ set_current_frame (create_new_frame (read_register (FP_REGNUM),\
+ read_pc ())); \
+}
+
+/* This sequence of words is the instructions
+ enter 0xff,0 82 ff 00
+ jsr @0x00010203 7f ae c0 01 02 03
+ adjspd 0x69696969 7f a5 01 02 03 04
+ bpt f2
+ Note this is 16 bytes. */
+
+#define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }
+
+#define CALL_DUMMY_START_OFFSET 3
+#define CALL_DUMMY_LENGTH 16
+#define CALL_DUMMY_ADDR 5
+#define CALL_DUMMY_NARGS 11
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ int flipped = fun | 0xc0000000; \
+ flip_bytes (&flipped, 4); \
+ *((int *) (((char *) dummyname)+CALL_DUMMY_ADDR)) = flipped; \
+ flipped = - nargs * 4; \
+ flip_bytes (&flipped, 4); \
+ *((int *) (((char *) dummyname)+CALL_DUMMY_NARGS)) = flipped; \
+}
--- /dev/null
+/* Definitions to make GDB run on an encore under umax 4.2
+ 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 TARGET_BYTE_ORDER LITTLE_ENDIAN
+
+/* Need to get function ends by adding this to epilogue address from .bf
+ record, not using x_fsize field. */
+#define FUNCTION_EPILOGUE_SIZE 4
+
+/* 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. */
+
+#define SKIP_PROLOGUE(pc) \
+{ register unsigned char op = read_memory_integer (pc, 1); \
+ if (op == 0x82) { op = read_memory_integer (pc+2,1); \
+ if ((op & 0x80) == 0) pc += 3; \
+ else if ((op & 0xc0) == 0x80) pc += 4; \
+ else pc += 6; \
+ } \
+}
+
+/* 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)
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR (0xfffff000)
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0xf2}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)
+
+#ifndef NaN
+#include <nan.h>
+#endif NaN
+
+/* Return 1 if P points to an invalid floating point value. */
+/* Surely wrong for cross-debugging. */
+#define INVALID_FLOAT(p, s) \
+ ((s == sizeof (float))? \
+ NaF (*(float *) p) : \
+ NaD (*(double *) p))
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 25
+
+#define NUM_GENERAL_REGS 8
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "sp", "fp", "pc", "ps", \
+ "fsr", \
+ "l0", "l1", "l2", "l3", "xx", \
+ }
+
+/* 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 R0_REGNUM 0 /* General register 0 */
+#define FP0_REGNUM 8 /* Floating point register 0 */
+#define SP_REGNUM 16 /* Contains address of top of stack */
+#define AP_REGNUM FP_REGNUM
+#define FP_REGNUM 17 /* Contains address of executing stack frame */
+#define PC_REGNUM 18 /* Contains program counter */
+#define PS_REGNUM 19 /* Contains processor status */
+#define FPS_REGNUM 20 /* Floating point status register */
+#define LP0_REGNUM 21 /* Double register 0 (same as FP0) */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES \
+ ((NUM_REGS - 4) * REGISTER_RAW_SIZE(R0_REGNUM) \
+ + 4 * REGISTER_RAW_SIZE(LP0_REGNUM))
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) ((N) >= LP0_REGNUM ? \
+ LP0_REGNUM * 4 + ((N) - LP0_REGNUM) * 8 : (N) * 4)
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. On the 32000, all regs are 4 bytes
+ except for the doubled floating registers. */
+
+#define REGISTER_RAW_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. On the 32000, all regs are 4 bytes
+ except for the doubled floating registers. */
+
+#define REGISTER_VIRTUAL_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 8
+
+/* 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) 0
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ (((N) < FP0_REGNUM) ? \
+ builtin_type_int : \
+ ((N) < FP0_REGNUM + 8) ? \
+ builtin_type_float : \
+ ((N) < LP0_REGNUM) ? \
+ builtin_type_int : \
+ builtin_type_double)
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function.
+
+ On this machine this is a no-op, because gcc isn't used on it
+ yet. So this calling convention is not used. */
+
+#define STORE_STRUCT_RETURN(ADDR, SP)
+
+/* 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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF+REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 0), VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 0), VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF))
+\f
+/* 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 ns32000 series, the frame's nominal address is the FP
+ value, and at that address is saved previous FP value as a 4-byte word. */
+
+#define FRAME_CHAIN(thisframe) \
+ (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer ((thisframe)->frame, 4) :\
+ 0)
+
+/* Define other aspects of the stack frame. */
+
+#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
+
+/* Compute base of arguments. */
+
+#define FRAME_ARGS_ADDRESS(fi) \
+ ((ns32k_get_enter_addr ((fi)->pc) > 1) ? \
+ ((fi)->frame) : (read_register (SP_REGNUM) - 4))
+
+#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+
+/* Get the address of the enter opcode for this function, if it is active.
+ Returns positive address > 1 if pc is between enter/exit,
+ 1 if pc before enter or after exit, 0 otherwise. */
+
+extern CORE_ADDR ns32k_get_enter_addr ();
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell.
+ Encore's C compiler often reuses same area on stack for args,
+ so this will often not work properly. If the arg names
+ are known, it's likely most of them will be printed. */
+
+#define FRAME_NUM_ARGS(numargs, fi) \
+{ CORE_ADDR pc; \
+ CORE_ADDR enter_addr; \
+ unsigned int insn; \
+ unsigned int addr_mode; \
+ int width; \
+ \
+ numargs = -1; \
+ enter_addr = ns32k_get_enter_addr ((fi)->pc); \
+ if (enter_addr > 0) \
+ { \
+ pc = (enter_addr == 1) ? \
+ SAVED_PC_AFTER_CALL (fi) : \
+ FRAME_SAVED_PC (fi); \
+ insn = read_memory_integer (pc,2); \
+ addr_mode = (insn >> 11) & 0x1f; \
+ insn = insn & 0x7ff; \
+ if ((insn & 0x7fc) == 0x57c && \
+ addr_mode == 0x14) /* immediate */ \
+ { \
+ if (insn == 0x57c) /* adjspb */ \
+ width = 1; \
+ else if (insn == 0x57d) /* adjspw */ \
+ width = 2; \
+ else if (insn == 0x57f) /* adjspd */ \
+ width = 4; \
+ numargs = read_memory_integer (pc+2,width); \
+ if (width > 1) \
+ flip_bytes (&numargs, width); \
+ numargs = - sign_extend (numargs, width*8) / 4;\
+ } \
+ } \
+}
+
+/* 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. */
+
+#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+{ \
+ register int regmask, regnum; \
+ int localcount; \
+ register CORE_ADDR enter_addr; \
+ register CORE_ADDR next_addr; \
+ \
+ bzero (&(frame_saved_regs), sizeof (frame_saved_regs)); \
+ enter_addr = ns32k_get_enter_addr ((frame_info)->pc); \
+ if (enter_addr > 1) \
+ { \
+ regmask = read_memory_integer (enter_addr+1, 1) & 0xff; \
+ localcount = ns32k_localcount (enter_addr); \
+ next_addr = (frame_info)->frame + localcount; \
+ for (regnum = 0; regnum < 8; regnum++, regmask >>= 1) \
+ (frame_saved_regs).regs[regnum] = (regmask & 1) ? \
+ (next_addr -= 4) : 0; \
+ (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4;\
+ (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4;\
+ (frame_saved_regs).regs[FP_REGNUM] = \
+ (read_memory_integer ((frame_info)->frame, 4));\
+ } \
+ else if (enter_addr == 1) \
+ { \
+ CORE_ADDR sp = read_register (SP_REGNUM); \
+ (frame_saved_regs).regs[PC_REGNUM] = sp; \
+ (frame_saved_regs).regs[SP_REGNUM] = sp + 4; \
+ } \
+}
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME \
+{ register CORE_ADDR sp = read_register (SP_REGNUM);\
+ register int regnum; \
+ sp = push_word (sp, read_register (PC_REGNUM)); \
+ sp = push_word (sp, read_register (FP_REGNUM)); \
+ write_register (FP_REGNUM, sp); \
+ for (regnum = 0; regnum < 8; regnum++) \
+ sp = push_word (sp, read_register (regnum)); \
+ write_register (SP_REGNUM, sp); \
+}
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME \
+{ register FRAME frame = get_current_frame (); \
+ register CORE_ADDR fp; \
+ register int regnum; \
+ struct frame_saved_regs fsr; \
+ struct frame_info *fi; \
+ fi = get_frame_info (frame); \
+ fp = fi->frame; \
+ get_frame_saved_regs (fi, &fsr); \
+ for (regnum = 0; regnum < 8; regnum++) \
+ if (fsr.regs[regnum]) \
+ write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
+ write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
+ write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
+ write_register (SP_REGNUM, fp + 8); \
+ flush_cached_frames (); \
+ set_current_frame (create_new_frame (read_register (FP_REGNUM),\
+ read_pc ())); }
+
+/* This sequence of words is the instructions
+ enter 0xff,0 82 ff 00
+ jsr @0x00010203 7f ae c0 01 02 03
+ adjspd 0x69696969 7f a5 01 02 03 04
+ bpt f2
+ Note this is 16 bytes. */
+
+#define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }
+
+#define CALL_DUMMY_START_OFFSET 3
+#define CALL_DUMMY_LENGTH 16
+#define CALL_DUMMY_ADDR 5
+#define CALL_DUMMY_NARGS 11
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ \
+ int flipped; \
+ flipped = fun | 0xc0000000; \
+ flip_bytes (&flipped, 4); \
+ *((int *) (((char *) dummyname)+CALL_DUMMY_ADDR)) = flipped; \
+ flipped = - nargs * 4; \
+ flip_bytes (&flipped, 4); \
+ *((int *) (((char *) dummyname)+CALL_DUMMY_NARGS)) = flipped; \
+}
--- /dev/null
+# Host: Encore running umax 4.2
+XDEPFILES= umax-xdep.o
+XM_FILE= xm-umax.h
+NAT_FILE= nm-umax.h
+NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o
--- /dev/null
+# Target: Encore running umax 4.2
+TDEPFILES= ns32k-pinsn.o
+TM_FILE= tm-umax.h
--- /dev/null
+/* Definitions to make GDB run on a merlin under utek 2.1
+ 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. */
+
+#include <machine/reg.h>
+
+/* This machine doesn't have the siginterrupt call. */
+#define NO_SIGINTERRUPT
+
+/* Under Utek, a ptrace'd process can be the only active process for
+ an executable. Therefore instead of /bin/sh use gdb-sh (which should
+ just be a copy of /bin/sh which is world readable and writeable). */
+#define SHELL_FILE "/usr/gnu/lib/gdb-sh"
+
+#define HOST_BYTE_ORDER LITTLE_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 (0xfef000)
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ \
+ switch (regno) { \
+ case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: \
+ addr = blockend + (R0 - regno) * sizeof (int); break; \
+ case PC_REGNUM: \
+ addr = blockend + PC * sizeof (int); break; \
+ case SP_REGNUM: \
+ addr = blockend + SP * sizeof (int); break; \
+ case FP_REGNUM: \
+ addr = blockend + FP * sizeof (int); break; \
+ case PS_REGNUM: \
+ addr = blockend + 12 * sizeof (int); break; \
+ case FPS_REGNUM: \
+ addr = 108; break; \
+ case FP0_REGNUM + 0: case FP0_REGNUM + 1: \
+ case FP0_REGNUM + 2: case FP0_REGNUM + 3: \
+ case FP0_REGNUM + 4: case FP0_REGNUM + 5: \
+ case FP0_REGNUM + 6: case FP0_REGNUM + 7: \
+ addr = 76 + (regno - FP0_REGNUM) * sizeof (float); break; \
+ case LP0_REGNUM + 0: case LP0_REGNUM + 1: \
+ case LP0_REGNUM + 2: case LP0_REGNUM + 3: \
+ addr = 76 + (regno - LP0_REGNUM) * sizeof (double); break; \
+ default: \
+ printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
+ abort (); \
+ } \
+}
--- /dev/null
+/* Definitions to make GDB run on an encore under umax 4.2
+ 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 LITTLE_ENDIAN
+
+#define HAVE_WAIT_STRUCT
+
+/* Doesn't have siginterupt. */
+#define NO_SIGINTERRUPT
+
--- /dev/null
+# Host: Hewlett-Packard PA-RISC machine, running BSD
+XDEPFILES=
+XM_FILE= xm-hppab.h
+NAT_FILE= nm-hppab.h
+NATDEPFILES= hppab-nat.o coredep.o corelow.o exec.o hppab-core.o
--- /dev/null
+# TARGET: HP PA-RISC running bsd
+TDEPFILES= hppa-pinsn.o hppab-tdep.o
+TM_FILE= tm-hppab.h
+
--- /dev/null
+# Host: Hewlett-Packard PA-RISC machine, running HPUX
+TERMCAP = -lcurses
+XDEPFILES=
+XM_FILE= xm-hppah.h
+NAT_FILE= nm-hppah.h
+NATDEPFILES= hppah-nat.o coredep.o corelow.o inftarg.o fork-child.o paread.o
+REGEX=regex.o
+REGEX1=regex.o
--- /dev/null
+/* HPPA PA-RISC machine native support for BSD, for GDB.
+ Copyright 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. */
+
+#define U_REGS_OFFSET 0
+
+/* What a coincidence! */
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ addr = (int)(blockend) + REGISTER_BYTE (regno);}
+
--- /dev/null
+/* Native support for HPPA-RISC machine running HPUX, for GDB.
+ Copyright 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. */
+
+#define U_REGS_OFFSET 0
+
+/* What a coincidence! */
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ addr = (int)(blockend) + REGISTER_BYTE (regno);}
--- /dev/null
+/* Parameters for execution on an HP PA-RISC machine running BSD, for GDB.
+ Contributed by the Center for Software Science at the
+ University of Utah (pa-gdb-bugs@cs.utah.edu). */
+
+/* It's all just the common stuff. */
+#include "pa/tm-hppa.h"
--- /dev/null
+/* Parameters for hosting on an HPPA PA-RISC machine, running BSD, for GDB.
+ Copyright 1991, 1992 Free Software Foundation, Inc.
+
+ Contributed by the Center for Software Science at the
+ University of Utah (pa-gdb-bugs@cs.utah.edu).
+
+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 big-endian host. */
+
+#define HOST_BYTE_ORDER BIG_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
+
+#ifndef hp800
+#define USG
+#endif
+
+#define KERNEL_U_ADDR 0
+
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Set file pointer to "offset" */
+# define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif /* SEEK_SET */
--- /dev/null
+/* Parameters for hosting on an HPPA-RISC machine running HPUX, for GDB.
+ Copyright 1991, 1992 Free Software Foundation, Inc.
+
+ Contributed by the Center for Software Science at the
+ University of Utah (pa-gdb-bugs@cs.utah.edu).
+
+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. */
+
+/* Host is big-endian. */
+#define HOST_BYTE_ORDER BIG_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
+
+#ifndef hp800
+#define USG
+#endif
+
+#ifndef __STDC__
+/* This define is discussed in decode_line_1 in symtab.c */
+#define HPPA_COMPILER_BUG
+#endif
+
+#define HAVE_TERMIO
+
+#define KERNEL_U_ADDR 0
+
+/* HP uses non-ANSI definitions, but with void * results. */
+#define MEM_FNS_DECLARED /* Some non-ANSI use void *, not char *. */
+extern void *
+memcpy PARAMS ((void *, const void *, size_t)); /* 4.11.2.1 */
+
+extern void *
+memset PARAMS ((void *, int, size_t)); /* 4.11.6.1 */
+
--- /dev/null
+/* IBM RS/6000 native-dependent macros 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
+
+#define PTRACE_ATTACH PT_ATTACH
+#define PTRACE_DETACH PT_DETACH
+
+/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
+
+#define FETCH_INFERIOR_REGISTERS
+
--- /dev/null
+# Host machine: IBM RS/6000 running AIX 3.2.
+# Copyright 1990, 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.
+
+XDEPFILES=
+XM_FILE= xm-rs6000.h
+NAT_FILE= nm-rs6000.h
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o rs6000-nat.o xcoffread.o
+
+# When compiled with cc, for debugging, this argument should be passed.
+# We have no idea who our current compiler is though, so we skip it.
+# MH_CFLAGS = -bnodelcsect
+
+# Because of shared libraries, we risk ending up with *two*
+# incompatible versions of malloc if we use GNU malloc ...
+MMALLOC_LIB =
+MMALLOC_DISABLE = -DNO_MMALLOC
+
+# A bug in the AIX 3.2 libc.a results in unresolved references for .scalb and
+# .finite becuase we call ldexp. Circumvent by adding -lm. FIXME, IBM.
+XM_CLIBS= -lm
--- /dev/null
+/* Parameters for target execution on an RS6000, for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Contributed by IBM Corporation.
+
+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. */
+
+extern int symtab_relocated;
+
+/* Minimum possible text address in AIX */
+
+#define TEXT_SEGMENT_BASE 0x10000000
+
+
+/* text addresses in a core file does not necessarily match to symbol table,
+ if symbol table relocation wasn't done yet. */
+
+#define CORE_NEEDS_RELOCATION(PC) \
+ if (!symtab_relocated && !inferior_pid) \
+ xcoff_relocate_core ();
+extern void xcoff_relocate_core PARAMS ((void));
+
+/* Load segment of a given pc value. */
+
+#define PC_LOAD_SEGMENT(PC) pc_load_segment_name(PC)
+
+/* AIX cc seems to get this right. */
+
+#define BELIEVE_PCC_PROMOTION 1
+
+/* return true if a given `pc' value is in `call dummy' function. */
+
+#define PC_IN_CALL_DUMMY(STOP_PC, STOP_SP, STOP_FRAME_ADDR) \
+ (STOP_SP < STOP_PC && STOP_PC < STACK_END_ADDR)
+
+/* For each symtab, we keep track of which BFD it came from. */
+#define EXTRA_SYMTAB_INFO \
+ unsigned nonreloc:1; /* TRUE if non relocatable */
+
+#define INIT_EXTRA_SYMTAB_INFO(symtab) \
+ symtab->nonreloc = 0; \
+
+extern unsigned int text_start, data_start;
+extern int inferior_pid;
+extern char *corefile;
+
+/* setpgrp() messes up controling terminal. The other version of it
+ requires libbsd.a. */
+#define setpgrp(XX,YY) setpgid (XX, YY)
+
+/* We are missing register descriptions in the system header files. Sigh! */
+
+struct regs {
+ int gregs [32]; /* general purpose registers */
+ int pc; /* program conter */
+ int ps; /* processor status, or machine state */
+};
+
+struct fp_status {
+ double fpregs [32]; /* floating GP registers */
+};
+
+
+/* To be used by function_frame_info. */
+
+struct aix_framedata {
+ int offset; /* # of bytes in gpr's and fpr's are saved */
+ int saved_gpr; /* smallest # of saved gpr */
+ int saved_fpr; /* smallest # of saved fpr */
+ int alloca_reg; /* alloca register number (frame ptr) */
+ char frameless; /* true if frameless functions. */
+ char nosavedpc; /* true if pc not saved. */
+};
+
+void
+function_frame_info PARAMS ((CORE_ADDR, struct aix_framedata *));
+
+/* Define the byte order of the machine. */
+
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+/* AIX's assembler doesn't grok dollar signs in identifiers.
+ So we use dots instead. This item must be coordinated with G++. */
+#undef CPLUS_MARKER
+#define CPLUS_MARKER '.'
+
+/* 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. */
+
+#define SKIP_PROLOGUE(pc) pc = skip_prologue (pc)
+
+/* If PC is in some function-call trampoline code, return the PC
+ where the function itself actually starts. If not, return NULL. */
+
+#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc)
+
+/* When a child process is just starting, we sneak in and relocate
+ the symbol table (and other stuff) after the dynamic linker has
+ figured out where they go. But we want to do this relocation just
+ once. */
+
+extern int loadinfotextindex;
+
+#define SOLIB_CREATE_INFERIOR_HOOK(PID) \
+ do { \
+ if (loadinfotextindex == 0) \
+ xcoff_relocate_symtab (PID); \
+ } while (0)
+
+
+/* Number of trap signals we need to skip over, once the inferior process
+ starts running. */
+
+#define START_INFERIOR_TRAPS_EXPECTED 2
+
+/* AIX might return a sigtrap, with a "stop after load" status. It should
+ be ignored by gdb, shouldn't be mixed up with breakpoint traps. */
+
+/* Another little glitch in AIX is signal 0. I have no idea why wait(2)
+ returns with this status word. It looks harmless. */
+
+#define SIGTRAP_STOP_AFTER_LOAD(W) \
+ if ( (W) == 0x57c || (W) == 0x7f) { \
+ if ((W)==0x57c && breakpoints_inserted) { \
+ mark_breakpoints_out (); \
+ insert_breakpoints (); \
+ insert_step_breakpoint (); \
+ } \
+ resume (0, 0); \
+ continue; \
+ }
+
+/* In xcoff, we cannot process line numbers when we see them. This is
+ mainly because we don't know the boundaries of the include files. So,
+ we postpone that, and then enter and sort(?) the whole line table at
+ once, when we are closing the current symbol table in end_symtab(). */
+
+#define PROCESS_LINENUMBER_HOOK() aix_process_linenos ()
+
+
+/* When a target process or core-file has been attached, we sneak in
+ and figure out where the shared libraries have got to. In case there
+ is no inferior_process exists (e.g. bringing up a core file), we can't
+ attemtp to relocate symbol table, since we don't have information about
+ load segments. */
+
+#define SOLIB_ADD(a, b, c) \
+ if (inferior_pid) xcoff_relocate_symtab (inferior_pid)
+
+/* Immediately after a function call, return the saved pc.
+ Can't 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_register (LR_REGNUM)
+
+/* Address of end of stack space. */
+
+#define STACK_END_ADDR 0x2ff80000
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+#if 0
+/* No, we shouldn't use this. push_arguments() should leave stack in a
+ proper alignment! */
+/* Stack has strict alignment. */
+
+#define STACK_ALIGN(ADDR) (((ADDR)+7)&-8)
+#endif
+
+/* This is how argumets pushed onto stack or passed in registers. */
+
+#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+ sp = push_arguments(nargs, args, sp, struct_return, struct_addr)
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0x7d, 0x82, 0x10, 0x08}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+/* Allow any of the return instructions, including a trapv and a return
+ from interrupt. */
+
+#define ABOUT_TO_RETURN(pc) \
+ ((read_memory_integer (pc, 4) & 0xfe8007ff) == 0x4e800020)
+
+/* Return 1 if P points to an invalid floating point value. */
+
+#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
+
+/* Largest integer type */
+
+#define LONGEST long
+
+/* Name of the builtin type for the LONGEST type above. */
+
+#define BUILTIN_TYPE_LONGEST builtin_type_long
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 71
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES \
+ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "r8", "r9", "r10","r11","r12","r13","r14","r15", \
+ "r16","r17","r18","r19","r20","r21","r22","r23", \
+ "r24","r25","r26","r27","r28","r29","r30","r31", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f8", "f9", "f10","f11","f12","f13","f14","f15", \
+ "f16","f17","f18","f19","f20","f21","f22","f23", \
+ "f24","f25","f26","f27","f28","f29","f30","f31", \
+ "pc", "ps", "cnd", "lr", "cnt", "xer", "mq" }
+
+/* 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 FP_REGNUM 1 /* Contains address of executing stack frame */
+#define SP_REGNUM 1 /* Contains address of top of stack */
+#define TOC_REGNUM 2 /* TOC register */
+#define FP0_REGNUM 32 /* Floating point register 0 */
+#define GP0_REGNUM 0 /* GPR register 0 */
+#define FP0_REGNUM 32 /* FPR (Floating point) register 0 */
+#define FPLAST_REGNUM 63 /* Last floating point register */
+
+/* Special purpose registers... */
+/* P.S. keep these in the same order as in /usr/mstsave.h `mstsave' structure, for
+ easier processing */
+
+#define PC_REGNUM 64 /* Program counter (instruction address %iar) */
+#define PS_REGNUM 65 /* Processor (or machine) status (%msr) */
+#define CR_REGNUM 66 /* Condition register */
+#define LR_REGNUM 67 /* Link register */
+#define CTR_REGNUM 68 /* Count register */
+#define XER_REGNUM 69 /* Fixed point exception registers */
+#define MQ_REGNUM 70 /* Multiply/quotient register */
+
+#define FIRST_SP_REGNUM 64 /* first special register number */
+#define LAST_SP_REGNUM 70 /* last special register number */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'.
+
+ 32 4-byte gpr's
+ 32 8-byte fpr's
+ 7 4-byte special purpose registers,
+
+ total 416 bytes. Keep some extra space for now, in case to add more. */
+
+#define REGISTER_BYTES 420
+
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) \
+ ( \
+ ((N) > FPLAST_REGNUM) ? ((((N) - FPLAST_REGNUM -1) * 4) + 384)\
+ :((N) >= FP0_REGNUM) ? ((((N) - FP0_REGNUM) * 8) + 128) \
+ :((N) * 4) )
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. */
+/* Note that the unsigned cast here forces the result of the
+ subtractiion to very high positive values if N < FP0_REGNUM */
+
+#define REGISTER_RAW_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 32 ? 8 : 4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. On the RS6000, all regs are 4 bytes
+ except the floating point regs which are 8-byte doubles. */
+
+#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 32 ? 8 : 4)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 8
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+
+#define MAX_REGISTER_VIRTUAL_SIZE 8
+
+/* convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */
+
+#define STAB_REG_TO_REGNUM(value) (value)
+
+/* Nonzero if register N requires conversion
+ from raw format to virtual format. */
+
+#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) <= FPLAST_REGNUM)
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM))
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM))
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ (((unsigned)(N) - FP0_REGNUM) < 32 ? builtin_type_double : builtin_type_int)
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+/* in RS6000, struct return addresses are passed as an extra parameter in r3.
+ In function return, callee is not responsible of returning this address back.
+ Since gdb needs to find it, we will store in a designated variable
+ `rs6000_struct_return_address'. */
+
+extern unsigned int rs6000_struct_return_address;
+
+#define STORE_STRUCT_RETURN(ADDR, SP) \
+ { write_register (3, (ADDR)); \
+ rs6000_struct_return_address = (unsigned int)(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. */
+
+/* #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE)) */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ extract_return_value(TYPE,REGBUF,VALBUF)
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ { \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
+ \
+ /* Floating point values are returned starting from FPR1 and up. \
+ Say a double_double_double type could be returned in \
+ FPR1/FPR2/FPR3 triple. */ \
+ \
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM+1), (VALBUF), \
+ TYPE_LENGTH (TYPE)); \
+ else \
+ /* Everything else is returned in GPR3 and up. */ \
+ write_register_bytes (REGISTER_BYTE (GP0_REGNUM+3), (VALBUF), \
+ TYPE_LENGTH (TYPE)); \
+ }
+
+
+/* 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) rs6000_struct_return_address
+\f
+/* 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 RS6000, 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_function_invocation (FI, 0)
+
+/* Functions calling alloca() change the value of the stack pointer. We
+ need to use initial stack pointer (which is saved in r31 by gcc) in
+ such cases. If a compiler emits traceback table, then we should use the
+ alloca register specified in traceback table. FIXME. */
+/* Also, it is a good idea to cache information about frame's saved registers
+ in the frame structure to speed things up. See tm-m88k.h. FIXME. */
+
+#define EXTRA_FRAME_INFO \
+ CORE_ADDR initial_sp; /* initial stack pointer. */ \
+ struct frame_saved_regs *cache_fsr; /* saved registers */
+
+/* Frameless function invocation in IBM RS/6000 is sometimes
+ half-done. It perfectly sets up a new frame, e.g. a new frame (in
+ fact stack) pointer, etc, but it doesn't save the %pc. We call
+ frameless_function_invocation to tell us how to get the %pc. */
+
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
+ fi->initial_sp = 0; \
+ fi->cache_fsr = 0;
+
+#define FRAME_SAVED_PC(FRAME) \
+ (frameless_function_invocation (FRAME, 1) \
+ ? SAVED_PC_AFTER_CALL (FRAME) \
+ : read_memory_integer (read_memory_integer ((FRAME)->frame, 4)+8, 4))
+
+#define FRAME_ARGS_ADDRESS(FI) \
+ (((struct frame_info*)(FI))->initial_sp ? \
+ ((struct frame_info*)(FI))->initial_sp : \
+ frame_initial_stack_address (FI))
+
+#define FRAME_LOCALS_ADDRESS(FI) FRAME_ARGS_ADDRESS(FI)
+
+
+/* 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. */
+
+#define FRAME_NUM_ARGS(val,fi) (val = -1)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 8 /* Not sure on this. FIXMEmgo */
+
+/* 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. */
+/* In the following implementation for RS6000, we did *not* save sp. I am
+ not sure if it will be needed. The following macro takes care of gpr's
+ and fpr's only. */
+
+#define FRAME_FIND_SAVED_REGS(FRAME_INFO, FRAME_SAVED_REGS) \
+{ \
+ int ii; \
+ CORE_ADDR frame_addr, func_start; \
+ struct aix_framedata fdata; \
+ \
+ /* find the start of the function and collect info about its frame. */\
+ \
+ func_start = get_pc_function_start ((FRAME_INFO)->pc) + FUNCTION_START_OFFSET; \
+ function_frame_info (func_start, &fdata); \
+ bzero (&(FRAME_SAVED_REGS), sizeof (FRAME_SAVED_REGS)); \
+ \
+ /* if there were any saved registers, figure out parent's stack pointer. */ \
+ frame_addr = 0; \
+ /* the following is true only if the frame doesn't have a call to alloca(), \
+ FIXME. */ \
+ if (fdata.saved_fpr >= 0 || fdata.saved_gpr >= 0) { \
+ if ((FRAME_INFO)->prev && (FRAME_INFO)->prev->frame) \
+ frame_addr = (FRAME_INFO)->prev->frame; \
+ else \
+ frame_addr = read_memory_integer ((FRAME_INFO)->frame, 4); \
+ } \
+ \
+ /* if != -1, fdata.saved_fpr is the smallest number of saved_fpr. All fpr's \
+ from saved_fpr to fp31 are saved right underneath caller stack pointer, \
+ starting from fp31 first. */ \
+ \
+ if (fdata.saved_fpr >= 0) { \
+ for (ii=31; ii >= fdata.saved_fpr; --ii) \
+ (FRAME_SAVED_REGS).regs [FP0_REGNUM + ii] = frame_addr - ((32 - ii) * 8); \
+ frame_addr -= (32 - fdata.saved_fpr) * 8; \
+ } \
+ \
+ /* if != -1, fdata.saved_gpr is the smallest number of saved_gpr. All gpr's \
+ from saved_gpr to gpr31 are saved right under saved fprs, starting \
+ from r31 first. */ \
+ \
+ if (fdata.saved_gpr >= 0) \
+ for (ii=31; ii >= fdata.saved_gpr; --ii) \
+ (FRAME_SAVED_REGS).regs [ii] = frame_addr - ((32 - ii) * 4); \
+}
+
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+/* Change these names into rs6k_{push, pop}_frame(). FIXMEmgo. */
+
+#define PUSH_DUMMY_FRAME push_dummy_frame ()
+
+/* Discard from the stack the innermost frame,
+ restoring all saved registers. */
+
+#define POP_FRAME pop_frame ()
+
+/* This sequence of words is the instructions:
+
+ mflr r0 // 0x7c0802a6
+ // save fpr's
+ stfd r?, num(r1) // 0xd8010000 there should be 32 of this??
+ // save gpr's
+ stm r0, num(r1) // 0xbc010000
+ stu r1, num(r1) // 0x94210000
+
+ // the function we want to branch might be in a different load
+ // segment. reset the toc register. Note that the actual toc address
+ // will be fix by fix_call_dummy () along with function address.
+
+ st r2, 0x14(r1) // 0x90410014 save toc register
+ liu r2, 0x1234 // 0x3c401234 reset a new toc value 0x12345678
+ oril r2, r2,0x5678 // 0x60425678
+
+ // load absolute address 0x12345678 to r0
+ liu r0, 0x1234 // 0x3c001234
+ oril r0, r0,0x5678 // 0x60005678
+ mtctr r0 // 0x7c0903a6 ctr <- r0
+ bctrl // 0x4e800421 jump subroutine 0x12345678 (%ctr)
+ cror 0xf, 0xf, 0xf // 0x4def7b82
+ brpt // 0x7d821008, breakpoint
+ cror 0xf, 0xf, 0xf // 0x4def7b82 (for 8 byte alignment)
+
+
+ We actually start executing by saving the toc register first, 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 `bctrl' would be pushed
+ between the `stu' and the `bctrl', 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 to push the registers again.
+*/
+
+#define CALL_DUMMY {0x7c0802a6, 0xd8010000, 0xbc010000, 0x94210000, \
+ 0x90410014, 0x3c401234, 0x60425678, \
+ 0x3c001234, 0x60005678, 0x7c0903a6, 0x4e800421, \
+ 0x4def7b82, 0x7d821008, 0x4def7b82 }
+
+
+/* keep this as multiple of 8 (%sp requires 8 byte alignment) */
+#define CALL_DUMMY_LENGTH 56
+
+#define CALL_DUMMY_START_OFFSET 16
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, using_gcc) \
+ fix_call_dummy(dummyname, pc, fun, nargs, type)
+
+/* Flag for machine-specific stuff in shared files. FIXME */
+#define IBM6000_TARGET
+
+/* RS6000/AIX does not support PT_STEP. Has to be simulated. */
+
+#define NO_SINGLE_STEP
--- /dev/null
+/* Parameters for hosting on an RS6000, for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Contributed by IBM Corporation.
+
+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. */
+
+/* The following text is taken from config/rs6000.mh:
+ * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says
+ * # `extern fd_set svc_fdset;' without ever defining the type fd_set.
+ * # Unfortunately this occurs in the vx-share code, which is not configured
+ * # like the rest of GDB (e.g. it doesn't include "defs.h").
+ * # We circumvent this bug by #define-ing fd_set here, but undefining it in
+ * # the xm-rs6000.h file before ordinary modules try to use it. FIXME, IBM!
+ * MH_CFLAGS='-Dfd_set=int'
+ * So, here we do the undefine...which has to occur before we include
+ * <sys/select.h> below.
+ */
+#undef fd_set
+
+#include <sys/select.h>
+
+/* Big end is at the low address */
+
+#define HOST_BYTE_ORDER BIG_ENDIAN
+
+#define HAVE_TERMIO 1
+#define USG 1
+#define HAVE_SIGSETMASK 1
+
+/* AIX declares the mem functions differently than defs.h does. AIX is
+ right, but defs.h works on more old systems. For now, override it. */
+
+#define MEM_FNS_DECLARED 1
+
+/* This system requires that we open a terminal with O_NOCTTY for it to
+ not become our controlling terminal. */
+
+#define USE_O_NOCTTY
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* Brain death inherited from PC's pervades. */
+#undef NULL
+#define NULL 0
+
+/* The IBM compiler requires this in order to properly compile alloca(). */
+#pragma alloca
+
+/* There is no vfork. */
+
+#define vfork fork
+
+/* Setpgrp() takes arguments, unlike ordinary Sys V's. */
+
+#define SETPGRP_ARGS 1
+
+/* /usr/include/stdlib.h always uses void* and void,
+ even when __STDC__ isn't defined. */
+#define MALLOC_INCOMPATIBLE
+extern void *malloc PARAMS ((size_t size));
+extern void *realloc PARAMS ((void *ptr, size_t size));
+extern void free PARAMS ((void *));
+
+/* AIX doesn't have strdup, so we need to declare it for libiberty */
+extern char *strdup PARAMS ((char *));
+
+/* Signal handler for SIGWINCH `window size changed'. */
+
+#define SIGWINCH_HANDLER aix_resizewindow
+extern void aix_resizewindow ();
+
+/* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */
+
+#define SIGWINCH_HANDLER_BODY \
+ \
+/* Respond to SIGWINCH `window size changed' signal, and reset GDB's \
+ window settings approproatelt. */ \
+ \
+void \
+aix_resizewindow () \
+{ \
+ int fd = fileno (stdout); \
+ if (isatty (fd)) { \
+ int val; \
+ \
+ val = atoi (termdef (fd, 'l')); \
+ if (val > 0) \
+ lines_per_page = val; \
+ val = atoi (termdef (fd, 'c')); \
+ if (val > 0) \
+ chars_per_line = val; \
+ } \
+}
--- /dev/null
+/* Macro definitions for running gdb on a Sun 4 running sunos 4.
+ Copyright (C) 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
+
--- /dev/null
+# Target: SPARC embedded
+TDEPFILES= exec.o sparc-tdep.o sparc-pinsn.o
+TM_FILE= tm-spc-em.h
--- /dev/null
+# Host: Sun 4 or Sparcstation, running SunOS 4
+XDEPFILES= ser-bsd.o
+XM_FILE= xm-sun4os4.h
+NAT_FILE= nm-sun4os4.h
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o
--- /dev/null
+# Target: Sun 4 or Sparcstation, running SunOS 4
+TDEPFILES= exec.o sparc-tdep.o sparc-pinsn.o solib.o
+TM_FILE= tm-sun4os4.h
--- /dev/null
+# Host: Sun 4 or Sparcstation, running Solaris 2
+XDEPFILES=
+XM_FILE= xm-sun4sol2.h
+NAT_FILE= nm-sysv4.h
+NATDEPFILES= corelow.o exec.o solib.o procfs.o fork-child.o
+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
+
+# Solaris-2 makes `install' optional in the Berkeley compatability pkg.
+# cp will do fine.
+INSTALL = cp
+
+# If you are compiling with Sun's compiler, add the -xs option to CC
+# (e.g. `make CC="cc -xs"').
+# Sun's compilers require the -xs option to produce debug information
+# in the final linked executable. Otherwise they leave it in the .o
+# files only, with undocumented pointers to it in the linked executable.
+# This is commented out because we don't assume that the Sun compiler
+# is in use.
+#MH_CFLAGS=-xs
--- /dev/null
+# Target: Sun 4 or Sparcstation, running Solaris 2
+TDEPFILES= sparc-tdep.o sparc-pinsn.o
+TM_FILE= tm-sun4sol2.h
--- /dev/null
+/* Target machine sub-parameters for SPARC, for GDB, the GNU debugger.
+ This is included by other tm-*.h files to define SPARC cpu-related info.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Contributed by Michael Tiemann (tiemann@mcc.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. */
+
+#define TARGET_BYTE_ORDER BIG_ENDIAN
+
+/* Floating point is IEEE compatible. */
+#define IEEE_FLOAT
+
+/* When passing a structure to a function, Sun cc passes the address
+ in a register, not the structure itself. It (under SunOS4) creates
+ two symbols, so we get a LOC_ARG saying the address is on the stack
+ (a lie, and a serious one since we don't know which register to
+ use), and a LOC_REGISTER saying that the struct is in a register
+ (sort of a lie, but fixable with REG_STRUCT_HAS_ADDR). Gcc version
+ two (as of 1.92) behaves like sun cc. REG_STRUCT_HAS_ADDR is smart
+ enough to distinguish between Sun cc, gcc version 1 and gcc version 2.
+
+ This still doesn't work if the argument is not one passed in a
+ register (i.e. it's the 7th or later argument). */
+#define REG_STRUCT_HAS_ADDR(gcc_p) (gcc_p != 1)
+#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (gcc_p != 1)
+
+/* If Pcc says that a parameter is a short, it's a short. This is
+ because the parameter does get passed in in a register as an int,
+ but pcc puts it onto the stack frame as a short (not nailing
+ whatever else might be there. I'm not sure that I consider this
+ swift. Sigh.)
+
+ No, don't do this. The problem here is that pcc says that the
+ argument is in the upper half of the word reserved on the stack,
+ but puts it in the lower half. */
+/* #define BELIEVE_PCC_PROMOTION 1 */
+/* OK, I've added code to dbxread.c to deal with this case. */
+#define BELIEVE_PCC_PROMOTION_TYPE
+
+/* 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. SKIP_PROLOGUE_FRAMELESS_P advances
+ the PC past some of the prologue, but stops as soon as it
+ knows that the function has a frame. Its result is equal
+ to its input PC if the function is frameless, unequal otherwise. */
+
+#define SKIP_PROLOGUE(pc) \
+ { pc = skip_prologue (pc, 0); }
+#define SKIP_PROLOGUE_FRAMELESS_P(pc) \
+ { pc = skip_prologue (pc, 1); }
+extern CORE_ADDR skip_prologue ();
+
+/* Immediately after a function call, return the saved pc.
+ Can't go through the frames for this because on some machines
+ the new frame is not set up until the new function executes
+ some instructions. */
+
+/* On the Sun 4 under SunOS, the compile will leave a fake insn which
+ encodes the structure size being returned. If we detect such
+ a fake insn, step past it. */
+
+#define PC_ADJUST(pc) sparc_pc_adjust(pc)
+extern CORE_ADDR sparc_pc_adjust();
+
+#define SAVED_PC_AFTER_CALL(frame) PC_ADJUST (read_register (RP_REGNUM))
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Stack has strict alignment. */
+
+#define STACK_ALIGN(ADDR) (((ADDR)+7)&-8)
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+/* For SPARC, this is either a "jmpl %o7+8,%g0" or "jmpl %i7+8,%g0".
+
+ Note: this does not work for functions returning structures under SunOS. */
+#define ABOUT_TO_RETURN(pc) \
+ ((read_memory_integer (pc, 4)|0x00040000) == 0x81c7e008)
+
+/* 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 (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 72
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES \
+{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
+ "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
+ "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
+ \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
+ \
+ "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" }
+
+/* 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 G0_REGNUM 0 /* %g0 */
+#define G1_REGNUM 1 /* %g1 */
+#define O0_REGNUM 8 /* %o0 */
+#define SP_REGNUM 14 /* Contains address of top of stack, \
+ which is also the bottom of the frame. */
+#define RP_REGNUM 15 /* Contains return address value, *before* \
+ any windows get switched. */
+#define O7_REGNUM 15 /* Last local reg not saved on stack frame */
+#define L0_REGNUM 16 /* First local reg that's saved on stack frame
+ rather than in machine registers */
+#define I0_REGNUM 24 /* %i0 */
+#define FP_REGNUM 30 /* Contains address of executing stack frame */
+#define I7_REGNUM 31 /* Last local reg saved on stack frame */
+#define FP0_REGNUM 32 /* Floating point register 0 */
+#define Y_REGNUM 64 /* Temp register for multiplication, etc. */
+#define PS_REGNUM 65 /* Contains processor status */
+#define WIM_REGNUM 66 /* Window Invalid Mask (not really supported) */
+#define TBR_REGNUM 67 /* Trap Base Register (not really supported) */
+#define PC_REGNUM 68 /* Contains program counter */
+#define NPC_REGNUM 69 /* Contains next PC */
+#define FPS_REGNUM 70 /* Floating point status register */
+#define CPS_REGNUM 71 /* Coprocessor status register */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (32*4+32*4+8*4)
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+/* ?? */
+#define REGISTER_BYTE(N) ((N)*4)
+
+/* The SPARC processor has register windows. */
+
+#define HAVE_REGISTER_WINDOWS
+
+/* Is this register part of the register window system? A yes answer
+ implies that 1) The name of this register will not be the same in
+ other frames, and 2) This register is automatically "saved" (out
+ registers shifting into ins counts) upon subroutine calls and thus
+ there is no need to search more than one stack frame for it. */
+
+#define REGISTER_IN_WINDOW_P(regnum) \
+ ((regnum) >= 8 && (regnum) < 32)
+
+
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. */
+
+/* On the SPARC, 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 SPARC, all regs are 4 bytes. */
+
+#define REGISTER_VIRTUAL_SIZE(N) (4)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 8
+
+/* 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) (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) \
+ ((N) < 32 ? builtin_type_int : (N) < 64 ? builtin_type_float : \
+ builtin_type_int)
+
+/* Writing to %g0 is a noop (not an error or exception or anything like
+ that, however). */
+
+#define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM)
+
+/* 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) \
+ { target_write_memory ((SP)+(16*4), (char *)&(ADDR), 4); }
+
+/* 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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ { \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
+ { \
+ memcpy ((VALBUF), ((int *)(REGBUF))+FP0_REGNUM, TYPE_LENGTH(TYPE));\
+ } \
+ else \
+ memcpy ((VALBUF), \
+ (char *)(REGBUF) + 4 * 8 + \
+ (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
+ TYPE_LENGTH(TYPE)); \
+ }
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+/* On sparc, values are returned in register %o0. */
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ { \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
+ /* Floating-point values are returned in the register pair */ \
+ /* formed by %f0 and %f1 (doubles are, anyway). */ \
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
+ TYPE_LENGTH (TYPE)); \
+ else \
+ /* Other values are returned in register %o0. */ \
+ write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
+ TYPE_LENGTH (TYPE)); \
+ }
+
+/* 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) \
+ (sparc_extract_struct_value_address (REGBUF))
+
+extern CORE_ADDR
+sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
+
+\f
+/* 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 Sun 4, the frame-chain's nominal address
+ is held in the frame pointer register.
+
+ On the Sun4, the frame (in %fp) is %sp for the previous frame.
+ From the previous frame's %sp, we can find the previous frame's
+ %fp: it is in the save area just above the previous frame's %sp.
+
+ If we are setting up an arbitrary frame, we'll need to know where
+ it ends. Hence the following. This part of the frame cache
+ structure should be checked before it is assumed that this frame's
+ bottom is in the stack pointer.
+
+ If there isn't a frame below this one, the bottom of this frame is
+ in the stack pointer.
+
+ If there is a frame below this one, and the frame pointers are
+ identical, it's a leaf frame and the bottoms are the same also.
+
+ Otherwise the bottom of this frame is the top of the next frame. */
+
+#define EXTRA_FRAME_INFO FRAME_ADDR bottom;
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
+ (fci)->bottom = \
+ ((fci)->next ? \
+ ((fci)->frame == (fci)->next_frame ? \
+ (fci)->next->bottom : (fci)->next->frame) : \
+ read_register (SP_REGNUM));
+
+#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
+CORE_ADDR sparc_frame_chain ();
+
+/* 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)
+
+/* Where is the PC for a specific frame */
+
+#define FRAME_SAVED_PC(FRAME) frame_saved_pc (FRAME)
+CORE_ADDR frame_saved_pc ();
+
+/* If the argument is on the stack, it will be here. */
+#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
+
+#define FRAME_STRUCT_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. */
+#define FRAME_NUM_ARGS(val,fi) (val = -1)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 68
+
+/* Put here the code to store, into a struct frame_saved_regs,
+ the addresses of the saved registers of frame described by FRAME_INFO.
+ The actual code is in sparc-tdep.c so we can debug it sanely. */
+
+#define FRAME_FIND_SAVED_REGS(fi, frame_saved_regs) \
+ sparc_frame_find_saved_regs ((fi), &(frame_saved_regs))
+extern void sparc_frame_find_saved_regs ();
+\f
+/* Things needed for making the inferior call functions. */
+/*
+ * First of all, let me give my opinion of what the DUMMY_FRAME
+ * actually looks like.
+ *
+ * | |
+ * | |
+ * + - - - - - - - - - - - - - - - - +<-- fp (level 0)
+ * | |
+ * | |
+ * | |
+ * | |
+ * | Frame of innermost program |
+ * | function |
+ * | |
+ * | |
+ * | |
+ * | |
+ * | |
+ * |---------------------------------|<-- sp (level 0), fp (c)
+ * | |
+ * DUMMY | fp0-31 |
+ * | |
+ * | ------ |<-- fp - 0x80
+ * FRAME | g0-7 |<-- fp - 0xa0
+ * | i0-7 |<-- fp - 0xc0
+ * | other |<-- fp - 0xe0
+ * | ? |
+ * | ? |
+ * |---------------------------------|<-- sp' = fp - 0x140
+ * | |
+ * xcution start | |
+ * sp' + 0x94 -->| CALL_DUMMY (x code) |
+ * | |
+ * | |
+ * |---------------------------------|<-- sp'' = fp - 0x200
+ * | align sp to 8 byte boundary |
+ * | ==> args to fn <== |
+ * Room for | |
+ * i & l's + agg | CALL_DUMMY_STACK_ADJUST = 0x0x44|
+ * |---------------------------------|<-- final sp (variable)
+ * | |
+ * | Where function called will |
+ * | build frame. |
+ * | |
+ * | |
+ *
+ * I understand everything in this picture except what the space
+ * between fp - 0xe0 and fp - 0x140 is used for. Oh, and I don't
+ * understand why there's a large chunk of CALL_DUMMY that never gets
+ * executed (its function is superceeded by PUSH_DUMMY_FRAME; they
+ * are designed to do the same thing).
+ *
+ * PUSH_DUMMY_FRAME saves the registers above sp' and pushes the
+ * register file stack down one.
+ *
+ * call_function then writes CALL_DUMMY, pushes the args onto the
+ * stack, and adjusts the stack pointer.
+ *
+ * run_stack_dummy then starts execution (in the middle of
+ * CALL_DUMMY, as directed by call_function).
+ */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME sparc_push_dummy_frame ()
+#define POP_FRAME sparc_pop_frame ()
+
+void sparc_push_dummy_frame (), sparc_pop_frame ();
+/* This sequence of words is the instructions
+
+ save %sp,-0x140,%sp
+ std %f30,[%fp-0x08]
+ std %f28,[%fp-0x10]
+ std %f26,[%fp-0x18]
+ std %f24,[%fp-0x20]
+ std %f22,[%fp-0x28]
+ std %f20,[%fp-0x30]
+ std %f18,[%fp-0x38]
+ std %f16,[%fp-0x40]
+ std %f14,[%fp-0x48]
+ std %f12,[%fp-0x50]
+ std %f10,[%fp-0x58]
+ std %f8,[%fp-0x60]
+ std %f6,[%fp-0x68]
+ std %f4,[%fp-0x70]
+ std %f2,[%fp-0x78]
+ std %f0,[%fp-0x80]
+ std %g6,[%fp-0x88]
+ std %g4,[%fp-0x90]
+ std %g2,[%fp-0x98]
+ std %g0,[%fp-0xa0]
+ std %i6,[%fp-0xa8]
+ std %i4,[%fp-0xb0]
+ std %i2,[%fp-0xb8]
+ std %i0,[%fp-0xc0]
+ nop ! stcsr [%fp-0xc4]
+ nop ! stfsr [%fp-0xc8]
+ nop ! wr %npc,[%fp-0xcc]
+ nop ! wr %pc,[%fp-0xd0]
+ rd %tbr,%o0
+ st %o0,[%fp-0xd4]
+ rd %wim,%o1
+ st %o0,[%fp-0xd8]
+ rd %psr,%o0
+ st %o0,[%fp-0xdc]
+ rd %y,%o0
+ st %o0,[%fp-0xe0]
+
+ /..* 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 ld instruction. *../
+
+ ld [%sp+0x58],%o5
+ ld [%sp+0x54],%o4
+ ld [%sp+0x50],%o3
+ ld [%sp+0x4c],%o2
+ ld [%sp+0x48],%o1
+ call 0x00000000
+ ld [%sp+0x44],%o0
+ nop
+ ta 1
+ nop
+
+ note that this is 192 bytes, which is a multiple of 8 (not only 4) bytes.
+ note that the `call' insn is a relative, not an absolute call.
+ note that the `nop' at the end is needed to keep the trap from
+ clobbering things (if NPC pointed to garbage instead).
+
+We actually start executing at the `sethi', since the pushing of the
+registers (as arguments) is done by PUSH_DUMMY_FRAME. If this were
+real code, the arguments for the function called by the CALL would be
+pushed between the list of ST insns and the CALL, 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 these ST
+insns to be performed again, lest the registers saved be taken for
+arguments. */
+
+#define CALL_DUMMY { 0x9de3bee0, 0xfd3fbff8, 0xf93fbff0, 0xf53fbfe8, \
+ 0xf13fbfe0, 0xed3fbfd8, 0xe93fbfd0, 0xe53fbfc8, \
+ 0xe13fbfc0, 0xdd3fbfb8, 0xd93fbfb0, 0xd53fbfa8, \
+ 0xd13fbfa0, 0xcd3fbf98, 0xc93fbf90, 0xc53fbf88, \
+ 0xc13fbf80, 0xcc3fbf78, 0xc83fbf70, 0xc43fbf68, \
+ 0xc03fbf60, 0xfc3fbf58, 0xf83fbf50, 0xf43fbf48, \
+ 0xf03fbf40, 0x01000000, 0x01000000, 0x01000000, \
+ 0x01000000, 0x91580000, 0xd027bf50, 0x93500000, \
+ 0xd027bf4c, 0x91480000, 0xd027bf48, 0x91400000, \
+ 0xd027bf44, 0xda03a058, 0xd803a054, 0xd603a050, \
+ 0xd403a04c, 0xd203a048, 0x40000000, 0xd003a044, \
+ 0x01000000, 0x91d02001, 0x01000000, 0x01000000}
+
+#define CALL_DUMMY_LENGTH 192
+
+#define CALL_DUMMY_START_OFFSET 148
+
+#define CALL_DUMMY_STACK_ADJUST 68
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME.
+
+ For structs and unions, if the function was compiled with Sun cc,
+ it expects 'unimp' after the call. But gcc doesn't use that
+ (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY
+ can assume it is operating on a pristine CALL_DUMMY, not one that
+ has already been customized for a different function). */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ \
+ *(int *)((char *) dummyname+168) = (0x40000000|((fun-(pc+168))>>2)); \
+ if (!gcc_p \
+ && (TYPE_CODE (type) == TYPE_CODE_STRUCT \
+ || TYPE_CODE (type) == TYPE_CODE_UNION)) \
+ *(int *)((char *) dummyname+176) = (TYPE_LENGTH (type) & 0x1fff); \
+}
+
+\f
+/* Sparc has no reliable single step ptrace call */
+
+#define NO_SINGLE_STEP 1
+extern void single_step ();
+
+/* We need more arguments in a frame specification for the
+ "frame" or "info frame" command. */
+
+#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
+/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
+ and equivalence between CORE_ADDR and FRAME_ADDR. */
+extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
+
+/* To print every pair of float registers as a double, we use this hook. */
+
+#define PRINT_REGISTER_HOOK(regno) \
+ if (((regno) >= FP0_REGNUM) \
+ && ((regno) < FP0_REGNUM + 32) \
+ && (0 == (regno & 1))) { \
+ char doublereg[8]; /* two float regs */ \
+ if (!read_relative_register_raw_bytes (i , doublereg ) \
+ && !read_relative_register_raw_bytes (i+1, doublereg+4)) { \
+ printf("\t"); \
+ print_floating (doublereg, builtin_type_double, stdout); \
+ } \
+ }
+
+/* Optimization for storing registers to the inferior. The hook
+ DO_DEFERRED_STORES
+ actually executes any deferred stores. It is called any time
+ we are going to proceed the child, or read its registers.
+ The hook CLEAR_DEFERRED_STORES is called when we want to throw
+ away the inferior process, e.g. when it dies or we kill it.
+ FIXME, this does not handle remote debugging cleanly. */
+
+extern int deferred_stores;
+#define DO_DEFERRED_STORES \
+ if (deferred_stores) \
+ target_store_registers (-2);
+#define CLEAR_DEFERRED_STORES \
+ deferred_stores = 0;
--- /dev/null
+/* Target machine definitions for GDB for an embedded SPARC.
+ Copyright 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 "sparc/tm-sparc.h"
+
+/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
+ comment in <machine/setjmp.h>! */
+
+#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
+
+#define JB_ONSSTACK 0
+#define JB_SIGMASK 1
+#define JB_SP 2
+#define JB_PC 3
+#define JB_NPC 4
+#define JB_PSR 5
+#define JB_G1 6
+#define JB_O0 7
+#define JB_WBCNT 8
+
+/* Figure out where the longjmp will land. We expect that we have just entered
+ longjmp and haven't yet setup the stack frame, so the args are still in the
+ output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
+ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
+ This routine returns true on success */
+
+extern int
+get_longjmp_target PARAMS ((CORE_ADDR *));
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
--- /dev/null
+/* Macro definitions for GDB for a Sun 4 running sunos 4.
+ Copyright 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 "sparc/tm-sparc.h"
+#include "tm-sunos.h"
+
+/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
+ comment in <machine/setjmp.h>! */
+
+#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
+
+#define JB_ONSSTACK 0
+#define JB_SIGMASK 1
+#define JB_SP 2
+#define JB_PC 3
+#define JB_NPC 4
+#define JB_PSR 5
+#define JB_G1 6
+#define JB_O0 7
+#define JB_WBCNT 8
+
+/* Figure out where the longjmp will land. We expect that we have just entered
+ longjmp and haven't yet setup the stack frame, so the args are still in the
+ output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
+ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
+ This routine returns true on success */
+
+extern int
+get_longjmp_target PARAMS ((CORE_ADDR *));
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
--- /dev/null
+/* Macro definitions for GDB for a Sun 4 running Solaris 2
+ Copyright 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 "sparc/tm-sparc.h"
+#include "tm-sysv4.h"
+
+/* The values of N_SLINE, N_LBRAC, N_RBRAC symbols in .stab sections are
+ relative to the current function, rather than being absolute or
+ relative to the current N_SO. */
+
+#define BLOCK_ADDRESS_FUNCTION_RELATIVE
+
+/* Variables in the debug stabs occur after the N_LBRAC, not before it,
+ in code generated by Sun C. */
+
+#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
+
+/* There's no need to correct LBRAC entries by guessing how they should
+ work. In fact, this is harmful because the LBRAC entries now all appear
+ at the end of the function, not intermixed with the SLINE entries. */
+
+#define SUN_FIXED_LBRAC_BUG
+
+#if 0 /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
+
+/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
+ comment in <machine/setjmp.h>! */
+
+#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
+
+#define JB_ONSSTACK 0
+#define JB_SIGMASK 1
+#define JB_SP 2
+#define JB_PC 3
+#define JB_NPC 4
+#define JB_PSR 5
+#define JB_G1 6
+#define JB_O0 7
+#define JB_WBCNT 8
+
+/* Figure out where the longjmp will land. We expect that we have just entered
+ longjmp and haven't yet setup the stack frame, so the args are still in the
+ output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
+ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
+ This routine returns true on success */
+
+extern int
+get_longjmp_target PARAMS ((CORE_ADDR *));
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
+#endif /* 0 */
--- /dev/null
+/* Parameters for execution on a Sun 4, for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Contributed by Michael Tiemann (tiemann@mcc.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. */
+
+#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
+
+/* Before storing, we need to read all the registers. */
+
+#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+
+/* It does have a wait structure, and it might help things out . . . */
+
+#define HAVE_WAIT_STRUCT
+
--- /dev/null
+/* Macro definitions for running gdb on a Sun 4 running sunos 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 "sparc/xm-sparc.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 */
+
+/* /usr/include/malloc.h defines these w/o prototypes (and uses
+ char * instead of void *). */
+#define MALLOC_INCOMPATIBLE
+extern char* malloc PARAMS (());
+extern char* realloc PARAMS (());
+extern void free PARAMS (());
+
+/* SunOS 4.x uses nonstandard "char *" as type of third argument to ptrace() */
+
+#define PTRACE_ARG3_TYPE char*
--- /dev/null
+/* Macro definitions for running gdb on a Sun 4 running Solaris 2.
+ Copyright 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. */
+
+/* Most of what we know is generic to SPARC hosts. */
+
+#include "sparc/xm-sparc.h"
+
+/* Pick up more stuff from the generic SVR4 host include file. */
+
+#include "xm-sysv4.h"
+
+/* SVR4's can't seem to agree on what to call the type that contains the
+ general registers. Kludge around it with a #define. */
+
+#define gregset_t prgregset_t
+#define fpregset_t prfpregset_t
+
+/* The native Sun compiler 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
+
+/* 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
+
+/* 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 */
+
+/* These are not currently used in SVR4 (but should be, FIXME!). */
+#undef DO_DEFERRED_STORES
+#undef CLEAR_DEFERRED_STORES
+
+/* May be needed, may be not? From Pace Willisson's port. FIXME. */
+#define NEED_POSIX_SETPGID
+
+/* Solaris PSRVADDR support does not seem to include a place for nPC. */
+#define PRSVADDR_BROKEN
--- /dev/null
+/* Common definitions for GDB native support on Vaxen under 4.2bsd and Ultrix.
+ 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 REGISTER_U_ADDR(addr, blockend, regno) \
+{ addr = blockend - 0110 + regno * 4; \
+ if (regno == PC_REGNUM) addr = blockend - 8; \
+ if (regno == PS_REGNUM) addr = blockend - 4; \
+ if (regno == FP_REGNUM) addr = blockend - 0120; \
+ if (regno == AP_REGNUM) addr = blockend - 0124; \
+ if (regno == SP_REGNUM) addr = blockend - 20; }
+
+
--- /dev/null
+/* Definitions to make GDB run on a vax under 4.2bsd.
+ 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. */
+
+/* There is one known bug with VAX support that I don't know how to
+ fix: if you do a backtrace from a signal handler, you get something
+ like:
+#0 0xbc in kill (592, 3)
+#1 0x7f in hand (...) (...)
+#2 0x7fffec7e in ?? (2, 0, 2147478112, 94)
+ ^^ GDB doesn't know about sigtramp
+#3 0x7fffec70 in ?? (592, 2)
+ ^^^^^^^^^^ wrong address
+#4 0xae in main (...) (...)
+
+when the correct backtrace (as given by adb) is:
+_kill(250,3) from _hand+21
+_hand(2,0,7fffea60,5e) from 7fffec7e
+sigtramp(2,0,7fffea60,5e) from _kill+4
+_kill(250,2) from _main+2e
+_main(1,7fffeac4,7fffeacc) from start+3d
+
+If anyone knows enough about VAX BSD to fix this, please send the
+fix to bug-gdb@prep.ai.mit.edu. */
+
+#define TARGET_BYTE_ORDER LITTLE_ENDIAN
+
+/* Offset from address of function to start of its code.
+ Zero on most machines. */
+
+#define FUNCTION_START_OFFSET 2
+
+/* Advance PC across any function entry prologue instructions
+ to reach some "real" code. */
+
+#define SKIP_PROLOGUE(pc) \
+{ register int op = (unsigned char) read_memory_integer (pc, 1); \
+ if (op == 0x11) pc += 2; /* skip brb */ \
+ if (op == 0x31) pc += 3; /* skip brw */ \
+ if (op == 0xC2 && \
+ ((unsigned char) read_memory_integer (pc+2, 1)) == 0x5E) \
+ pc += 3; /* skip subl2 */ \
+ if (op == 0x9E && \
+ ((unsigned char) read_memory_integer (pc+1, 1)) == 0xAE && \
+ ((unsigned char) read_memory_integer(pc+3, 1)) == 0x5E) \
+ pc += 4; /* skip movab */ \
+ if (op == 0x9E && \
+ ((unsigned char) read_memory_integer (pc+1, 1)) == 0xCE && \
+ ((unsigned char) read_memory_integer(pc+4, 1)) == 0x5E) \
+ pc += 5; /* skip movab */ \
+ if (op == 0x9E && \
+ ((unsigned char) read_memory_integer (pc+1, 1)) == 0xEE && \
+ ((unsigned char) read_memory_integer(pc+6, 1)) == 0x5E) \
+ pc += 7; /* skip movab */ \
+}
+
+/* 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) FRAME_SAVED_PC(frame)
+
+#define TARGET_UPAGES 10
+#define TARGET_NBPG 512
+#define STACK_END_ADDR (0x80000000 - (TARGET_UPAGES * TARGET_NBPG))
+
+/* On the VAX, sigtramp is in the u area. Can't check the exact
+ addresses because for cross-debugging we don't have VAX include
+ files around. This should be close enough. */
+#define IN_SIGTRAMP(pc, name) ((pc) >= STACK_END_ADDR && (pc < 0x80000000))
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {3}
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* Nonzero if instruction at PC is a return instruction. */
+
+#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 04)
+
+/* Return 1 if P points to an invalid floating point value.
+ LEN is the length in bytes -- not relevant on the Vax. */
+
+#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+
+#define NUM_REGS 17
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc", "ps"}
+
+/* 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 AP_REGNUM 12
+#define FP_REGNUM 13 /* Contains address of executing stack frame */
+#define SP_REGNUM 14 /* Contains address of top of stack */
+#define PC_REGNUM 15 /* Contains program counter */
+#define PS_REGNUM 16 /* Contains processor status */
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (17*4)
+
+/* 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 vax, 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 vax, 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) \
+ bcopy ((FROM), (TO), 4);
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), 4);
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
+
+/* 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 (1, (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. */
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+
+/* 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) (*(int *)(REGBUF))
+
+\f
+/* 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 Vax, the frame's nominal address is the FP value,
+ and 12 bytes later comes the saved previous FP value as a 4-byte word. */
+
+#define FRAME_CHAIN(thisframe) \
+ (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer ((thisframe)->frame + 12, 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. */
+/* On the vax, all functions have frames. */
+#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
+
+/* Saved Pc. */
+
+#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 16, 4))
+
+/* Cannot find the AP register value directly from the FP value. Must
+ find it saved in the frame called by this one, or in the AP
+ register for the innermost frame. However, there is no way to tell
+ the difference between the innermost frame and a frame for which we
+ just don't know the frame that it called (e.g. "info frame
+ 0x7ffec789"). For the sake of argument suppose that the stack is
+ somewhat trashed (which is one reason that "info frame" exists).
+ So return 0 (indicating we don't know the address of
+ the arglist) if we don't know what frame this frame calls. */
+#define FRAME_ARGS_ADDRESS_CORRECT(fi) \
+ (((fi)->next_frame \
+ ? read_memory_integer ((fi)->next_frame + 8, 4) \
+ : /* read_register (AP_REGNUM) */ 0))
+
+/* In most of GDB, getting the args address is too important to
+ just say "I don't know". This is sometimes wrong for functions
+ that aren't on top of the stack, but c'est la vie. */
+#define FRAME_ARGS_ADDRESS(fi) \
+ (((fi)->next_frame \
+ ? read_memory_integer ((fi)->next_frame + 8, 4) \
+ : read_register (AP_REGNUM) /* 0 */))
+
+#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(numargs, fi) \
+{ numargs = (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1)); }
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 4
+
+/* 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 = read_memory_integer ((frame_info)->frame+4, 4) >> 16; \
+ register CORE_ADDR next_addr; \
+ bzero (&frame_saved_regs, sizeof frame_saved_regs); \
+ next_addr = (frame_info)->frame + 16; \
+ /* Regmask's low bit is for register 0, \
+ which is the first one that would be pushed. */ \
+ for (regnum = 0; regnum < 12; regnum++, regmask >>= 1) \
+ (frame_saved_regs).regs[regnum] = (regmask & 1) ? (next_addr += 4) : 0; \
+ (frame_saved_regs).regs[SP_REGNUM] = next_addr + 4; \
+ if (read_memory_integer ((frame_info)->frame + 4, 4) & 0x20000000) \
+ (frame_saved_regs).regs[SP_REGNUM] += 4 + 4 * read_memory_integer (next_addr + 4, 4); \
+ (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 16; \
+ (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 12; \
+ (frame_saved_regs).regs[AP_REGNUM] = (frame_info)->frame + 8; \
+ (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \
+}
+\f
+/* Things needed for making the inferior call functions. */
+
+/* Push an empty stack frame, to record the current PC, etc. */
+
+#define PUSH_DUMMY_FRAME \
+{ register CORE_ADDR sp = read_register (SP_REGNUM);\
+ register int regnum; \
+ sp = push_word (sp, 0); /* arglist */ \
+ for (regnum = 11; regnum >= 0; regnum--) \
+ sp = push_word (sp, read_register (regnum)); \
+ sp = push_word (sp, read_register (PC_REGNUM)); \
+ sp = push_word (sp, read_register (FP_REGNUM)); \
+ sp = push_word (sp, read_register (AP_REGNUM)); \
+ sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) \
+ + 0x2fff0000); \
+ sp = push_word (sp, 0); \
+ write_register (SP_REGNUM, sp); \
+ write_register (FP_REGNUM, sp); \
+ write_register (AP_REGNUM, sp + 17 * sizeof (int)); }
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME \
+{ register CORE_ADDR fp = read_register (FP_REGNUM); \
+ register int regnum; \
+ register int regmask = read_memory_integer (fp + 4, 4); \
+ write_register (PS_REGNUM, \
+ (regmask & 0xffff) \
+ | (read_register (PS_REGNUM) & 0xffff0000)); \
+ write_register (PC_REGNUM, read_memory_integer (fp + 16, 4)); \
+ write_register (FP_REGNUM, read_memory_integer (fp + 12, 4)); \
+ write_register (AP_REGNUM, read_memory_integer (fp + 8, 4)); \
+ fp += 16; \
+ for (regnum = 0; regnum < 12; regnum++) \
+ if (regmask & (0x10000 << regnum)) \
+ write_register (regnum, read_memory_integer (fp += 4, 4)); \
+ fp = fp + 4 + ((regmask >> 30) & 3); \
+ if (regmask & 0x20000000) \
+ { regnum = read_memory_integer (fp, 4); \
+ fp += (regnum + 1) * 4; } \
+ write_register (SP_REGNUM, fp); \
+ flush_cached_frames (); \
+ set_current_frame (create_new_frame (read_register (FP_REGNUM),\
+ read_pc ())); }
+
+/* This sequence of words is the instructions
+ calls #69, @#32323232
+ bpt
+ Note this is 8 bytes. */
+
+#define CALL_DUMMY {0x329f69fb, 0x03323232}
+
+#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
+
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME. */
+
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+{ *((char *) dummyname + 1) = nargs; \
+ *(int *)((char *) dummyname + 3) = fun; }
--- /dev/null
+# Target: DEC VAX running BSD or Ultrix
+TDEPFILES= vax-pinsn.o exec.o
+TM_FILE= tm-vax.h
--- /dev/null
+# Host: DEC VAX running BSD
+# The following types of /bin/cc failures have been observed:
+# 1. Something in readline.c which I have never seen
+# 2. ``"values.c", line 816: compiler error: schain botch''
+#msg /bin/cc has been known to fail on VAXen running BSD4.3
+#msg If this occurs, use gcc
+#msg (but see comments in Makefile.dist about compiling with gcc).
+
+XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+REGEX=regex.o
+REGEX1=regex.o
+XM_FILE= xm-vaxbsd.h
--- /dev/null
+# Host: DEC VAX running Ultrix
+
+XDEPFILES=
+REGEX=regex.o
+REGEX1=regex.o
+XM_FILE= xm-vaxult.h
+NAT_FILE= nm-vax.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
--- /dev/null
+# Host: DEC VAX running Ultrix
+
+XDEPFILES=
+REGEX=regex.o
+REGEX1=regex.o
+XM_FILE= xm-vaxult2.h
+NAT_FILE= nm-vax.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
--- /dev/null
+/* Common definitions to make GDB run on Vaxen under 4.2bsd and Ultrix.
+ 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 HOST_BYTE_ORDER LITTLE_ENDIAN
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* 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 (0x80000000 - (UPAGES * NBPG))
+
+/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
+#define ONE_PROCESS_WRITETEXT
+
+/* 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, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
+ 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 0, 0}
+
+/* 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 ("pushl fp");
+
+/* 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 ("pushl 8(sp)"); \
+ asm ("pushl 8(sp)"); \
+ asm ("pushal 0x14(sp)"); \
+ asm ("pushr $037777"); }
+
+/* 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 ("popr $037777"); \
+ asm ("subl2 $8,(sp)"); \
+ asm ("movl (sp),sp"); \
+ asm ("rei"); }
--- /dev/null
+/* Definitions to make GDB run on a vax under 4.2bsd. */
+
+/* We have to include these files now, so that GDB will not make
+ competing definitions in defs.h. */
+#include <machine/endian.h>
+#include <machine/limits.h>
+#include "vax/xm-vax.h"
+
+/* In non-ANSI compiles, memcpy and memset are still void *, not char *. */
+#define MEM_FNS_DECLARED
--- /dev/null
+/* Definitions to make GDB run on a vax under Ultrix. */
+
+#include "vax/xm-vax.h"
+extern char *strdup();
+
+#define MEM_FNS_DECLARED
--- /dev/null
+/* Definitions to make GDB run on a vax under Ultrix. */
+
+#include "vax/xm-vax.h"
+extern char *strdup();
+
+#define MEM_FNS_DECLARED
+#define NO_PTRACE_H
--- /dev/null
+/* Parameters for execution on a z8000 series machine.
+ Copyright 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 IEEE_FLOAT 1
+
+#undef TARGET_INT_BIT
+#undef TARGET_LONG_BIT
+#undef TARGET_SHORT_BIT
+#undef TARGET_PTR_BIT
+
+#define TARGET_SHORT_BIT 16
+#define TARGET_INT_BIT 16
+#define TARGET_LONG_BIT 32
+#define TARGET_PTR_BIT (BIG ? 32: 16)
+
+/* 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. */
+
+#define SKIP_PROLOGUE(ip) {(ip) = z8k_skip_prologue(ip);}
+extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
+
+
+/* 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) saved_pc_after_call(frame)
+
+/* Stack grows downward. */
+
+#define INNER_THAN <
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0x36,0x00}
+
+/* If your kernel resets the pc after the trap happens you may need to
+ define this before including this file. */
+
+#define DECR_PC_AFTER_BREAK 0
+
+/* 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) about_to_return(pc)
+
+/* 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 unsigned int
+
+#define NUM_REGS 23 /* 16 registers + 1 ccr + 1 pc + 3 debug
+ regs + fake fp + fake sp*/
+#define REGISTER_BYTES (NUM_REGS *4)
+
+/* 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 z8k, all but the pc are 2 bytes, but we
+ keep them all as 4 bytes and trim them on I/O */
+
+
+#define REGISTER_RAW_SIZE(N) (((N) < 16)? 2:4)
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
+
+/* 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) \
+ register_convert_to_virtual(REGNUM, FROM, TO)
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ register_convert_to_raw(REGNUM, FROM, TO)
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) \
+ (REGISTER_VIRTUAL_SIZE(N) == 2? builtin_type_unsigned_int : builtin_type_long)
+
+/*#define INIT_FRAME_PC(x,y) init_frame_pc(x,y)*/
+/* Initializer for an array of names of registers.
+ Entries beyond the first NUM_REGS are ignored. */
+
+#define REGISTER_NAMES \
+ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
+ "ccr", "pc", "cycles","insts","time","fp","sp"}
+
+/* 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 CCR_REGNUM 16 /* Contains processor status */
+#define PC_REGNUM 17 /* Contains program counter */
+#define CYCLES_REGNUM 18
+#define INSTS_REGNUM 19
+#define TIME_REGNUM 20
+#define FP_REGNUM 21 /* Contains fp, whatever memory model */
+#define SP_REGNUM 22 /* Conatins sp, whatever memory model */
+
+
+
+#define PTR_SIZE (BIG ? 4: 2)
+#define PTR_MASK (BIG ? 0xff00ffff : 0x0000ffff)
+
+/* 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) abort();
+
+/* 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. */
+
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy(REGBUF + REGISTER_BYTE(2), VALBUF, TYPE_LENGTH(TYPE));
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) abort();
+
+/* 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))
+\f
+/* 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 Z8000, the frame's nominal address
+ is the address of a ptr sized byte word containing the calling
+ frame's address. */
+
+#define FRAME_CHAIN(thisframe) frame_chain(thisframe);
+
+
+
+/* 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) frame_saved_pc(FRAME)
+
+#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
+
+
+\f
+/* 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. */
+
+
+#define CALL_DUMMY { 0 }
+#define CALL_DUMMY_LENGTH 24 /* Size of CALL_DUMMY */
+#define CALL_DUMMY_START_OFFSET 8 /* Offset to jsr instruction*/
+
+
+/* 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 { z8k_push_dummy_frame (); }
+
+extern void z8k_push_dummy_frame PARAMS ((void));
+
+extern void z8k_pop_frame PARAMS ((void));
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+
+#define POP_FRAME { z8k_pop_frame (); }
+
+/* Offset from SP to first arg on stack at first instruction of a function */
+
+#define SP_ARG0 (1 * 4)
+
+#define ADDR_BITS_REMOVE(x) addr_bits_remove(x)
+#define ADDR_BITS_SET(x) addr_bits_set(x)
+int z8001_mode;
+#define BIG (z8001_mode)
+
+#define read_memory_short(x) (read_memory_integer(x,2) & 0xffff)
+
+#define NO_STD_REGS
+
+#define PRINT_REGISTER_HOOK(regno) print_register_hook(regno)
+
+
+#define INIT_EXTRA_SYMTAB_INFO \
+ z8k_set_pointer_size(objfile->obfd->arch_info->bits_per_address);
--- /dev/null
+# Target: Z8000 simulator
+TDEPFILES= exec.o z8k-tdep.o remote-z8k.o ../sim/z8k/libsim.a ../opcodes/libopcodes.a
+TM_FILE= tm-z8k.h