* config/{*.mt, *.mh}: All target and host makefile fragment

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.
This commit is contained in:
Fred Fish 1993-03-23 01:19:58 +00:00
parent 8256379df2
commit 5076de826c
210 changed files with 12724 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# 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

View File

@ -0,0 +1,5 @@
# 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

10
gdb/config/a29k/a29k.mt Normal file
View File

@ -0,0 +1,10 @@
# 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

View File

@ -0,0 +1,26 @@
/* 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

709
gdb/config/a29k/tm-a29k.h Normal file
View File

@ -0,0 +1,709 @@
/* 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)
/* 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)); \
}
/* 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 ();
#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 ();
/* 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
/* 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. */
/* 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))

226
gdb/config/a29k/tm-ultra3.h Normal file
View File

@ -0,0 +1,226 @@
/* 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 */

View File

@ -0,0 +1,9 @@
# 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

View File

@ -0,0 +1,5 @@
# 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

View File

@ -0,0 +1,56 @@
/* 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

3
gdb/config/arm/arm.mh Normal file
View File

@ -0,0 +1,3 @@
# 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

3
gdb/config/arm/arm.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: Acorn RISC machine running RISCiX (4.3bsd)
TDEPFILES= arm-tdep.o arm-pinsn.o
TM_FILE= tm-arm.h

88
gdb/config/arm/xm-arm.h Normal file
View File

@ -0,0 +1,88 @@
/* 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
#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 */

View File

@ -0,0 +1,3 @@
# 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

305
gdb/config/h8300/tm-h8300.h Normal file
View File

@ -0,0 +1,305 @@
/* 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))
/* 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))
/* 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)

View File

@ -0,0 +1,3 @@
# 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

293
gdb/config/h8500/tm-h8500.h Normal file
View File

@ -0,0 +1,293 @@
/* 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))
/* 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))
/* 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

View File

@ -0,0 +1,4 @@
# Target: Intel 386 with a.out
TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
TM_FILE= tm-i386v.h

View File

@ -0,0 +1,7 @@
# 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

View File

@ -0,0 +1,3 @@
# Target: Intel 386 running BSD
TDEPFILES= i386-tdep.o i386-pinsn.o
TM_FILE= tm-i386bsd.h

View File

@ -0,0 +1,6 @@
# 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

View File

@ -0,0 +1,13 @@
# 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

View File

@ -0,0 +1,16 @@
# 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

View File

@ -0,0 +1,34 @@
# 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

View File

@ -0,0 +1,3 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-pinsn.o i386-tdep.o i387-tdep.o solib.o
TM_FILE= tm-i386v4.h

9
gdb/config/i386/i386v.mh Normal file
View File

@ -0,0 +1,9 @@
# 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

3
gdb/config/i386/i386v.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: Intel 386 running System V
TDEPFILES= exec.o i386-tdep.o i386-pinsn.o i387-tdep.o
TM_FILE= tm-i386v.h

View File

@ -0,0 +1,9 @@
# 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

33
gdb/config/i386/i386v4.mh Normal file
View File

@ -0,0 +1,33 @@
# 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

View File

@ -0,0 +1,3 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-pinsn.o i386-tdep.o i387-tdep.o solib.o
TM_FILE= tm-i386v4.h

3
gdb/config/i386/linux.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: Intel 386 with a.out
TDEPFILES= i386-tdep.o i386-pinsn.o i387-tdep.o
TM_FILE= tm-linux.h

View File

@ -0,0 +1,43 @@
# 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

View File

@ -0,0 +1,3 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-pinsn.o i386-tdep.o i387-tdep.o solib.o
TM_FILE= tm-i386v4.h

View File

@ -0,0 +1,34 @@
/* 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*

View File

@ -0,0 +1,25 @@
/* 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

View File

@ -0,0 +1,42 @@
/* 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

View File

@ -0,0 +1,32 @@
/* 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

View File

@ -0,0 +1,36 @@
/* 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));

View File

@ -0,0 +1,20 @@
/* 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. */

View File

@ -0,0 +1,26 @@
/* 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

View File

@ -0,0 +1,5 @@
# 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

View File

@ -0,0 +1,3 @@
# Target: Sun 386i target configuration file.
TDEPFILES= i386-pinsn.o solib.o
TM_FILE= tm-sun386.h

View File

@ -0,0 +1,3 @@
# 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

View File

@ -0,0 +1,3 @@
# Target: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
TDEPFILES= symm-tdep.o i386-pinsn.o
TM_FILE= tm-symmetry.h

View File

@ -0,0 +1,28 @@
/* 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

313
gdb/config/i386/tm-i386v.h Normal file
View File

@ -0,0 +1,313 @@
/* 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))
/* 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 *));
/* 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) */

