* buildsym.c (start_subfile): Handle producer.
[deliverable/binutils-gdb.git] / gdb / wince.c
index e1f56c5947ecf05bef521de18ac1a576ffd9f891..86bfaf6ab66acaff03f87aa79c48c2e398327eac 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-vector operations for controlling Windows CE child processes, for GDB.
 
-   Copyright 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions, A Red Hat Company.
 
    This file is part of GDB.
@@ -17,8 +17,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
  */
 
 /* by Christopher Faylor (cgf@cygnus.com) */
@@ -146,7 +146,6 @@ typedef struct thread_info_struct
     int suspend_count;
     int stepped;               /* True if stepped.  */
     CORE_ADDR step_pc;
-    unsigned long step_prev;
     CONTEXT context;
   }
 thread_info;
@@ -432,7 +431,7 @@ vstub_error (LPCSTR fmt, va_list * args)
   char buf[4096];
   vsprintf (buf, fmt, args);
   s = -1;
-  error ("%s", buf);
+  error (("%s"), buf);
 }
 
 /* The standard way to display an error message and exit.  */
@@ -834,7 +833,7 @@ undoSStep (thread_info * th)
 {
   if (th->stepped)
     {
-      memory_remove_breakpoint (th->step_pc, (void *) &th->step_prev);
+      remove_single_step_breakpoints ();
       th->stepped = 0;
     }
 }
@@ -857,8 +856,7 @@ wince_software_single_step (enum target_signal ignore,
   th->stepped = 1;
   pc = read_register (PC_REGNUM);
   th->step_pc = mips_next_pc (pc);
-  th->step_prev = 0;
-  memory_insert_breakpoint (th->step_pc, (void *) &th->step_prev);
+  insert_single_step_breakpoint (th->step_pc);
   return;
 }
 #elif SHx
@@ -971,7 +969,7 @@ undoSStep (thread_info * th)
 {
   if (th->stepped)
     {
-      memory_remove_breakpoint (th->step_pc, (void *) &th->step_prev);
+      remove_single_step_breakpoints ();
       th->stepped = 0;
     }
   return;
@@ -996,8 +994,7 @@ wince_software_single_step (enum target_signal ignore,
 
   th->stepped = 1;
   th->step_pc = sh_get_next_pc (&th->context);
-  th->step_prev = 0;
-  memory_insert_breakpoint (th->step_pc, (void *) &th->step_prev);
+  insert_single_step_breakpoint (th->step_pc);
   return;
 }
 #elif defined (ARM)
@@ -1024,7 +1021,7 @@ undoSStep (thread_info * th)
 {
   if (th->stepped)
     {
-      memory_remove_breakpoint (th->step_pc, (void *) &th->step_prev);
+      remove_single_step_breakpoints ();
       th->stepped = 0;
     }
 }
@@ -1047,8 +1044,7 @@ wince_software_single_step (enum target_signal ignore,
   th->stepped = 1;
   pc = read_register (PC_REGNUM);
   th->step_pc = arm_get_next_pc (pc);
-  th->step_prev = 0;
-  memory_insert_breakpoint (th->step_pc, (void *) &th->step_prev);
+  insert_single_step_breakpoint (th->step_pc);
   return;
 }
 #endif
@@ -1568,7 +1564,7 @@ child_files_info (struct target_ops *ignore)
 static void
 child_open (char *arg, int from_tty)
 {
-  error ("Use the \"run\" command to start a child process.");
+  error (_("Use the \"run\" command to start a child process."));
 }
 
 #define FACTOR (0x19db1ded53ea710LL)
@@ -1615,7 +1611,7 @@ upload_to_device (const char *to, const char *from)
     to = p + 1;
 
   if (!*to)
-    error ("no filename found to upload - %s.", in_to);
+    error (_("no filename found to upload - %s."), in_to);
 
   len = strlen (dir) + strlen (to) + 2;
   remotefile = (char *) xrealloc (remotefile, len);
@@ -1629,7 +1625,7 @@ upload_to_device (const char *to, const char *from)
   /* Open the source.  */
   if ((fd = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, (char *) from,
                   O_RDONLY, 0, NULL)) < 0)
-    error ("couldn't open %s", from);
+    error (_("couldn't open %s"), from);
 
   /* Get the time for later comparison.  */
   if (fstat (fd, &st))
@@ -1647,7 +1643,7 @@ upload_to_device (const char *to, const char *from)
   /* Some kind of problem?  */
   err = CeGetLastError ();
   if (h == NULL || h == INVALID_HANDLE_VALUE)
