s390 assembler improvements and testsuite
[deliverable/binutils-gdb.git] / gdb / remote-adapt.c
index 4e6b70b25db52acc011eb6f8fce46c93ec74bb74..9d31d52b8fc4c1cfe97830cefdb17da1199a865e 100644 (file)
@@ -1,5 +1,6 @@
 /* Remote debugging interface for AMD 290*0 Adapt Monitor Version 2.1d18. 
-   Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+   2001 Free Software Foundation, Inc.
    Contributed by David Wood at New York University (wood@lab.ultra.nyu.edu).
    Adapted from work done at Cygnus Support in remote-eb.c.
 
@@ -35,7 +36,6 @@
 #include "defs.h"
 #include "gdb_string.h"
 #include "inferior.h"
-#include "gdb_wait.h"
 #include "value.h"
 #include <ctype.h>
 #include <fcntl.h>
@@ -44,6 +44,7 @@
 #include "terminal.h"
 #include "target.h"
 #include "gdbcore.h"
+#include "regcache.h"
 
 /* This processor is getting rusty but I am trying to keep it
    up to date at least with data structure changes.
@@ -201,7 +202,7 @@ expect (char *string)
   char *p = string;
 
   fflush (adapt_stream);
-  immediate_quit = 1;
+  immediate_quit++;
   while (1)
     {
       if (readchar () == *p)
@@ -209,7 +210,7 @@ expect (char *string)
          p++;
          if (*p == '\0')
            {
-             immediate_quit = 0;
+             immediate_quit--;
              return;
            }
        }
@@ -308,12 +309,6 @@ get_hex_regs (int n, int regno)
 /* Called when SIGALRM signal sent due to alarm() timeout.  */
 #ifndef HAVE_TERMIO
 
-#ifndef __STDC__
-#ifndef volatile
-#define volatile
-/**/
-# endif
-#endif
 volatile int n_alarms;
 
 void
@@ -610,7 +605,7 @@ the baud rate, and the name of the program to run on the remote system.");
     /*EMPTY */ ;
 
   if (prog_name != NULL)
-    free (prog_name);
+    xfree (prog_name);
   prog_name = savestring (p, strlen (p));
 
   adapt_close (0);
@@ -758,7 +753,7 @@ adapt_detach (char *args, int from_tty)
 /* Tell the remote machine to resume.  */
 
 void
-adapt_resume (int pid, int step, enum target_signal sig)
+adapt_resume (ptid_t ptid, int step, enum target_signal sig)
 {
   if (step)
     {
@@ -786,8 +781,8 @@ adapt_resume (int pid, int step, enum target_signal sig)
 /* Wait until the remote machine stops, then return,
    storing status in STATUS just as `wait' would.  */
 
-int
-adapt_wait (struct target_waitstatus *status)
+ptid_t
+adapt_wait (ptid_t ptid, struct target_waitstatus *status)
 {
   /* Strings to look for.  '?' means match any single character.  
      Note that with the algorithm we use, the initial character
@@ -820,7 +815,7 @@ adapt_wait (struct target_waitstatus *status)
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_TRAP;
       need_artificial_trap--;
-      return 0;
+      return inferior_ptid;
     }
 
   timeout = 0;                 /* Don't time out -- user program is running. */
@@ -876,7 +871,7 @@ adapt_wait (struct target_waitstatus *status)
     }
   timeout = old_timeout;
   immediate_quit = old_immediate_quit;
-  return 0;
+  return inferior_ptid;
 }
 
 /* Return the name of register number REGNO
@@ -1167,7 +1162,9 @@ translate_addr (CORE_ADDR addr)
 
 /* FIXME!  Merge these two.  */
 int
-adapt_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write)
+adapt_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                           struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+                           struct target_ops *target ATTRIBUTE_UNUSED)
 {
 
   memaddr = translate_addr (memaddr);
@@ -1293,10 +1290,14 @@ adapt_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
 
 #define MAX_BREAKS     8
 static int num_brkpts = 0;
+
+/* Insert a breakpoint at ADDR.  SAVE is normally the address of the
+   pattern buffer where the instruction that the breakpoint overwrites
+   is saved.  It is unused here since the Adapt Monitor is responsible
+   for saving/restoring the original instruction. */
+
 static int
-adapt_insert_breakpoint (addr, save)
-     CORE_ADDR addr;
-     char *save;               /* Throw away, let adapt save instructions */
+adapt_insert_breakpoint (CORE_ADDR addr, char *save)
 {
   if (num_brkpts < MAX_BREAKS)
     {
@@ -1314,10 +1315,13 @@ adapt_insert_breakpoint (addr, save)
     }
 
 }
+
+/* Remove a breakpoint at ADDR.  SAVE is normally the previously
+   saved pattern, but is unused here as the Adapt Monitor is
+   responsible for saving/restoring instructions. */
+
 static int
-adapt_remove_breakpoint (addr, save)
-     CORE_ADDR addr;
-     char *save;               /* Throw away, let adapt save instructions */
+adapt_remove_breakpoint (CORE_ADDR addr, char *save)
 {
   if (num_brkpts > 0)
     {
@@ -1498,7 +1502,6 @@ init_adapt_ops (void)
   adapt_ops.to_thread_alive = 0;
   adapt_ops.to_stop = 0;       /* process_stratum; */
   adapt_ops.to_pid_to_exec_file = NULL;
-  adapt_ops.to_core_file_to_sym_file = NULL;
   adapt_ops.to_stratum = 0;
   adapt_ops.DONT_USE = 0;
   adapt_ops.to_has_all_memory = 1;
This page took 0.025419 seconds and 4 git commands to generate.