-
- /* When readline has read an end-of-line character, it passes the
- complete line to gdb for processing; command_line_handler is the
- function that does this. */
- ui->input_handler = command_line_handler;
-
- /* Tell readline to use the same input stream that gdb uses. */
- rl_instream = ui->instream;
-
- /* Get a file descriptor for the input stream, so that we can
- register it with the event loop. */
- input_fd = fileno (ui->instream);
-
- /* 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
- register with the even loop. Another source is going to be the
- target program (inferior), but that must be registered only when
- it actually exists (I.e. after we say 'run' or after we connect
- to a remote target. */
- add_file_handler (input_fd, stdin_event_handler, 0);
+
+ /* Now create the event source for this UI's input file descriptor.
+ Another source is going to be the target program (inferior), but
+ that must be registered only when it actually exists (I.e. after
+ we say 'run' or after we connect to a remote target. */
+ ui_register_input_event_handler (ui);