* m68k-tdep.c (m68k_saved_pc_after_call): Use 'GDB_TARGET_IS_SUN3'
[deliverable/binutils-gdb.git] / gdb / tm-mips.h
index f7a5cd0c3f39e1076b13039c40ac0c8b9b4917de..0604ddb90350fe59609137c91099a40c4143fbcb 100644 (file)
@@ -19,16 +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.  */
 
-#ifndef LANGUAGE_C
-#define LANGUAGE_C
-#endif
-#include <sym.h>
-#include <symconst.h>
+#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
 
@@ -37,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.  */
 
@@ -196,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. */
 
@@ -321,6 +318,15 @@ 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 */
@@ -331,12 +337,31 @@ typedef struct mips_extra_func_info {
 } *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 */
This page took 0.024037 seconds and 4 git commands to generate.