diff options
author | Tom Tromey <tom@tromey.com> | 2020-04-13 12:42:59 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-13 14:10:03 -0600 |
commit | 58cf28e860429822ab0aa93a56e130c4430df396 (patch) | |
tree | a9909c52189750a8aa038e7acc61178b32168c5a /gdb/event-loop.c | |
parent | b7f999aee35f1a40739adea8b11805ceef061c95 (diff) | |
download | fsf-binutils-gdb-58cf28e860429822ab0aa93a56e130c4430df396.zip fsf-binutils-gdb-58cf28e860429822ab0aa93a56e130c4430df396.tar.gz fsf-binutils-gdb-58cf28e860429822ab0aa93a56e130c4430df396.tar.bz2 |
Move start_event_loop out of event-loop.c
A subsequent patch is going to move event-loop.c to gdbsupport. In a
review of an earlier version of this series, Pedro pointed out that
the resulting code would be cleaner if start_event_loop were not
shared -- because gdb and gdbserver have some different needs here --
and so this moves start_event_loop to main.c. Because the only caller
is there, it is also now static.
gdb/ChangeLog
2020-04-13 Tom Tromey <tom@tromey.com>
* event-loop.h (start_event_loop): Don't declare.
* event-loop.c (start_event_loop): Move...
* main.c (start_event_loop): ...here. Now static.
Diffstat (limited to 'gdb/event-loop.c')
-rw-r--r-- | gdb/event-loop.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/gdb/event-loop.c b/gdb/event-loop.c index af8f80b..36df476 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -318,60 +318,6 @@ gdb_do_one_event (void) return 1; } -/* Start up the event loop. This is the entry point to the event loop - from the command loop. */ - -void -start_event_loop (void) -{ - /* Loop until there is nothing to do. This is the entry point to - the event loop engine. gdb_do_one_event will process one event - for each invocation. It blocks waiting for an event and then - processes it. */ - while (1) - { - int result = 0; - - try - { - result = gdb_do_one_event (); - } - catch (const gdb_exception &ex) - { - exception_print (gdb_stderr, ex); - - /* 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. */ - SWITCH_THRU_ALL_UIS () - { - async_enable_stdin (); - } - /* If we long-jumped out of do_one_event, we probably didn't - get around to resetting the prompt, which leaves readline - in a messed-up state. Reset it here. */ - current_ui->prompt_state = PROMPT_NEEDED; - gdb::observers::command_error.notify (); - /* 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. */ - } - - if (result < 0) - break; - } - - /* We are done with the event loop. There are no more event sources - to listen to. So we exit GDB. */ - return; -} /* Wrapper function for create_file_handler, so that the caller |