+Mon Feb 10 12:37:47 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * m68k/tm-delta68.h (EXTRACT_RETURN_VALUE): Type argument for
+ `REGISTER_CONVERT_TO_VIRTUAL is `TYPE', not
+ `REGISTER_VIRTUAL_TYPE (FP0_REGNUM)';
+ (STORE_RETURN_VALUE): Ditto, and offset for `write_register_bytes'
+ is `REGISTER_BYTE (FP0_REGNUM)', not `FP0_REGNUM'.
+ (FRAME_NUM_ARGS): New macro.
+ * m68k/tm-news.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Ditto.
+ * delta68-nat.c (clear_insn_cache): New function, forgotten in previous
+ patch.
+
Mon Feb 9 11:10:06 1998 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c: Replace references to IMEM_ADDR and DMEM_ADDR with
* Makefile.in (init.c): Ignore errors when making init.c. Seems
necessary to work around bug in Solaris make.
-Sun Jul 6 02:44:28 1997 Philippe De Muyter <phdm@macqel.be>
+Sun Feb 6 02:44:28 1997 Philippe De Muyter <phdm@macqel.be>
* m68k/tm-delta68.h (CPLUS_MARKER): Macro deleted.
(EXTRACT_STRUCT_VALUE_ADDRESS): Macro defined.
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \
- REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \
+ REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
®BUF[REGISTER_BYTE (FP0_REGNUM)], \
VALBUF); \
else \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
- REGISTER_CONVERT_TO_RAW (REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \
- FP0_REGNUM, VALBUF, raw_buf); \
- write_register_bytes (FP0_REGNUM, \
+ REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
} \
else \
write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \
VALBUF, TYPE_LENGTH (TYPE))
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(val, fi) \
+{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
+ register int insn = 0177777 & read_memory_integer (pc, 2); \
+ val = 0; \
+ if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
+ val = read_memory_integer (pc + 2, 2); \
+ else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
+ || (insn & 0170777) == 0050117) /* addqw */ \
+ { val = (insn >> 9) & 7; if (val == 0) val = 8; } \
+ else if (insn == 0157774) /* addal #WW, sp */ \
+ val = read_memory_integer (pc + 2, 4); \
+ val >>= 2; }
+
/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
the processor's instruction cache as it should. */
#define CLEAR_INSN_CACHE() clear_insn_cache()
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
{ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
- REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \
- REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \
+ REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
®BUF[REGISTER_BYTE (FP0_REGNUM)], \
VALBUF); \
} \
{ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
- REGISTER_CONVERT_TO_RAW (REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \
- FP0_REGNUM, VALBUF, raw_buf); \
- write_register_bytes (FP0_REGNUM, \
+ REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
} \
else \