2003-10-06 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / ocd.c
index 8c98d34f69f042e5a96c03a19729a817b097d5ba..4155d735405a0e2d9c9d4336ba2cf64cd33a741e 100644 (file)
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -1,6 +1,7 @@
 /* Target communications support for Macraigor Systems' On-Chip Debugging
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -41,7 +42,7 @@
 
 static int ocd_read_bytes (CORE_ADDR memaddr, char *myaddr, int len);
 
-static int ocd_start_remote (PTR dummy);
+static int ocd_start_remote (void *dummy);
 
 static int readchar (int timeout);
 
@@ -145,7 +146,7 @@ ocd_error (char *s, int error_code)
       s = buf;
     }
 
-  error (s);
+  error ("%s", s);
 }
 
 /*  Return nonzero if the thread TH is still alive on the remote system.  */
@@ -158,7 +159,6 @@ ocd_thread_alive (ptid_t th)
 \f
 /* Clean up connection to a remote debugger.  */
 
-/* ARGSUSED */
 void
 ocd_close (int quitting)
 {
@@ -170,7 +170,7 @@ ocd_close (int quitting)
 /* Stub for catch_errors.  */
 
 static int
-ocd_start_remote (PTR dummy)
+ocd_start_remote (void *dummy)
 {
   unsigned char buf[10], *p;
   int pktlen;
@@ -253,9 +253,7 @@ ocd_start_remote (PTR dummy)
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  set_current_frame (create_new_frame (read_fp (), stop_pc));
-  select_frame (get_current_frame (), 0);
-  print_stack_frame (selected_frame, -1, 1);
+  print_stack_frame (get_selected_frame (), -1, 1);
 
   buf[0] = OCD_LOG_FILE;
   buf[1] = 3;                  /* close existing WIGGLERS.LOG */
@@ -290,29 +288,9 @@ device the OCD device is attached to (e.g. /dev/ttya).");
 
   unpush_target (current_ops);
 
-  if (strncmp (name, "wiggler", 7) == 0)
-    {
-      ocd_desc = serial_open ("ocd");
-      if (!ocd_desc)
-       perror_with_name (name);
-
-      buf[0] = OCD_LOG_FILE;
-      buf[1] = 1;              /* open new or overwrite existing WIGGLERS.LOG */
-      ocd_put_packet (buf, 2);
-      p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
-
-      buf[0] = OCD_SET_CONNECTION;
-      buf[1] = 0x01;           /* atoi (name[11]); */
-      ocd_put_packet (buf, 2);
-      p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
-    }
-  else
-    /* not using Wigglers.dll */
-    {
-      ocd_desc = serial_open (name);
-      if (!ocd_desc)
-       perror_with_name (name);
-    }
+  ocd_desc = serial_open (name);
+  if (!ocd_desc)
+    perror_with_name (name);
 
   if (baud_rate != -1)
     {
@@ -446,7 +424,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      return_to_top_level (RETURN_QUIT);
+      throw_exception (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
@@ -758,7 +736,6 @@ ocd_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
    nonzero.  Returns length of data written or read; 0 for error.  TARGET
    is ignored.  */
 
-/* ARGSUSED */
 int
 ocd_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int should_write,
                 struct mem_attrib *attrib, struct target_ops *target)
@@ -1386,6 +1363,8 @@ bdm_read_register_command (char *args, int from_tty)
 
 }
 \f
+extern initialize_file_ftype _initialize_remote_ocd; /* -Wmissing-prototypes */
+
 void
 _initialize_remote_ocd (void)
 {
This page took 0.025193 seconds and 4 git commands to generate.