/* Top level stuff for GDB, the GNU debugger.
- Copyright 1986-2000 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
/* Called when going to wait for the target. Usually allows the GUI to run
while waiting for target events. */
-int (*target_wait_hook) (int pid, struct target_waitstatus * status);
+ptid_t (*target_wait_hook) (ptid_t ptid,
+ struct target_waitstatus * status);
/* Used by UI as a wrapper around command execution. May do various things
like enabling/disabling buttons, etc... */
#ifdef UI_OUT
/* Install the default UI */
- uiout = cli_out_new (gdb_stdout);
-#endif
-
-#ifdef UI_OUT
- /* All the interpreters should have had a look at things by now.
- Initialize the selected interpreter. */
- if (interpreter_p && !init_ui_hook)
+ if (!init_ui_hook)
{
- fprintf_unfiltered (gdb_stderr, "Interpreter `%s' unrecognized.\n",
- interpreter_p);
- exit (1);
+ uiout = cli_out_new (gdb_stdout);
+
+ /* All the interpreters should have had a look at things by now.
+ Initialize the selected interpreter. */
+ if (interpreter_p)
+ {
+ fprintf_unfiltered (gdb_stderr, "Interpreter `%s' unrecognized.\n",
+ interpreter_p);
+ exit (1);
+ }
}
#endif
static int warned = 0;
char *line;
/* FIXME: These should really be in an appropriate header file */
-extern void serial_log_command (const char *);
-
+ extern void serial_log_command (const char *);
+
free_all_values ();
/* Force cleanup of any alloca areas if using C alloca instead of
character position to be off, since the newline we read from
the user is not accounted for. */
fputs_unfiltered (prompt_arg, gdb_stdout);
-#ifdef MPW
- /* Move to a new line so the entered line doesn't have a prompt
- on the front of it. */
- fputs_unfiltered ("\n", gdb_stdout);
-#endif /* MPW */
+ /* OBSOLETE #ifdef MPW */
+ /* OBSOLETE Move to a new line so the entered line doesn't have a prompt */
+ /* OBSOLETE on the front of it. */
+ /* OBSOLETE fputs_unfiltered ("\n", gdb_stdout); */
+ /* OBSOLETE #endif *//* MPW */
gdb_flush (gdb_stdout);
}
int
quit_confirm (void)
{
- if (inferior_pid != 0 && target_has_execution)
+ if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
{
char *s;
exit_code = (int) value_as_long (val);
}
- if (inferior_pid != 0 && target_has_execution)
+ if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
{
if (attach_flag)
target_detach (args, from_tty);
async_annotation_suffix = "prompt";
/* Set the variable associated with the setshow prompt command. */
new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0)));
+
+ /* If gdb was started with --annotate=2, this is equivalent to
+ the user entering the command 'set annotate 2' at the gdb
+ prompt, so we need to do extra processing. */
+ if (annotation_level > 1)
+ set_async_annotation_level (NULL, 0, NULL);
}
gdb_prompt_escape = 0; /* default to none. */
add_show_from_set (c, &showhistlist);
c->function.sfunc = set_history_size_command;
- add_show_from_set
- (add_set_cmd ("filename", no_class, var_filename, (char *) &history_filename,
- "Set the filename in which to record the command history\n\
- (the list of previous commands of which a record is kept).", &sethistlist),
- &showhistlist);
+ c = add_set_cmd ("filename", no_class, var_filename,
+ (char *) &history_filename,
+ "Set the filename in which to record the command history\n\
+ (the list of previous commands of which a record is kept).", &sethistlist);
+ c->completer = filename_completer;
+ add_show_from_set (c, &showhistlist);
add_show_from_set
(add_set_cmd ("confirm", class_support, var_boolean,