From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 9D040385800C for ; Fri, 19 Nov 2021 14:55:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D040385800C Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B6900212CC for ; Fri, 19 Nov 2021 14:55:53 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A121013B32 for ; Fri, 19 Nov 2021 14:55:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jFMzJvm6l2H9DwAAMHmgww (envelope-from ) for ; Fri, 19 Nov 2021 14:55:53 +0000 Subject: [committed][gdb/testsuite] Handle runto fail in gdb.mi/mi-var-cp.exp To: gdb-patches@sourceware.org References: <20211025161603.17377-1-tdevries@suse.de> From: Tom de Vries Message-ID: <69026d9c-8658-449c-de90-a1571f37cb0a@suse.de> Date: Fri, 19 Nov 2021 15:55:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20211025161603.17377-1-tdevries@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2021 14:55:57 -0000 On 10/25/21 6:16 PM, Tom de Vries via Gdb-patches wrote: > On OBS I ran into: > ... > PASS: gdb.mi/mi-var-cp.exp: run to mi-var-cp.cc:81 (set breakpoint) > UNRESOLVED: gdb.mi/mi-var-cp.exp: unable to start target > ... > followed by 81 FAILs and two more UNRESOLVEDs. > > I didn't manage to reproduce this, but I did notice that the initial > problem causing the UNRESOLVED caused all subsequent UNRESOLVEDs and FAILs. > > I emulated the problem by commenting out the send_gdb "run\n" in > mi_run_cmd_full. > > Fix this by: > - handling mi_run_cmd failure in mi_get_inline_test > - handling mi_run_inline_test failure in gdb.mi/mi-var-cp.exp, and > other test-cases using mi_get_inline_test > > Tested on x86_64-linux. I've committed this now. Thanks, - Tom > --- > gdb/testsuite/gdb.mi/mi-var-child.exp | 4 +++- > gdb/testsuite/gdb.mi/mi-var-cmd.exp | 18 ++++++++++++++---- > gdb/testsuite/gdb.mi/mi-var-cp.exp | 18 +++++++++++++----- > gdb/testsuite/gdb.mi/mi-var-rtti.exp | 22 +++++++++++++++------- > gdb/testsuite/lib/mi-support.exp | 6 +++++- > 5 files changed, 50 insertions(+), 18 deletions(-) > > diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp > index 8632fe26cf8..63cea065c3f 100644 > --- a/gdb/testsuite/gdb.mi/mi-var-child.exp > +++ b/gdb/testsuite/gdb.mi/mi-var-child.exp > @@ -1205,7 +1205,9 @@ mi_varobj_update * {psnp->ptrs.0.next.next.long_ptr} \ > > mi_prepare_inline_tests $srcfile > > -mi_run_inline_test child_deletion > +if { [mi_run_inline_test child_deletion] < 0 } { > + return -1 > +} > > > mi_gdb_exit > diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp > index fe0826d480d..fbf57aa25ac 100644 > --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp > +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp > @@ -587,14 +587,24 @@ proc set_frozen {varobjs flag} { > } > > mi_prepare_inline_tests $srcfile > -mi_run_inline_test frozen > > -mi_run_inline_test bitfield > +set inline_tests { > + frozen > + bitfield > +} > + > +# Needs to be last, following tests rely on this. > +lappend inline_tests floating > + > +foreach inline_test $inline_tests { > + if { [mi_run_inline_test $inline_test] < 0 } { > + return -1 > + } > +} > > # Since the inline test framework does not really work with > -# function calls, first to inline tests and then do the reminder > +# function calls, first to inline tests and then do the remainder > # manually. > -mi_run_inline_test floating > set do_at_tests_callee_breakpoint [gdb_get_line_number "breakpoint inside callee"] > mi_gdb_test "-break-insert var-cmd.c:$do_at_tests_callee_breakpoint" ".*" \ > "inside breakpoint inside callee" > diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp > index 4e8abe8d961..8fdd0f863a7 100644 > --- a/gdb/testsuite/gdb.mi/mi-var-cp.exp > +++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp > @@ -38,11 +38,19 @@ mi_gdb_load ${binfile} > > mi_prepare_inline_tests $srcfile > > -mi_run_inline_test reference_update > -mi_run_inline_test base_in_reference > -mi_run_inline_test reference_to_pointer > -mi_run_inline_test reference_to_struct > -mi_run_inline_test path_expression > +set inline_tests { > + reference_update > + base_in_reference > + reference_to_pointer > + reference_to_struct > + path_expression > +} > + > +foreach inline_test $inline_tests { > + if { [mi_run_inline_test $inline_test] < 0 } { > + return -1 > + } > +} > > set lineno [gdb_get_line_number "/* anonymous_structs_and_unions */"] > mi_create_breakpoint "$srcfile:$lineno" \ > diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-rtti.exp > index b574e5c4edb..a0a2e132aaf 100644 > --- a/gdb/testsuite/gdb.mi/mi-var-rtti.exp > +++ b/gdb/testsuite/gdb.mi/mi-var-rtti.exp > @@ -109,13 +109,21 @@ proc check_new_derived_with_rtti {var_name var_type testname} { > "delete varobj for ${var_name} (with RTTI) in $testname" > } > > -mi_run_inline_test use_rtti_for_ptr > -mi_run_inline_test use_rtti_for_ref > -mi_run_inline_test use_rtti_for_ptr_child > -mi_run_inline_test use_rtti_for_ref_child > -mi_run_inline_test use_rtti_with_multiple_inheritence > -mi_run_inline_test type_update_when_use_rtti > -mi_run_inline_test skip_type_update_when_not_use_rtti > +set inline_tests { > + use_rtti_for_ptr > + use_rtti_for_ref > + use_rtti_for_ptr_child > + use_rtti_for_ref_child > + use_rtti_with_multiple_inheritence > + type_update_when_use_rtti > + skip_type_update_when_not_use_rtti > +} > + > +foreach inline_test $inline_tests { > + if { [mi_run_inline_test $inline_test] < 0 } { > + return -1 > + } > +} > > mi_gdb_exit > return 0 > diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp > index f6ee352b67e..7e02badd967 100644 > --- a/gdb/testsuite/lib/mi-support.exp > +++ b/gdb/testsuite/lib/mi-support.exp > @@ -1955,7 +1955,9 @@ proc mi_run_inline_test { testcase } { > if {$first==1} { > # Start the program afresh. > mi_tbreak "$mi_autotest_source:$line" > - mi_run_cmd > + if { [mi_run_cmd] < 0 } { > + return -1 > + } > set line_now [mi_get_stop_line "$testcase: step to $line"] > set first 0 > } elseif {$line_now!=$line} { > @@ -1982,6 +1984,8 @@ proc mi_run_inline_test { testcase } { > # will need more experience to be sure. > eval $statements > } > + > + return 0 > } > > proc get_mi_thread_list {name} { > > base-commit: 9de46719da07a439af59088d69cb4dd70c030612 >