Remove definition of EM_MIPS_RS4_BE. The constant was never in active use
[deliverable/binutils-gdb.git] / gdb / top.c
index 4c4603ab94a27b4d0cede3694241eec527f1d8d7..be4504d68bafa01e457d3e774d71e54344625569 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1,5 +1,6 @@
 /* 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.
 
@@ -340,7 +341,8 @@ void (*memory_changed_hook) (CORE_ADDR addr, int len);
 /* 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...  */
@@ -703,17 +705,18 @@ gdb_init (char *argv0)
 
 #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
 
@@ -732,8 +735,8 @@ execute_command (char *p, int from_tty)
   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
@@ -1000,11 +1003,11 @@ gdb_readline (char *prompt_arg)
          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);
     }
 
@@ -1707,7 +1710,7 @@ set_prompt (char *s)
 int
 quit_confirm (void)
 {
-  if (inferior_pid != 0 && target_has_execution)
+  if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
     {
       char *s;
 
@@ -1744,7 +1747,7 @@ quit_force (char *args, int from_tty)
       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);
@@ -1995,6 +1998,12 @@ init_main (void)
       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.  */
 
@@ -2080,11 +2089,12 @@ ie. the number of previous commands to keep a record of.", &sethistlist);
   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,
This page took 0.025101 seconds and 4 git commands to generate.