aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/config/m68k/tm-delta68.h24
-rw-r--r--gdb/config/m68k/tm-news.h8
-rw-r--r--gdb/delta68-nat.c7
4 files changed, 42 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc889d9..b0c32de 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+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
@@ -27,7 +39,7 @@ Mon Feb 9 15:35:38 1998 Ian Lance Taylor <ian@cygnus.com>
* 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.
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()
diff --git a/gdb/config/m68k/tm-news.h b/gdb/config/m68k/tm-news.h
index 578af39..9fca446 100644
--- a/gdb/config/m68k/tm-news.h
+++ b/gdb/config/m68k/tm-news.h
@@ -34,8 +34,7 @@ Here is an m-news.h file for gdb. It supports the 68881 registers.
#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); \
} \
@@ -50,9 +49,8 @@ Here is an m-news.h file for gdb. It supports the 68881 registers.
{ 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 \
diff --git a/gdb/delta68-nat.c b/gdb/delta68-nat.c
index c62e1d7..2874edd 100644
--- a/gdb/delta68-nat.c
+++ b/gdb/delta68-nat.c
@@ -77,3 +77,10 @@ _initialize_delta68_nat ()
exit (1);
}
}
+
+clear_insn_cache ()
+{
+#ifdef MCT_TEXT /* in sys/signal.h on sysV68 R3V7.1 */
+ memctl(0, 4096, MCT_TEXT);
+#endif
+}