/* 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 Free Software Foundation, Inc.
Contributed by Cygnus Solutions, A Red Hat Company.
This file is part of GDB.
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) */
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. */
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)
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);
/* 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))
/* 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);
/* 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;
}
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. */
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. */
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);
}
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;
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;
/* 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)
bad_option = remote_upload;
replace_upload (UPLOAD_NEWER);
- error ("Unknown upload type: %s.", bad_option);
+ error (_("Unknown upload type: %s."), bad_option);
}
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);
}