/* 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 Free Software
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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 display_space;
-/* Whether this is the async version or not. The async version is
- invoked on the command line with the -nw --async options. In this
- version, the usual command_loop is substituted by and event loop which
- processes UI events asynchronously. */
-int event_loop_p = 1;
-
/* The selected interpreter. This will be used as a set command
variable, so it should always be malloc'ed - since
do_setshow_command will free it. */
struct ui_file *gdb_stdout;
struct ui_file *gdb_stderr;
struct ui_file *gdb_stdlog;
-struct ui_file *gdb_stdtarg;
struct ui_file *gdb_stdin;
/* target IO streams */
struct ui_file *gdb_stdtargin;
+struct ui_file *gdb_stdtarg;
struct ui_file *gdb_stdtargerr;
/* Whether to enable writing into executable and core files */
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- START_PROGRESS (argv[0], 0);
-
- /* This needs to happen before the first use of malloc. */
- init_malloc (NULL);
-
#ifdef HAVE_SBRK
lim_at_start = (char *) sbrk (0);
#endif
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);
};
static struct option long_options[] =
{
- {"async", no_argument, &event_loop_p, 1},
- {"noasync", no_argument, &event_loop_p, 0},
#if defined(TUI)
{"tui", no_argument, 0, OPT_TUI},
#endif
{"dbx", no_argument, &dbx_commands, 1},
{"readnow", no_argument, &readnow_symbol_files, 1},
{"r", no_argument, &readnow_symbol_files, 1},
- {"mapped", no_argument, &mapped_symbol_files, 1},
- {"m", no_argument, &mapped_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
{"silent", no_argument, &quiet, 1},
{"statistics", no_argument, 0, OPT_STATISTICS},
{"write", no_argument, &write_files, 1},
{"args", no_argument, &set_args, 1},
+ {"l", required_argument, 0, 'l'},
{0, no_argument, 0, 0}
};
}
/* Initialize all files. Give the interpreter a chance to take
- control of the console via the 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)
if (batch)
{
+ if (attach_flag)
+ /* Either there was a problem executing the command in the
+ batch file aborted early, or the batch file forgot to do an
+ explicit detach. Explicitly detach the inferior ensuring
+ that there are no zombies. */
+ target_detach (NULL, 0);
+
/* We have hit the end of the batch file. */
exit (0);
}
BEFORE_MAIN_LOOP_HOOK;
#endif
- END_PROGRESS (argv[0]);
-
/* Show time and/or space usage. */
if (display_time)
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(). */
- if (command_loop_hook)
- command_loop_hook ();
+ /* 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
- command_loop ();
+ deprecated_command_loop ();
quit_command ((char *) 0, instream == stdin);
}
}
Select a specific interpreter / user interface\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);