diff options
| -rw-r--r-- | gdb/ChangeLog | 4 | ||||
| -rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.base/new-ui.exp | 12 | ||||
| -rw-r--r-- | gdb/utils.c | 4 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dbee02a..dcd047a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2017-02-10 Simon Marchi <simon.marchi@ericsson.com> + + * utils.c (defaulted_query): Don't query on secondary UIs. + 2017-02-10 Tom Tromey <tom@tromey.com> * rust-lang.c (rust_get_disr_info): Remove unused variable. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3274b40..c1e53b7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-02-10 Simon Marchi <simon.marchi@ericsson.com> + * gdb.base/new-ui.exp (do_test): Test queries behavior on main + and extra UIs. + +2017-02-10 Simon Marchi <simon.marchi@ericsson.com> + * gdb.base/new-ui.exp (do_test, do_test_invalid_args): Use proc_with_prefix. diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp index 8224b7d..b84f4de 100644 --- a/gdb/testsuite/gdb.base/new-ui.exp +++ b/gdb/testsuite/gdb.base/new-ui.exp @@ -128,6 +128,18 @@ proc_with_prefix do_test {} { gdb_test "print 2" "^print 2\r\n\\\$2 = 2" "print on extra console" } + # Verify that we get proper queries on the main UI, but that they are + # auto-answered on secondary UIs. + with_spawn_id $gdb_main_spawn_id { + gdb_test "delete" "" "delete all breakpoint on main console" \ + "Delete all breakpoints. .y or n. $" "n" + } + with_spawn_id $extra_spawn_id { + gdb_test "delete" \ + "Delete all breakpoints. .y or n. .answered Y; input not from terminal." \ + "delete all breakpoints on extra console" + } + # Run a few execution tests with the main console as the driver # console. with_test_prefix "main console" { diff --git a/gdb/utils.c b/gdb/utils.c index 3dc2f03..27021a1 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1175,7 +1175,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) way, important error messages don't get lost when talking to GDB over a pipe. */ if (current_ui->instream != current_ui->stdin_stream - || !input_interactive_p (current_ui)) + || !input_interactive_p (current_ui) + /* Restrict queries to the main UI. */ + || current_ui != main_ui) { old_chain = make_cleanup_restore_target_terminal (); |