View File

@ -0,0 +1,69 @@
/* 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)

315
gdb/config/i386/tm-sun386.h Normal file
View File

@ -0,0 +1,315 @@
/* 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))
/* 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 *));
/* 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; \
}

View File

@ -0,0 +1,401 @@
/* 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))
/* 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 *));
/* 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));

32
gdb/config/i386/xm-go32.h Normal file
View File

@ -0,0 +1,32 @@
/* 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(); }

View File

@ -0,0 +1,31 @@
/* 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

View File

@ -0,0 +1,43 @@
/* 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();

View File

@ -0,0 +1,46 @@
/* 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

View File

@ -0,0 +1,45 @@
/* 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

View File

@ -0,0 +1,28 @@
/* 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

View File

@ -0,0 +1,45 @@
/* 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 */

View File

@ -0,0 +1,26 @@
/* 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

View File

@ -0,0 +1,34 @@
/* 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)

View File

@ -0,0 +1,245 @@
/* 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)
/* 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"); }

View File

@ -0,0 +1,3 @@
# 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

386
gdb/config/i960/tm-i960.h Normal file
View File

@ -0,0 +1,386 @@
/* 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)
/* 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")
/* 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)
/* 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.) */

View File

@ -0,0 +1,104 @@
/* 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

View File

@ -0,0 +1,42 @@
/* 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} */

View File

@ -0,0 +1,5 @@
# 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

12
gdb/config/m68k/3b1.mh Normal file
View File

@ -0,0 +1,12 @@
# Host: AT&T 3b1/Unix pc
# I don't think cc has been tried. -traditional for <sys/ioctl.h>
# (not sure whether necessary).
CC= gcc -traditional
# GCC runs out of virtual memory.
# A separate CC for pinsn routines is no longer supported, though.
# FIXME -- someone unlucky enough to have a 3B1, let bug-gcc@prep.ai.mit.edu
# know what works and what fails on the 3B1.
#PINSN_CC= cc
XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
XM_FILE= xm-3b1.h

3
gdb/config/m68k/3b1.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: AT&T 3b1/Unix pc
TDEPFILES= exec.o m68k-pinsn.o
TM_FILE= tm-3b1.h

6
gdb/config/m68k/altos.mh Normal file
View File

@ -0,0 +1,6 @@
# Host: Altos 3068 (68k, System V release 2)
XDEPFILES= infptrace.o inftarg.o fork-child.o altos-xdep.o
XM_FILE= xm-altos.h
REGEX=regex.o
REGEX1=regex.o
SYSV_DEFINE=-DSYSV

3
gdb/config/m68k/altos.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: Altos 3068 (68k, System V release 2)
TDEPFILES= m68k-pinsn.o exec.o
TM_FILE= tm-altos.h

26
gdb/config/m68k/amix.mh Normal file
View File

@ -0,0 +1,26 @@
# Host: Commodore Amiga running SVR4.
NAT_FILE= nm-sysv4.h
NATDEPFILES= corelow.o procfs.o fork-child.o
XDEPFILES=
XM_FILE= xm-amix.h
SYSV_DEFINE=-DSYSV
REGEX=regex.o
REGEX1=regex.o
# We need to find alloca() somewhere. Gcc has one built in, but most other
# compilers don't. Using the one in /usr/ucblib/libucb.a is tricky because
# we have to be careful not to pull in anything else from the library (lots
# of things are broken in most SVR4 versions). The best solution is to just
# compile alloca.c and link it into the executable. If we end up not needing
# it, then the code is just dead. Once alloca.c moves to libiberty, then we
# can eliminate this semi-kludge.
ALLOCA=alloca.o
ALLOCA1=alloca.o
# SVR4 comes standard with terminfo, and in some implementations, the
# old termcap descriptions are incomplete. So ensure that we use the
# new terminfo interface and latest terminal descriptions.
TERMCAP=-ltermlib
# SVR4 puts the BSD compatible install in /usr/ucb.
INSTALL = /usr/ucb/install -c

3
gdb/config/m68k/amix.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: Commodore Amiga running SVR4
TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o solib.o
TM_FILE= tm-amix.h

View File

@ -0,0 +1,6 @@
# Host: Apollo 68k, BSD mode.
XM_FILE= xm-apollo68b.h
XDEPFILES= ser-bsd.o
NAT_FILE= nm-apollo68b.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o

View File

@ -0,0 +1,10 @@
RANLIB=echo >/dev/null
XM_FILE= xm-apollo68v.h
XM_CLIBS= -lPW
SYSV_DEFINE=-DSYSV
REGEX=regex.o
REGEX1=regex.o
CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_SYS_FILE
XDEPFILES=
NAT_FILE= nm-apollo68v.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o

