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
/*#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. */
/* 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. */
(((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 */
} *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 */