HPMERGE:
authorAndrew Cagney <cagney@redhat.com>
Tue, 19 Jan 1999 02:17:00 +0000 (02:17 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 19 Jan 1999 02:17:00 +0000 (02:17 +0000)
More wrong uses of gdb_stderr and stderr/stdout.
More upddates to calls of catch_errors() so that call matches new interface.

gdb/ChangeLog
gdb/ocd.c
gdb/remote-array.c
gdb/remote-rdi.c
gdb/remote-sds.c
gdb/win32-nat.c

index 0735ccd..9951ef1 100644 (file)
@@ -1,3 +1,23 @@
+Mon Jan 18 14:01:24 1999  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * remote-array.c (array_open): Don't use fprintf_filtered to send
+       data to the log file.
+
+       * remote-array.c (handle_load_dll): Change argument type to PTR so
+       that it is compatible with catch_errors.
+       * ocd.c (ocd_start_remote): Ditto.
+       * remote-sds.c (sds_start_remote): Ditto.
+
+       * win32-nat.c (win32_child_thread_alive): Namespace proof
+       child_thread_alive.
+       (init_child_ops): Update.
+
+Mon Jan 18 12:03:47 1999  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * remote-rdi.c (arm_rdi_open): Set gdb_hostif.hostosarg and
+       gdb_hostif.dbgarg to NULL instead of stdout.
+       (voiddummy, myprint, mywritec): Use gdb_stdout instead of stdout.
+
 Mon Jan 18 16:40:50 1999  Stan Shebs  <shebs@andros.cygnus.com>
 
        * ser-ocd.c (ocd_open): Handle Unix case gracefully.
index 0af8103..343fa62 100644 (file)
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 static int ocd_read_bytes PARAMS ((CORE_ADDR memaddr,
                                      char *myaddr, int len));
 
-static int ocd_start_remote PARAMS ((char *dummy));
+static int ocd_start_remote PARAMS ((PTR dummy));
 
 static int readchar PARAMS ((int timeout));
 
@@ -145,7 +145,7 @@ ocd_close (quitting)
 
 static int
 ocd_start_remote (dummy)
-     char *dummy;
+     PTR dummy;
 {
   unsigned char buf[10], *p;
   int pktlen;
@@ -154,7 +154,7 @@ ocd_start_remote (dummy)
   int speed;
   enum ocd_target_type target_type;
 
-  target_type = (enum ocd_target_type)dummy;
+  target_type = *(enum ocd_target_type*)dummy;
 
   immediate_quit = 1;          /* Allow user to interrupt it */
 
@@ -330,7 +330,7 @@ device the OCD device is attached to (e.g. /dev/ttya).");
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it
      (we'd be in an inconsistent state otherwise).  */
-  if (!catch_errors (ocd_start_remote, (char *)target_type,
+  if (!catch_errors (ocd_start_remote, &target_type,
                     "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     {
index 2b9531a..413827a 100644 (file)
@@ -625,9 +625,9 @@ array_open(args, name, from_tty)
   log_file = fopen (LOG_FILE, "w");
   if (log_file == NULL)
     perror_with_name (LOG_FILE);
-  fprintf_filtered (log_file, "GDB %s (%s", version);
-  fprintf_filtered (log_file, " --target %s)\n", array_ops.to_shortname);
-  fprintf_filtered (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name);
+  fprintf (log_file, "GDB %s (%s", version);
+  fprintf (log_file, " --target %s)\n", array_ops.to_shortname);
+  fprintf (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name);
 #endif
 
   /* see if the target is alive. For a ROM monitor, we can just try to force the
index 7b6511e..dba920e 100644 (file)
@@ -130,7 +130,7 @@ arm_rdi_start_remote (dummy)
 void
 voiddummy ()
 {
-  printf("void dummy\n");
+  fprintf_unfiltered (gdb_stdout, "void dummy\n");
 }
 
 static void
@@ -139,7 +139,7 @@ myprint (arg, format, ap)
      const char *format;
      va_list ap;
 {
-  vfprintf (stdout, format, ap);
+  vfprintf_unfiltered (gdb_stdout, format, ap);
 }
 
 static void
@@ -148,7 +148,7 @@ mywritec (arg, c)
      int c;
 {
   if (isascii (c))
-    fputc_unfiltered (c, (FILE *) arg);
+    fputc_unfiltered (c, gdb_stdout);
 }
 
 static int
@@ -231,12 +231,12 @@ device is attached to the remote system (e.g. /dev/ttya).");
 
   gdb_hostif.dbgprint = myprint;
   gdb_hostif.dbgpause = mypause;
-  gdb_hostif.dbgarg = stdout;
+  gdb_hostif.dbgarg = NULL;
   gdb_hostif.writec = mywritec;
   gdb_hostif.readc = myreadc;
   gdb_hostif.write = mywrite;
   gdb_hostif.gets = mygets;
-  gdb_hostif.hostosarg = stdout;
+  gdb_hostif.hostosarg = NULL;
   gdb_hostif.reset = voiddummy;
 
   rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL);
index 05aa829..c8fe721 100644 (file)
@@ -62,7 +62,7 @@ static void sds_fetch_registers PARAMS ((int));
 
 static void sds_resume PARAMS ((int, int, enum target_signal));
 
-static int sds_start_remote PARAMS ((char *));
+static int sds_start_remote PARAMS ((PTR));
 
 static void sds_open PARAMS ((char *, int));
 
@@ -155,7 +155,7 @@ sds_close (quitting)
 
 static int
 sds_start_remote (dummy)
-     char *dummy;
+     PTR dummy;
 {
   char c;
   unsigned char buf[200];
@@ -237,7 +237,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it (we'd be
      in an inconsistent state otherwise).  */
-  if (!catch_errors (sds_start_remote, (char *)0
+  if (!catch_errors (sds_start_remote, NULL
                     "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     pop_target ();
index e0f07ef..47dbc55 100644 (file)
@@ -64,7 +64,7 @@
 extern struct target_ops child_ops;
 
 static void child_stop PARAMS ((void));
-static int child_thread_alive PARAMS ((int));
+static int win32_child_thread_alive PARAMS ((int));
 
 static int last_sig = 0;       /* Set if a signal was received from the
                                   debugged process */
@@ -302,7 +302,7 @@ child_store_inferior_registers (int r)
    of error; store status through argument pointer OURSTATUS.  */
 
 static int
-handle_load_dll (char *dummy)
+handle_load_dll (PTR dummy)
 {
   LOAD_DLL_DEBUG_INFO * event = &current_event.u.LoadDll;
   DWORD dll_name_ptr;
@@ -1033,7 +1033,7 @@ static void init_child_ops(void)
   child_ops.to_mourn_inferior =   child_mourn_inferior;
   child_ops.to_can_run  =   child_can_run;
   child_ops.to_notice_signals =   0;
-  child_ops.to_thread_alive  =   child_thread_alive;
+  child_ops.to_thread_alive  =   win32_child_thread_alive;
   child_ops.to_stop  =   child_stop;
   child_ops.to_stratum =   process_stratum;
   child_ops.DONT_USE =   0;
@@ -1102,7 +1102,7 @@ _initialize_inftarg ()
    by "polling" it.  If WaitForSingleObject returns WAIT_OBJECT_0
    it means that the pid has died.  Otherwise it is assumed to be alive. */
 static int
-child_thread_alive (int pid)
+win32_child_thread_alive (int pid)
 {
   return WaitForSingleObject(thread_rec (pid, FALSE)->h, 0) == WAIT_OBJECT_0 ?
         FALSE : TRUE;