Host/target/native split for sun4.
[deliverable/binutils-gdb.git] / gdb / tm-mips.h
index edc6aabbc2d803980cc3be1b4a1b7c0375b31550..0604ddb90350fe59609137c91099a40c4143fbcb 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions to make GDB run on a mips box under 4.3bsd.
-   Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
-   Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
-   and by Alessandro Forin(af@cs.cmu.edu) at CMU
+   Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+   Contributed by Per Bothner (bothner@cs.wisc.edu) at U.Wisconsin
+   and by Alessandro Forin (af@cs.cmu.edu) at CMU.
 
 This file is part of GDB.
 
@@ -19,10 +19,18 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#include "coff/sym.h"          /* Needed for PDR below.  */
+#include "coff/symconst.h"
+
 #if !defined (TARGET_BYTE_ORDER)
 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
 #endif
 
+/* FIXME, this triggers host-and-target (``native'') dependent code
+   which currently sits in mips-xdep.c.  Needs to be moved out to
+   mips-nat.c or some such.  */
+#define        GDB_TARGET_IS_MIPS
+
 /* Floating point is IEEE compliant */
 #define IEEE_FLOAT
 
@@ -31,14 +39,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /*#define NAMES_HAVE_UNDERSCORE*/
 
-/* Debugger information will be in mips' format */
-
-#define READ_MIPS_FORMAT
-
-/* File format is coff, but with additions */
-
-#define COFF_FORMAT
-
 /* Offset from address of function to start of its code.
    Zero on most machines.  */
 
@@ -95,7 +95,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* Number of machine registers */
 
-#define NUM_REGS 73
+#define NUM_REGS 80
 
 /* Initializer for an array of names of registers.
    There should be NUM_REGS strings in this initializer.  */
@@ -107,10 +107,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
        "t8",   "t9",   "k0",   "k1",   "gp",   "sp",   "s8",   "ra", \
        "sr",   "lo",   "hi",   "bad",  "cause","pc",    \
        "f0",   "f1",   "f2",   "f3",   "f4",   "f5",   "f6",   "f7", \
-       "f8",   "f9",   "f10",   "f11",   "f12",   "f13",   "f14",   "f15", \
-       "f16",   "f17",   "f18",   "f19",   "f20",   "f21",   "f22",   "f23",\
-       "f24",   "f25",   "f26",   "f27",   "f28",   "f29",   "f30",   "f31",\
-       "fsr",   "fir", "fp" \
+       "f8",   "f9",   "f10",  "f11",  "f12",  "f13",  "f14",  "f15", \
+       "f16",  "f17",  "f18",  "f19",  "f20",  "f21",  "f22",  "f23",\
+       "f24",  "f25",  "f26",  "f27",  "f28",  "f29",  "f30",  "f31",\
+       "fsr",  "fir",  "fp",   "inx",  "rand", "tlblo","ctxt", "tlbhi",\
+       "epc",  "prid"\
     }
 
 /* Register numbers of various important registers.
@@ -120,16 +121,22 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    to be actual register numbers as far as the user is concerned
    but do serve to get the desired values when passed to read_register.  */
 
+#define ZERO_REGNUM 0          /* read-only register, always 0 */
+#define A0_REGNUM 4            /* Loc of first arg during a subr call */
 #define SP_REGNUM 29           /* Contains address of top of stack */
-#define PC_REGNUM 37           /* Contains program counter */
 #define RA_REGNUM 31           /* Contains return address value */
 #define PS_REGNUM 32           /* Contains processor status */
 #define HI_REGNUM 34            /* Multiple/divide temp */
 #define LO_REGNUM 33            /* ... */
+#define BADVADDR_REGNUM 35     /* bad vaddr for addressing exception */
+#define CAUSE_REGNUM 36                /* describes last exception */
+#define PC_REGNUM 37           /* Contains program counter */
 #define FP0_REGNUM 38           /* Floating point register 0 (single float) */
 #define FCRCS_REGNUM 70         /* FP control/status */
 #define FCRIR_REGNUM 71         /* FP implementation/revision */
 #define FP_REGNUM 72           /* Pseudo register that contains true address of executing stack frame */
+#define        FIRST_EMBED_REGNUM 73   /* First supervisor register for embedded use */
+#define        LAST_EMBED_REGNUM 79    /* Last one */
 
 /* Define DO_REGISTERS_INFO() to do machine-specific formatting
    of register dumps. */
