From: Elena Zannoni Date: Thu, 3 Oct 2002 01:23:50 +0000 (+0000) Subject: 2002-10-02 Elena Zannoni X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cee6ddebfcaa7a470da630f3e459c1b99989e618;p=binutils-gdb.git 2002-10-02 Elena Zannoni * event-top.c (gdb_setup_readline): New function. Code moved from _initialize_event_loop(). (_initialize_event_loop): Call gdb_setup_readline(). --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b1c32492c9c..413e60f6d48 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-10-02 Elena Zannoni + + * event-top.c (gdb_setup_readline): New function. Code moved from + _initialize_event_loop(). + (_initialize_event_loop): Call gdb_setup_readline(). + 2002-10-02 Andrew Cagney * infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C. @@ -13,7 +19,7 @@ of fill_in_vptr_fieldno. 2002-10-02 Elena Zannoni - + * inferior.h (registers_info, stepi_command, nexti_command, continue_command, interrupt_target_command): Export from infcmd.c. * frame.h (args_info, selected_frame_level_changed_hook, diff --git a/gdb/event-top.c b/gdb/event-top.c index 86c658d030e..9d871d65906 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -1117,8 +1117,12 @@ set_async_prompt (char *args, int from_tty, struct cmd_list_element *c) interface, i.e. via a callback function (rl_callback_read_char), and hook up instream to the event loop. */ void -_initialize_event_loop (void) +gdb_setup_readline (void) { + /* This function is a noop for the sync case. The assumption is that + the sync setup is ALL done in gdb_init, and we would only mess it up + here. The sync stuff should really go away over time. */ + if (event_loop_p) { /* If the input stream is connected to a terminal, turn on @@ -1153,9 +1157,6 @@ _initialize_event_loop (void) register it with the event loop. */ input_fd = fileno (instream); - /* Tell gdb to use the cli_command_loop as the main loop. */ - command_loop_hook = cli_command_loop; - /* Now we need to create the event sources for the input file descriptor. */ /* At this point in time, this is the only event source that we @@ -1166,3 +1167,15 @@ _initialize_event_loop (void) add_file_handler (input_fd, stdin_event_handler, 0); } } + +void +_initialize_event_loop (void) +{ + gdb_setup_readline (); + + if (event_loop_p && command_loop_hook == NULL) + { + /* Tell gdb to use the cli_command_loop as the main loop. */ + command_loop_hook = cli_command_loop; + } +}