aboutsummaryrefslogtreecommitdiff
path: root/gdb/config/m68k/tm-delta68.h
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1998-02-10 20:14:43 +0000
committerJason Molenda <jmolenda@apple.com>1998-02-10 20:14:43 +0000
commit75a1d67abb5453f79f8494c8b8c882b624a4c1b9 (patch)
treeda883f1d80854f37f5200b9892abc55dcdbefc79 /gdb/config/m68k/tm-delta68.h
parent7d620e23edea10dc24f60abefc3cca51ede5c0b2 (diff)
downloadgdb-75a1d67abb5453f79f8494c8b8c882b624a4c1b9.zip
gdb-75a1d67abb5453f79f8494c8b8c882b624a4c1b9.tar.gz
gdb-75a1d67abb5453f79f8494c8b8c882b624a4c1b9.tar.bz2
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.
Diffstat (limited to 'gdb/config/m68k/tm-delta68.h')
-rw-r--r--gdb/config/m68k/tm-delta68.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h
index 7bd4823..5965bb5 100644
--- a/gdb/config/m68k/tm-delta68.h
+++ b/gdb/config/m68k/tm-delta68.h
@@ -44,8 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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, \
&REGBUF[REGISTER_BYTE (FP0_REGNUM)], \
VALBUF); \
else \
@@ -65,15 +64,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
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()