@@ -183,7 +190,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
 
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
+#define REGISTER_VIRTUAL_TYPE(N) \
+       (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32)  \
+        ? builtin_type_float : builtin_type_int) \
+
 /* Store the address of the place in which to copy the structure the
    subroutine will return.  This is called from call_function. */
 
@@ -217,22 +227,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    (its caller).  */
 
 /* FRAME_CHAIN takes a frame's nominal address
-   and produces the frame's chain-pointer.
-
-   FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
-   and produces the nominal address of the caller frame.
-
-   However, if FRAME_CHAIN_VALID returns zero,
-   it means the given frame is the outermost one and has no caller.
-   In that case, FRAME_CHAIN_COMBINE is not used.  */
+   and produces the frame's chain-pointer. */
 
 #define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
 
-#define FRAME_CHAIN_VALID(chain, thisframe) \
-  (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
-
 /* Define other aspects of the stack frame.  */
 
 
@@ -320,30 +318,61 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
   (((int*)dummyname)[11] |= (((unsigned long)(fun)) >> 16), \
    ((int*)dummyname)[12] |= (unsigned short)(fun))
 
+/* There's a mess in stack frame creation.  See comments in blockframe.c
+   near reference to INIT_FRAME_PC_FIRST.  */
+
+#define        INIT_FRAME_PC(fromleaf, prev) /* nada */
+
+#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
+  (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
+             (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ());
+
 /* Specific information about a procedure.
    This overlays the MIPS's PDR records, 
    mipsread.c (ab)uses this to save memory */
 
 typedef struct mips_extra_func_info {
-       unsigned long   adr;    /* memory address of start of procedure */
-       long    isym;           /* pointer to procedure symbol */
-       long    pad2;           /* iline: start of line number entries*/
-       long    regmask;        /* save register mask */
-       long    regoffset;      /* save register offset */
        long    numargs;        /* number of args to procedure (was iopt) */
-       long    fregmask;       /* save floating point register mask */
-       long    fregoffset;     /* save floating point register offset */
-       long    framesize;      /* frameoffset: frame size */
-       short   framereg;       /* frame pointer register */
-       short   pcreg;          /* offset or reg of return pc */
-       long    lnLow;          /* lowest line in the procedure */
-       long    lnHigh;         /* highest line in the procedure */
-       long    pad3;           /* cbLineOffset: byte offset for this procedure from the fd base */
+       PDR     pdr;            /* Procedure descriptor record */
 } *mips_extra_func_info_t;
 
 #define EXTRA_FRAME_INFO \
-  char *proc_desc; /* actually, a mips_extra_func_info_t */\
+  mips_extra_func_info_t proc_desc; \
   int num_args;\
   struct frame_saved_regs *saved_regs;
 
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
+
+#define        PRINT_EXTRA_FRAME_INFO(fi) \
+  { \
+    if (fi && fi->proc_desc && fi->proc_desc->pdr.framereg < NUM_REGS) \
+      printf_filtered (" frame pointer is at %s+%d\n", \
+                       reg_names[fi->proc_desc->pdr.framereg], \
+                                 fi->proc_desc->pdr.frameoffset); \
+  }
+
+/* It takes two values to specify a frame (at least!) on the MIPS.  Sigh.
+
+   In fact, at the moment, the *PC* is the primary value that sets up
+   a frame.  The PC is looked up to see what function it's in; symbol
+   information from that function tells us which register is the frame
+   pointer base, and what offset from there is the "virtual frame pointer".
+   (This is usually an offset from SP.)  FIXME -- this should be cleaned
+   up so that the primary value is the SP, and the PC is used to disambiguate
+   multiple functions with the same SP that are at different stack levels. */
+#define        FRAME_SPECIFICATION_DYADIC
+
+#define STAB_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)
+
+/* Size of elements in jmpbuf */
+
+#define JB_ELEMENT_SIZE 4
+
+/* Figure out where the longjmp will land.  We expect that we have just entered
+   longjmp and haven't yet setup the stack frame, so the args are still in the
+   argument regs.  a0 (CALL_ARG0) points at the jmp_buf structure from which we
+   extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
+   This routine returns true on success */
+
+/* Note that caller must #include <setjmp.h> in order to get def of JB_* */
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
This page took 0.027261 seconds and 4 git commands to generate.