Replace the sync_execution global with a new enum prompt_state tristate
[deliverable/binutils-gdb.git] / gdb / top.h
index e5445143ff8c1c4b87c6cfb2424108ec2d63a0e9..df96baa16729337ded733bfae9956cfa8fedd06e 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
 
 struct tl_interp_info;
 
+/* Prompt state.  */
+
+enum prompt_state
+{
+  /* The command line is blocked simulating synchronous execution.
+     This is used to implement the foreground execution commands
+     ('run', 'continue', etc.).  We won't display the prompt and
+     accept further commands until the execution is actually over.  */
+  PROMPT_BLOCKED,
+
+  /* The command finished; display the prompt before returning back to
+     the top level.  */
+  PROMPT_NEEDED,
+
+  /* We've displayed the prompt already, ready for input.  */
+  PROMPTED,
+};
+
 /* All about a user interface instance.  Each user interface has its
    own I/O files/streams, readline state, its own top level
    interpreter (for the main UI, this is the interpreter specified
@@ -55,6 +73,11 @@ struct ui
      processing.  */
   void (*input_handler) (char *);
 
+  /* True if this UI is using the readline library for command
+     editing; false if using GDB's own simple readline emulation, with
+     no editing support.  */
+  int command_editing;
+
   /* Each UI has its own independent set of interpreters.  */
   struct ui_interp_info *interp_info;
 
@@ -68,6 +91,10 @@ struct ui
      "start" -ex "next"') are processed.  */
   int async;
 
+  /* The number of nested readline secondary prompts that are
+     currently active.  */
+  int secondary_prompt_depth;
+
   /* stdio stream that command input is being read from.  Set to stdin
      normally.  Set by source_command to the file we are sourcing.
      Set to NULL if we are executing a user-defined command or
@@ -82,6 +109,9 @@ struct ui
      it with the event loop.  */
   int input_fd;
 
+  /* See enum prompt_state's description.  */
+  enum prompt_state prompt_state;
+
   /* The fields below that start with "m_" are "private".  They're
      meant to be accessed through wrapper macros that make them look
      like globals.  */
@@ -98,6 +128,9 @@ struct ui
      *_unfiltered.  In the very near future that restriction shall be
      removed - either call shall be unfiltered.  (cagney 1999-06-13).  */
   struct ui_file *m_gdb_stdlog;
+
+  /* The current ui_out.  */
+  struct ui_out *m_current_uiout;
 };
 
 /* The main UI.  This is the UI that is bound to stdin/stdout/stderr.
@@ -133,6 +166,13 @@ extern void switch_thru_all_uis_next (struct switch_thru_all_uis *state);
        switch_thru_all_uis_cond (&STATE);              \
        switch_thru_all_uis_next (&STATE))
 
+/* Traverse over all UIs.  */
+#define ALL_UIS(UI)                            \
+  for (UI = ui_list; UI; UI = UI->next)                \
+
+/* Cleanup that restores the current UI.  */
+extern void restore_ui_cleanup (void *data);
+
 /* From top.c.  */
 extern char *saved_command_line;
 extern int in_user_command;
@@ -179,9 +219,10 @@ extern char *get_prompt (void);
    by gdb for its command prompt.  */
 extern void set_prompt (const char *s);
 
-/* Return 1 if the current input handler is a secondary prompt, 0 otherwise.  */
+/* Return 1 if UI's current input handler is a secondary prompt, 0
+   otherwise.  */
 
-extern int gdb_in_secondary_prompt_p (void);
+extern int gdb_in_secondary_prompt_p (struct ui *ui);
 
 /* From random places.  */
 extern int readnow_symbol_files;
This page took 0.024711 seconds and 4 git commands to generate.