Mon Feb 10 12:37:47 1998 Philippe De Muyter <phdm@macqel.be>
authorJason Molenda <jmolenda@apple.com>
Tue, 10 Feb 1998 20:14:43 +0000 (20:14 +0000)
committerJason Molenda <jmolenda@apple.com>
Tue, 10 Feb 1998 20:14:43 +0000 (20:14 +0000)
        * 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.

gdb/ChangeLog
gdb/config/m68k/tm-delta68.h
gdb/config/m68k/tm-news.h
gdb/delta68-nat.c

index bc889d9c19c8f597538d2c9ff43949aa9e259225..b0c32dea1cde069ee9b42d2b5068ee3a90918ae0 100644 (file)
@@ -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.
index 7bd48238dc9bbbdbec09aac2cb670dc1d50c0579..5965bb56f9c650bf4e0a30b24177d5825c670025 100644 (file)
@@ -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()
index 578af390ee61dfb24fbcef72b29d7ef7b7ead143..9fca4467659ea304d2a4ccadd624c35312d825b1 100644 (file)
@@ -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 \
index c62e1d705441b91dbf83eae46d934764cb0037ff..2874edd2776dc974de2e01c9724703ed64a1c43a 100644 (file)
@@ -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
+}