Let ui::input_fd be -1
This changes gdb so that, if ui::input_fd is set to -1, then it will not be registered with the event loop. This is useful for the DAP support code I wrote, but as it turns out to also be useful to Insight, it seems best to check it in separately.
This commit is contained in:
parent
4749b84b51
commit
51cacdb50f
2 changed files with 7 additions and 4 deletions
|
@ -533,8 +533,9 @@ stdin_event_handler (int error, gdb_client_data client_data)
|
||||||
void
|
void
|
||||||
ui::register_file_handler ()
|
ui::register_file_handler ()
|
||||||
{
|
{
|
||||||
add_file_handler (input_fd, stdin_event_handler, this,
|
if (input_fd != -1)
|
||||||
string_printf ("ui-%d", num), true);
|
add_file_handler (input_fd, stdin_event_handler, this,
|
||||||
|
string_printf ("ui-%d", num), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See top.h. */
|
/* See top.h. */
|
||||||
|
@ -542,7 +543,8 @@ ui::register_file_handler ()
|
||||||
void
|
void
|
||||||
ui::unregister_file_handler ()
|
ui::unregister_file_handler ()
|
||||||
{
|
{
|
||||||
delete_file_handler (input_fd);
|
if (input_fd != -1)
|
||||||
|
delete_file_handler (input_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Re-enable stdin after the end of an execution command in
|
/* Re-enable stdin after the end of an execution command in
|
||||||
|
|
|
@ -118,7 +118,8 @@ struct ui
|
||||||
FILE *errstream;
|
FILE *errstream;
|
||||||
|
|
||||||
/* The file descriptor for the input stream, so that we can register
|
/* The file descriptor for the input stream, so that we can register
|
||||||
it with the event loop. */
|
it with the event loop. This can be set to -1 to prevent this
|
||||||
|
registration. */
|
||||||
int input_fd;
|
int input_fd;
|
||||||
|
|
||||||
/* Whether ISATTY returns true on input_fd. Cached here because
|
/* Whether ISATTY returns true on input_fd. Cached here because
|
||||||
|
|
Loading…
Add table
Reference in a new issue