From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81908 invoked by alias); 6 May 2016 12:35:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 81349 invoked by uid 89); 6 May 2016 12:35:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=deb X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 06 May 2016 12:35:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF40181109 for ; Fri, 6 May 2016 12:35:35 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u46CZ5IU017259 for ; Fri, 6 May 2016 08:35:35 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v3 33/34] Make mi-break.exp always expect breakpoint commands output on the main UI Date: Fri, 06 May 2016 12:35:00 -0000 Message-Id: <1462538104-19109-34-git-send-email-palves@redhat.com> In-Reply-To: <1462538104-19109-1-git-send-email-palves@redhat.com> References: <1462538104-19109-1-git-send-email-palves@redhat.com> X-SW-Source: 2016-05/txt/msg00105.txt.bz2 mi-break.exp regresses when tested with MI running on a secondary UI, with RUNTESTFLAGS="FORCE_SEPARATE_MI_TTY=1". The problem is simply that the test sets a breakpoint, and attaches "print" commands to the breakpoint. Since breakpoint commands always run with the main UI as current UI, the breakpoint command's output goes to the main UI. So we need to tweak the test to expect it there. gdb/ChangeLog: yyyy-mm-dd Pedro Alves * gdb.mi/mi-break.exp (test_breakpoint_commands): Always expect breakpoint command's output on the main UI. (test_break): New procedure, factored out from calls in the top level. (top level): Use foreach_with_prefix to test MI as main UI and as separate UI. --- gdb/testsuite/gdb.mi/mi-break.exp | 69 +++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 85f328d..00293d7 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -23,11 +23,6 @@ load_lib mi-support.exp set MIFLAGS "-i=mi" -gdb_exit -if [mi_gdb_start] { - continue -} - standard_testfile basics.c if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { @@ -35,10 +30,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - # Locate line numbers in basics.c. set line_callee4_head [gdb_get_line_number "callee4 ("] set line_callee4_body [expr $line_callee4_head + 2] @@ -292,9 +283,25 @@ proc test_breakpoint_commands {} { mi_send_resuming_command "exec-continue" "breakpoint commands: continue" - set test "intermediate stop and continue" + + # The breakpoint command's output is always sent to the main UI, + # even when testing with MI running on a secondary UI. + global gdb_main_spawn_id + + set test "intermediate stop and continue, bp commands" gdb_expect { - -re ".*\\\$1 = 0.*\\\$10 = 9.*\\*running" { + -i $gdb_main_spawn_id + -re ".*\\\$1 = 0.*\\\$10 = 9" { + pass $test + } + timeout { + fail $test + } + } + + set test "intermediate stop and continue, mi running" + gdb_expect { + -re "\\*running" { pass $test } timeout { @@ -385,20 +392,40 @@ proc test_explicit_breakpoints {} { ".*Source filename requires function, label, or line offset.*" } -test_tbreak_creation_and_listing -test_rbreak_creation_and_listing +proc test_break {mi_mode} { + global srcdir subdir binfile + + mi_gdb_exit + + if {$mi_mode == "separate"} { + set start_ops "separate-mi-tty" + } else { + set start_ops "" + } + if [mi_gdb_start $start_ops] { + return + } + + mi_delete_breakpoints + mi_gdb_reinitialize_dir $srcdir/$subdir + mi_gdb_load ${binfile} -test_ignore_count + test_tbreak_creation_and_listing + test_rbreak_creation_and_listing -test_error + test_ignore_count -test_disabled_creation + test_error -test_breakpoint_commands + test_disabled_creation -test_abreak_creation + test_breakpoint_commands -test_explicit_breakpoints + test_abreak_creation -mi_gdb_exit -return 0 + test_explicit_breakpoints +} + +foreach_with_prefix mi-mode {"main" "separate"} { + test_break ${mi-mode} +} -- 2.5.5