-    error ("error opening file \"%s\".  Windows error %d.",
+    error (_("error opening file \"%s\".  Windows error %d."),
           remotefile, err);
 
   CeGetFileTime (h, &crtime, &actime, &wrtime);
@@ -1673,13 +1669,13 @@ upload_to_device (const char *to, const char *from)
       /* Upload the file.  */
       while ((n = read (fd, buf, sizeof (buf))) > 0)
        if (!CeWriteFile (h, buf, (DWORD) n, &nbytes, NULL))
-         error ("error writing to remote device - %d.",
+         error (_("error writing to remote device - %d."),
                 CeGetLastError ());
     }
 
   close (fd);
   if (!CeCloseHandle (h))
-    error ("error closing remote file - %d.", CeGetLastError ());
+    error (_("error closing remote file - %d."), CeGetLastError ());
 
   return remotefile;
 }
@@ -1704,8 +1700,7 @@ wince_initialize (void)
        break;
       default:
        CeRapiUninit ();
-       error ("Can't initialize connection to remote device.\n");
-       break;
+       error (_("Can't initialize connection to remote device."));
       }
 
   /* Upload the stub to the handheld device.  */
@@ -1717,7 +1712,7 @@ wince_initialize (void)
       strcat (args, " ");
       hostname = strchr (args, '\0');
       if (gethostname (hostname, sizeof (args) - strlen (args)))
-       error ("couldn't get hostname of this system.");
+       error (_("couldn't get hostname of this system."));
     }
 
   /* Get a socket.  */
@@ -1736,23 +1731,23 @@ wince_initialize (void)
   sin.sin_port = htons (7000); /* FIXME: This should be configurable.  */
 
   if (bind (s0, (struct sockaddr *) &sin, sizeof (sin)))
-    error ("couldn't bind socket");
+    error (_("couldn't bind socket"));
 
   if (listen (s0, 1))
-    error ("Couldn't open socket for listening.\n");
+    error (_("Couldn't open socket for listening."));
 
   /* Start up the stub on the remote device.  */
   if (!CeCreateProcess (towide (stub_file_name, NULL), 
                        towide (args, NULL),
                        NULL, NULL, 0, 0, 
                        NULL, NULL, NULL, &pi))
-    error ("Unable to start remote stub '%s'.  Windows CE error %d.",
+    error (_("Unable to start remote stub '%s'.  Windows CE error %d."),
           stub_file_name, CeGetLastError ());
 
   /* Wait for a connection */
 
   if ((s = accept (s0, NULL, NULL)) < 0)
-    error ("couldn't set up server for connection.");
+    error (_("couldn't set up server for connection."));
 
   close (s0);
 }