View File

@ -0,0 +1,3 @@
# Target: Ericcson ES-1800 emulator (remote) for m68k.
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o remote-es1800.o
TM_FILE= tm-es1800.h

View File

@ -0,0 +1,7 @@
# Host: Hewlett-Packard 9000 series 300, running BSD
XDEPFILES=
XM_FILE= xm-hp300bsd.h
NAT_FILE= nm-hp300bsd.h
NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o coredep.o corelow.o
REGEX=regex.o
REGEX1=regex.o

View File

@ -0,0 +1,3 @@
# Target: Hewlett-Packard 9000 series 300, running BSD
TDEPFILES= m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-hp300bsd.h

View File

@ -0,0 +1,15 @@
# Host: Hewlett-Packard 9000 series 300, running HPUX
# The following is true because gcc uses a different .o file format
# than the native HPUX compiler
#msg If you compile GDB with GCC on HPUX, you must make sure
#msg that the `nm' used in `munch' is GNU nm
#msg
XM_FILE= xm-hp300hpux.h
NAT_FILE= nm-hp300hpux.h
NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o hp300ux-nat.o
SYSV_DEFINE=-DSYSV
REGEX=regex.o
REGEX1=regex.o
ALLOCA=alloca.o
ALLOCA1=alloca.o

View File

@ -0,0 +1,11 @@
# Target: Hewlett-Packard 9000 series 300, running HPUX
#msg Note that GDB can only read symbols from programs that were
#msg compiled with GCC
#msg
# The headers in the directory hp-include override system headers
# and tell GDB to use BSD executable file format (hence -Ihp-include)
MT_CFLAGS=-Ihp-include
TDEPFILES= m68k-pinsn.o
TM_FILE= tm-hp300hpux.h

3
gdb/config/m68k/isi.mh Normal file
View File

@ -0,0 +1,3 @@
# Host: ISI Optimum V (3.05) under 4.3bsd.
XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
XM_FILE= xm-isi.h

3
gdb/config/m68k/isi.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: ISI Optimum V (3.05) under 4.3bsd.
TDEPFILES= exec.o m68k-pinsn.o
TM_FILE= tm-isi.h

View File

@ -0,0 +1,3 @@
# Target: Motorola 68xxx with floating point
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-68k-fp.h

View File

@ -0,0 +1,3 @@
# Target: Motorola 68xxx without floating point
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-68k-nofp.h

5
gdb/config/m68k/news.mh Normal file
View File

@ -0,0 +1,5 @@
# Host: Sony news series 700/800/900 (68020) running NewsOS version 3.
XDEPFILES= news-xdep.o
XM_FILE= xm-news.h
NAT_FILE= nm-news.h
NATDEPFILES= exec.o inftarg.o fork-child.o coredep.o corelow.o infptrace.o

3
gdb/config/m68k/news.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: Sony news series 700/800/900 (68020) running NewsOS version 3.
TDEPFILES= m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-news.h

View File

@ -0,0 +1,3 @@
# Host: Sony news series 1000 (68030) running NewsOS version 3.
XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o news-xdep.o
XM_FILE= xm-news1000.h

View File

