Update copyright date.
[deliverable/binutils-gdb.git] / gdb / remote-mm.c
index 2c529741c75323379b10dc8e66d323accd3eb539..67727e2c81c79cb5a6b08fe2e58612dc611c2170 100644 (file)
@@ -1,5 +1,6 @@
 /* Remote debugging interface for Am290*0 running MiniMON monitor, for GDB.
-   Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+   2001 Free Software Foundation, Inc.
    Originally written by Daniel Mann at AMD.
 
    This file is part of GDB.
@@ -32,7 +33,6 @@
 
 #include "defs.h"
 #include "inferior.h"
-#include "gdb_wait.h"
 #include "value.h"
 #include <ctype.h>
 #include <fcntl.h>
@@ -42,6 +42,7 @@
 #include "terminal.h"
 #include "minimon.h"
 #include "target.h"
+#include "regcache.h"
 
 /* Offset of member MEMBER in a struct of type TYPE.  */
 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
@@ -50,7 +51,7 @@
 
 extern int stop_soon_quietly;  /* for wait_for_inferior */
 
-static void mm_resume ();
+static void mm_resume (ptid_t ptid, int step, enum target_signal sig)
 static void mm_fetch_registers ();
 static int fetch_register ();
 static void mm_store_registers ();
@@ -117,12 +118,6 @@ FILE *mm_stream;
 /* Called when SIGALRM signal sent due to alarm() timeout.  */
 #ifndef HAVE_TERMIO
 
-#ifndef __STDC__
-#ifndef volatile
-#define volatile
-/**/
-# endif
-#endif
 volatile int n_alarms;
 
 static void
@@ -333,7 +328,7 @@ mm_open (char *name, int from_tty)
     /*EMPTY */ ;
 
   if (prog_name != NULL)
-    free (prog_name);
+    xfree (prog_name);
   prog_name = savestring (p, strlen (p));
 
 
@@ -528,7 +523,7 @@ mm_detach (char *args, int from_tty)
 ** Tell the remote machine to resume.  */
 
 static void
-mm_resume (int pid, int step, enum target_signal sig)
+mm_resume (ptid_t ptid, int step, enum target_signal sig)
 {
   if (sig != TARGET_SIGNAL_0)
     warning ("Can't send signals to a remote MiniMon system.");
@@ -552,8 +547,8 @@ mm_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.  */
 
-static int
-mm_wait (struct target_waitstatus *status)
+static ptid_t
+mm_wait (ptid_t ptid, struct target_waitstatus *status)
 {
   int i, result;
   int old_timeout = timeout;
@@ -697,7 +692,7 @@ halted:
 
   timeout = old_timeout;       /* Restore original timeout value */
   immediate_quit = old_immediate_quit;
-  return 0;
+  return inferior_ptid;
 }
 
 /******************************************************* REMOTE_FETCH_REGISTERS
@@ -1086,7 +1081,7 @@ mm_load (char *arg_string, int from_tty)
     error ("The load command takes a file name");
 
   arg_string = tilde_expand (arg_string);
-  make_cleanup (free, arg_string);
+  make_cleanup (xfree, arg_string);
   QUIT;
   immediate_quit++;
   error ("File loading is not yet supported for MiniMon.");
@@ -1173,7 +1168,9 @@ mm_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
 
 /* FIXME!  Merge these two.  */
 static int
-mm_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write)
+mm_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);
@@ -1698,15 +1695,15 @@ error_msg_str (INT32 code)
   return (cbuf);
 }
 /****************************************************************************/
-/* 
- *  Receive a message and expect it to be of type msgcode.
- *  Returns 0/1 on failure/success.
- */
+
+/* Receive a message, placing it in MSG_BUF, and expect it to be of
+   type MSGCODE.  If an error occurs, a non-zero FROM_TTY indicates
+   that the message should be printed.
+   
+   Return 0 for failure, 1 for success.  */
+
 static int
-expect_msg (msgcode, msg_buf, from_tty)
-     INT32 msgcode;            /* Msg code we expect */
-     union msg_t *msg_buf;     /* Where to put  the message received */
-     int from_tty;             /* Print message on error if non-zero */
+expect_msg (INT32 msgcode, union msg_t *msg_buf, int from_tty)
 {
   int retries = 0;
   while (msg_recv_serial (msg_buf) && (retries++ < MAX_RETRIES));
@@ -1824,7 +1821,6 @@ init_mm_ops (void)
   mm_ops.to_thread_alive = 0;
   mm_ops.to_stop = 0;
   mm_ops.to_pid_to_exec_file = NULL;
-  mm_ops.to_core_file_to_sym_file = NULL;
   mm_ops.to_stratum = process_stratum;
   mm_ops.DONT_USE = 0;
   mm_ops.to_has_all_memory = 1;
This page took 0.025163 seconds and 4 git commands to generate.