X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftui%2Ftui-interp.c;h=78b8aca3d022ada2cc609413d16db728aa7dd984;hb=e0dd0826e246e3d39081881db7bcc69ca5ec77a2;hp=2f0dd3d4366c4900a6c38da173f11f2982c6a9e1;hpb=79a45e254f090b628473614054ed318d70409239;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 2f0dd3d436..78b8aca3d0 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. */