@ -0,0 +1,23 @@
/* Macro defintions for an Apollo 68k in BSD mode
Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define PTRACE_IN_WRONG_PLACE
#define FETCH_INFERIOR_REGISTERS

View File

@ -0,0 +1,20 @@
/* Macro defintions for an Apollo.
Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define FETCH_INFERIOR_REGISTERS

View File

@ -0,0 +1,97 @@
/* Parameters for Hewlett-Packard 9000/300 native support under bsd.
Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This is a hack. This is only a hack. Were this a common source file,
rather than a config file specific to BSD on HP 68k's, you would have
been instructed to clean this up. As it is, clean it up if FSF's
HP's-running-ancient-BSD ever go away. */
#include <errno.h>
#ifdef EPROCUNAVAIL
/* BSD 4.4 alpha or better */
/* We can attach to processes using ptrace. */
#define ATTACH_DETACH
#define PTRACE_ATTACH 10
#define PTRACE_DETACH 11
/* The third argument of ptrace is declared as this type. */
#define PTRACE_ARG3_TYPE caddr_t
/* U_REGS_OFFSET is the offset of the registers within the u area for
ptrace purposes. */
#define U_REGS_OFFSET \
ptrace (PT_READ_U, inferior_pid, \
(PTRACE_ARG3_TYPE) \
(offsetof (struct user, u_kproc.kp_proc.p_md.md_regs)), 0) \
- USRSTACK
/* This is a piece of magic that is given a register number REGNO
and as BLOCKEND the address in the system of the end of the user structure
and stores in ADDR the address in the kernel or core dump
of that register. */
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ \
if (regno < PS_REGNUM) \
addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \
else if (regno == PS_REGNUM) \
addr = (int) &((struct frame *)(blockend))->f_stackadj; \
else if (regno == PC_REGNUM) \
addr = (int) &((struct frame *)(blockend))->f_pc; \
else if (regno < FPC_REGNUM) \
addr = (int) \
&((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\
else if (regno == FPC_REGNUM) \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \
else if (regno == FPS_REGNUM) \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \
else \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \
}
#else
/* THIS IS BSD 4.3 or something like it. */
/* This is a piece of magic that is given a register number REGNO
and as BLOCKEND the address in the system of the end of the user structure
and stores in ADDR the address in the kernel or core dump
of that register. */
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ \
if (regno < PS_REGNUM) \
addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \
else if (regno == PS_REGNUM) \
addr = (int) &((struct frame *)(blockend))->f_stackadj; \
else if (regno == PC_REGNUM) \
addr = (int) &((struct frame *)(blockend))->f_pc; \
else if (regno < FPC_REGNUM) \
addr = (int) \
&((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\
else if (regno == FPC_REGNUM) \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \
else if (regno == FPS_REGNUM) \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \
else \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \
}
#endif

View File

@ -0,0 +1,26 @@
/* Parameters for native support on HP 9000 model 320, for GDB, the GNU debugger.
Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Do implement the attach and detach commands. */
#define ATTACH_DETACH
/* fetch_inferior_registers is in nat-hp300hpux.c. */
#define FETCH_INFERIOR_REGISTERS

20
gdb/config/m68k/nm-news.h Normal file
View File

@ -0,0 +1,20 @@
/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
Copyright 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This file intentionally empty. */

33
gdb/config/m68k/nm-sun2.h Normal file
View File

@ -0,0 +1,33 @@
/* Parameters for execution on a Sun2, for GDB, the GNU debugger.
Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Do implement the attach and detach commands. */
#define ATTACH_DETACH
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
/* This is a piece of magic that is given a register number REGNO
and as BLOCKEND the address in the system of the end of the user structure
and stores in ADDR the address in the kernel or core dump
of that register. */
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ addr = blockend + regno * 4; }

26
gdb/config/m68k/nm-sun3.h Normal file
View File

@ -0,0 +1,26 @@
/* Host-dependent definitions for Sun-3 for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Do implement the attach and detach commands. */
#define ATTACH_DETACH
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS

3
gdb/config/m68k/os68k.mt Normal file
View File

@ -0,0 +1,3 @@
# Target: VxWorks running on a 68000
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-os68k.h

View File

@ -0,0 +1,7 @@
# Target: Tandem ST-2000 phone switch
# These defines should give you a gdb running on anything that will be able to
# communicate with a Tandem ST2000 phone switch debug monitor. Communications
# is facilitated via either a serial line, or a TCP or TELNET connection to
# a serial line on a terminal multiplexor.
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o remote-st2000.o
TM_FILE= tm-st2000.h

View File

@ -0,0 +1,5 @@
# Host: Sun 2, running SunOS 3
XDEPFILES=
XM_FILE= xm-sun2.h
NAT_FILE= nm-sun2.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o

View File

@ -0,0 +1,8 @@
# Target: Sun 2, running SunOS 3
# The system-supplied assembler re-orders the symbols so that gdb
# can't find "gcc_compiled.".
#msg If you compile your program with GCC, use the GNU assembler.
#msg
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-sun2.h

View File

@ -0,0 +1,5 @@
# Host: Sun 2, running SunOS 4
XDEPFILES=
XM_FILE= xm-sun2.h
NAT_FILE= nm-sun2.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o

View File

@ -0,0 +1,3 @@
# Target: Sun 2, running SunOS 4
TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o
TM_FILE= tm-sun2os4.h

View File

@ -0,0 +1,5 @@
# Host: Sun 3, running SunOS 3
XDEPFILES=
XM_FILE= xm-sun3.h
NAT_FILE= nm-sun3.h
NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o

View File

@ -0,0 +1,8 @@
# Target: Sun 3, running SunOS 3
# The system-supplied assembler re-orders the symbols so that gdb
# can't find "gcc_compiled.".
#msg If you compile your program with GCC, use the GNU assembler.
#msg
TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
TM_FILE= tm-sun3.h

View File

@ -0,0 +1,5 @@
# Host: Sun 3, running SunOS 4
XDEPFILES=
XM_FILE= xm-sun3os4.h
NAT_FILE= nm-sun3.h
NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o

View File

@ -0,0 +1,3 @@
# Target: Sun 3, running SunOS 4, as a target system
TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o
TM_FILE= tm-sun3os4.h

Some files were not shown because too many files have changed in this diff Show More