From 468afe6c5fc9c80b8c175f3f13702ffaa6308400 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 21 Jun 2016 01:11:56 +0100 Subject: Send deleted watchpoint-scope output to all UIs Testing with: make check RUNTESTFLAGS="SEPARATE_MI_TTY=1" shows this, in gdb.mi/mi-watch.exp: -*stopped,reason="watchpoint-scope",wpnum="2",frame={addr="0x00000000004005cb", +*stopped,frame={addr="0x00000000004005cb", (...) -PASS: gdb.mi/mi-watch.exp: hw: watchpoint trigger +FAIL: gdb.mi/mi-watch.exp: hw: watchpoint trigger (unknown output after running) That is, we lose the "watchpoint-scope" output on the MI UI. This commit fixes it, and makes the test run with MI running as both main UI and separate UI. gdb/ChangeLog: 2016-06-21 Pedro Alves * breakpoint.c (watchpoint_check): Send watchpoint-deleted output to all UIs. gdb/testsuite/ChangeLog: 2016-06-21 Pedro Alves * gdb.mi/mi-watch.exp (test_watchpoint_creation_and_listing) (test_awatch_creation_and_listing) (test_rwatch_creation_and_listing, test_watchpoint_triggering): Remove 'type' parameter. (test_watchpoint_all): New parameter mi_mode. Remove with_test_prefix. (top level): Use foreach_with_prefix, and add main/separate UI MI testing axis. --- gdb/breakpoint.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'gdb/breakpoint.c') diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 27ca204..93dfba6 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5233,7 +5233,7 @@ watchpoint_check (void *p) } else { - struct ui_out *uiout = current_uiout; + struct switch_thru_all_uis state; /* This seems like the only logical thing to do because if we temporarily ignored the watchpoint, then when @@ -5248,14 +5248,20 @@ watchpoint_check (void *p) call breakpoint_ops->print_it this bp will be deleted already. So we have no choice but print the information here. */ - if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string - (uiout, "reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_SCOPE)); - ui_out_text (uiout, "\nWatchpoint "); - ui_out_field_int (uiout, "wpnum", b->base.number); - ui_out_text (uiout, - " deleted because the program has left the block in\n\ -which its expression is valid.\n"); + + SWITCH_THRU_ALL_UIS (state) + { + struct ui_out *uiout = current_uiout; + + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string + (uiout, "reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_SCOPE)); + ui_out_text (uiout, "\nWatchpoint "); + ui_out_field_int (uiout, "wpnum", b->base.number); + ui_out_text (uiout, + " deleted because the program has left the block in\n" + "which its expression is valid.\n"); + } /* Make sure the watchpoint's commands aren't executed. */ decref_counted_command_line (&b->base.commands); @@ -5423,10 +5429,18 @@ bpstat_check_watchpoint (bpstat bs) /* Can't happen. */ case 0: /* Error from catch_errors. */ - printf_filtered (_("Watchpoint %d deleted.\n"), b->base.number); - watchpoint_del_at_next_stop (b); - /* We've already printed what needs to be printed. */ - bs->print_it = print_it_done; + { + struct switch_thru_all_uis state; + + SWITCH_THRU_ALL_UIS (state) + { + printf_filtered (_("Watchpoint %d deleted.\n"), + b->base.number); + } + watchpoint_del_at_next_stop (b); + /* We've already printed what needs to be printed. */ + bs->print_it = print_it_done; + } break; } } -- cgit v1.1