/* Top level stuff for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
- Foundation, Inc.
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GDB.
#include "symfile.h"
#include "gdbcore.h"
+#include "exceptions.h"
#include "getopt.h"
#include <sys/types.h>
int ndir;
struct stat homebuf, cwdbuf;
- char *homedir, *homeinit;
+ char *homedir;
int i;
gdb_stdtargerr = gdb_stderr; /* for moment */
gdb_stdtargin = gdb_stdin; /* for moment */
- /* initialize error() */
- error_init ();
-
/* Set the sysroot path. */
#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT);
}
/* Initialize all files. Give the interpreter a chance to take
- control of the console via the deprecated_init_ui_hook(). */
+ control of the console via the deprecated_init_ui_hook (). */
gdb_init (argv[0]);
/* Do these (and anything which might call wrap_here or *_filtered)
/* Find it. */
struct interp *interp = interp_lookup (interpreter_p);
if (interp == NULL)
- error ("Interpreter `%s' unrecognized", interpreter_p);
+ error (_("Interpreter `%s' unrecognized"), interpreter_p);
/* Install it. */
if (!interp_set (interp))
{
homedir = getenv ("HOME");
if (homedir)
{
- homeinit = (char *) alloca (strlen (homedir) +
- strlen (gdbinit) + 10);
- strcpy (homeinit, homedir);
- strcat (homeinit, "/");
- strcat (homeinit, gdbinit);
+ char *homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
if (!inhibit_gdbinit)
{
stat (homeinit, &homebuf);
stat (gdbinit, &cwdbuf); /* We'll only need this if
homedir was set. */
+ xfree (homeinit);
}
/* Now perform all the actions indicated by the arguments. */
if (!SET_TOP_LEVEL ())
{
do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
- /* GUIs generally have their own command loop, mainloop, or whatever.
- This is a good place to gain control because many error
- conditions will end up here via longjmp(). */
+ /* GUIs generally have their own command loop, mainloop, or
+ whatever. This is a good place to gain control because
+ many error conditions will end up here via longjmp(). */
if (deprecated_command_loop_hook)
deprecated_command_loop_hook ();
else
"), stream);
fputs_unfiltered (_("\
--args Arguments after executable-file are passed to inferior\n\
-"), stream);
- fputs_unfiltered (_("\
- --[no]async Enable (disable) asynchronous version of CLI\n\
"), stream);
fputs_unfiltered (_("\
-b BAUDRATE Set serial port baud rate used for remote debugging.\n\
"), stream);
fputs_unfiltered (_("\
-l TIMEOUT Set timeout in seconds for remote debugging.\n\
- --mapped Use mapped symbol files if supported on this system.\n\
--nw Do not use a window interface.\n\
--nx Do not read "), stream);
fputs_unfiltered (gdbinit, stream);