aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-08-04 20:09:46 +0000
committerPedro Alves <palves@redhat.com>2011-08-04 20:09:46 +0000
commite0dd0826e246e3d39081881db7bcc69ca5ec77a2 (patch)
tree6b3c3ee78337912f4a3becc0ee70162a6d21386b /gdb/tui
parent79a45e254f090b628473614054ed318d70409239 (diff)
downloadgdb-e0dd0826e246e3d39081881db7bcc69ca5ec77a2.zip
gdb-e0dd0826e246e3d39081881db7bcc69ca5ec77a2.tar.gz
gdb-e0dd0826e246e3d39081881db7bcc69ca5ec77a2.tar.bz2
2011-08-04 Pedro Alves <pedro@codesourcery.com>
* event-loop.c (gdb_do_one_event): Remove `data' parameter. (start_event_loop): Use TRY_CATCH instead of catch_errors. * event-loop.h (gdb_do_one_event): Remove `data' parameter. * top.c (gdb_readline_wrapper): Adjust. * tui/tui-interp.c (tui_command_loop): (_initialize_tui_interp): Don't install it.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-interp.c79
1 files changed, 0 insertions, 79 deletions
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 2f0dd3d..78b8aca 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -132,84 +132,6 @@ tui_exec (void *data, const char *command_str)
internal_error (__FILE__, __LINE__, _("tui_exec called"));
}
-
-/* Initialize all the necessary variables, start the event loop,
- register readline, and stdin, start the loop. */
-
-static void
-tui_command_loop (void *data)
-{
- /* If we are using readline, set things up and display the first
- prompt, otherwise just print the prompt. */
- if (async_command_editing_p)
- {
- int length;
- char *a_prompt;
- char *gdb_prompt = get_prompt (0);
-
- /* Tell readline what the prompt to display is and what function
- it will need to call after a whole line is read. This also
- displays the first prompt. */
- length = strlen (get_prefix (0))
- + strlen (gdb_prompt) + strlen (get_suffix (0)) + 1;
- a_prompt = (char *) alloca (length);
- strcpy (a_prompt, get_prefix (0));
- strcat (a_prompt, gdb_prompt);
- strcat (a_prompt, get_suffix (0));
- rl_callback_handler_install (a_prompt, input_handler);
- }
- else
- display_gdb_prompt (0);
-
- /* Loop until there is nothing to do. This is the entry point to the
- event loop engine. gdb_do_one_event, called via catch_errors()
- will process one event for each invocation. It blocks waits for
- an event and then processes it. >0 when an event is processed, 0
- when catch_errors() caught an error and <0 when there are no
- longer any event sources registered. */
- while (1)
- {
- int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
-
- if (result < 0)
- break;
-
- /* Update gdb output according to TUI mode. Since catch_errors
- preserves the uiout from changing, this must be done at top
- level of event loop. */
- if (tui_active)
- current_uiout = tui_out;
- else
- current_uiout = tui_old_uiout;
-
- if (result == 0)
- {
- /* If any exception escaped to here, we better enable
- stdin. Otherwise, any command that calls async_disable_stdin,
- and then throws, will leave stdin inoperable. */
- async_enable_stdin ();
- /* FIXME: this should really be a call to a hook that is
- interface specific, because interfaces can display the
- prompt in their own way. */
- display_gdb_prompt (0);
- /* This call looks bizarre, but it is required. If the user
- entered a command that caused an error,
- after_char_processing_hook won't be called from
- rl_callback_read_char_wrapper. Using a cleanup there
- won't work, since we want this function to be called
- after a new prompt is printed. */
- if (after_char_processing_hook)
- (*after_char_processing_hook) ();
- /* Maybe better to set a flag to be checked somewhere as to
- whether display the prompt or not. */
- }
- }
-
- /* We are done with the event loop. There are no more event sources
- to listen to. So we exit GDB. */
- return;
-}
-
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_tui_interp;
@@ -222,7 +144,6 @@ _initialize_tui_interp (void)
tui_suspend,
tui_exec,
tui_display_prompt_p,
- tui_command_loop,
};
/* Create a default uiout builder for the TUI. */