@@ -1773,7 +1768,7 @@ child_create_inferior (char *exec_file, char *args, char **env,
   char *exec_and_args;
 
   if (!exec_file)
-    error ("No executable specified, use `target exec'.\n");
+    error (_("No executable specified, use `target exec'."));
 
   flags = DEBUG_PROCESS;
 
@@ -1799,7 +1794,7 @@ child_create_inferior (char *exec_file, char *args, char **env,
   memset (&pi, 0, sizeof (pi));
   /* Execute the process.  */
   if (!create_process (exec_file, exec_and_args, flags, &pi))
-    error ("Error creating process %s, (error %d)\n"
+    error (_("Error creating process %s, (error %d).")
           exec_file, GetLastError ());
 
   exception_count = 0;
@@ -1822,8 +1817,6 @@ child_create_inferior (char *exec_file, char *args, char **env,
   while (!get_child_debug_event (PIDGET (inferior_ptid), &dummy,
                                 CREATE_PROCESS_DEBUG_EVENT, &ret))
     continue;
-
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 /* Chile has gone bye-bye.  */
@@ -1840,7 +1833,7 @@ child_mourn_inferior (void)
 
 /* Move memory from child to/from gdb.  */
 int
-child_xfer_memory (CORE_ADDR memaddr, char *our, 
+child_xfer_memory (CORE_ADDR memaddr, gdb_byte *our, 
                   int len, int write,
                   struct mem_attrib *attrib,
                   struct target_ops *target)
@@ -2012,7 +2005,7 @@ set_upload_type (char *ignore, int from_tty)
 
   bad_option = remote_upload;
   replace_upload (UPLOAD_NEWER);
-  error ("Unknown upload type: %s.", bad_option);
+  error (_("Unknown upload type: %s."), bad_option);
 }
 
 void
@@ -2021,69 +2014,62 @@ _initialize_wince (void)
   struct cmd_list_element *set;
   init_child_ops ();
 
-  deprecated_add_show_from_set
-    (add_set_cmd ((char *) "remotedirectory", no_class,
-                 var_string_noescape, (char *) &remote_directory,
-                 (char *) "Set directory for remote upload.\n",
-                 &setlist),
-     &showlist);
+  add_setshow_string_noescape_cmd ("remotedirectory", no_class,
+                                  &remote_directory, _("\
+Set directory for remote upload."), _("\
+Show directory for remote upload."), NULL,
+                                  NULL, /* FIXME: i18n: */
+                                  NULL, NULL,
+                                  &setlist, &showlist);
   remote_directory = xstrdup (remote_directory);
 
-  set = add_set_cmd ((char *) "remoteupload", no_class,
-                    var_string_noescape, (char *) &remote_upload,
-                    (char *) "\
-Set how to upload executables to remote device.\n",
-                    &setlist);
-
-  deprecated_add_show_from_set (set, &showlist);
-  set_cmd_cfunc (set, set_upload_type);
+  add_setshow_string_noescape_cmd ("remoteupload", no_class,
+                                  &remote_upload, _("\
+Set how to upload executables to remote device."), _("\
+Show how to upload executables to remote device."), NULL,
+                                  NULL, /* FIXME: i18n: */
+                                  set_upload_type, NULL,
+                                  &setlist, &showlist);
   set_upload_type (NULL, 0);
 
-  deprecated_add_show_from_set
-    (add_set_cmd ((char *) "debugexec", 
-                 class_support, var_boolean,
-                 (char *) &debug_exec,
-                 (char *) "\
-Set whether to display execution in child process.",
-                 &setlist),
-     &showlist);
-
-  deprecated_add_show_from_set
-    (add_set_cmd ((char *) "remoteaddhost", 
-                 class_support, var_boolean,
-                 (char *) &remote_add_host,
-                 (char *) "\
+  add_setshow_boolean_cmd ("debugexec", class_support, &debug_exec, _("\
+Set whether to display execution in child process."), _("\
+Show whether to display execution in child process."), NULL,
+                          NULL,
+                          NULL, /* FIXME: i18n: */
+                          &setlist, &showlist);
+
+  add_setshow_boolean_cmd ("remoteaddhost", class_support,
+                          &remote_add_host, _("\
 Set whether to add this host to remote stub arguments for\n\
-debugging over a network.", 
-                 &setlist),
-     &showlist);
-
-  deprecated_add_show_from_set
-    (add_set_cmd ((char *) "debugevents", 
-                 class_support, var_boolean,
-                 (char *) &debug_events,
-                 (char *) "\
-Set whether to display kernel events in child process.",
-                 &setlist),
-     &showlist);
-
-  deprecated_add_show_from_set
-    (add_set_cmd ((char *) "debugmemory", 
-                 class_support, var_boolean,
-                 (char *) &debug_memory,
-                 (char *) "\
-Set whether to display memory accesses in child process.",
-                 &setlist),
-     &showlist);
-
-  deprecated_add_show_from_set 
-    (add_set_cmd ((char *) "debugexceptions", 
-                 class_support, var_boolean,
-                 (char *) &debug_exceptions,
-                 (char *) "\
-Set whether to display kernel exceptions in child process.",
-                 &setlist),
-     &showlist);
+debugging over a network."), _("\
+Show whether to add this host to remote stub arguments for\n\
+debugging over a network."), NULL,
+                          NULL,
+                          NULL, /* FIXME: i18n: */
+                          &setlist, &showlist);
+
+  add_setshow_boolean_cmd ("debugevents", class_support, &debug_events, _("\
+Set whether to display kernel events in child process."), _("\
+Show whether to display kernel events in child process."), NULL,
+                          NULL,
+                          NULL, /* FIXME: i18n: */
+                          &setlist, &showlist);
+
+  add_setshow_boolean_cmd ("debugmemory", class_support, &debug_memory, _("\
+Set whether to display memory accesses in child process."), _("\
+Show whether to display memory accesses in child process."), NULL,
+                          NULL,
+                          NULL, /* FIXME: i18n: */
+                          &setlist, &showlist);
+
+  add_setshow_boolean_cmd ("debugexceptions", class_support,
+                          &debug_exceptions, _("\
+Set whether to display kernel exceptions in child process."), _("\
+Show whether to display kernel exceptions in child process."), NULL,
+                          NULL,
+                          NULL, /* FIXME: i18n: */
+                          &setlist, &showlist);
 
   add_target (&deprecated_child_ops);
 }
This page took 0.028482 seconds and 4 git commands to generate.