From patchwork Wed Nov 30 17:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 61272 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A414385B52D for ; Wed, 30 Nov 2022 17:50:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A414385B52D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669830614; bh=R7isz9xbt5FtRRCNZgsGtmeQ7j4HzhPlaIC1eoErjs8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=reWnFyos1E3gITA7rDqoSigm2oEDDoWQImqtW9y9iVvlZT6v5JkN3Nf4pJ7xQRXWq 6iK6aTJpwBasYMJ1cpUSjYzBxg4DsQGfmcJLTIvMXMH3ZMMTGs9ZweqsMeAEt50FHM QiLPwlkvxQmmdEG6IrThymq7mV4YKjO+e/Z4vf+Q= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 135143858D1E for ; Wed, 30 Nov 2022 17:49:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 135143858D1E 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-out2.suse.de (Postfix) with ESMTPS id 2F6361F45B for ; Wed, 30 Nov 2022 17:49:50 +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 1A2821331F for ; Wed, 30 Nov 2022 17:49:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XWYKBb6Xh2PhZQAAMHmgww (envelope-from ) for ; Wed, 30 Nov 2022 17:49:50 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Enable gdb.arch/s390-disassembler-options.exp for --enable-targets=all Date: Wed, 30 Nov 2022 18:49:49 +0100 Message-Id: <20221130174949.9624-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" On s390x-linux, I run into: ... DUPLICATE: gdb.arch/s390-disassembler-options.exp: \ show disassembler-options esa ... First, reproduce this on x86_64-linux with --enable-targets=all, by replacing the test for 'istarget "s390*-*-*"' with a test for 'get_set_option_choices "set architecture" "s390"'. Fix the DUPLICATE by using with_test_prefix. Also modernize the test-case by using clean_restart instead of gdb_exit/gdb_start. Tested on x86_64-linux. --- .../gdb.arch/s390-disassembler-options.exp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) base-commit: 885d86436c3f9ab0a13f39647860b526faa92cf8 diff --git a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp index 7ba9e51cc3c..df6c2363069 100644 --- a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp +++ b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp @@ -18,39 +18,43 @@ # This test exercises set/show disassembler-options results are preserved # across multiple set architecture calls. -if {![istarget "s390*-*-*"]} { - verbose "Skipping S390 disassembler options." - return -} - -gdb_exit -gdb_start +clean_restart -set option "esa" +set archs [get_set_option_choices "set architecture" "s390"] set arch1 "s390:64-bit" set arch2 "s390:31-bit" +foreach arch [list $arch1 $arch2] { + if { [lsearch -exact $archs $arch] == -1 } { + return + } +} -gdb_test "set architecture $arch1" \ +set option "esa" + +with_test_prefix $arch1 { + gdb_test "set architecture $arch1" \ "The target architecture is set to \"$arch1\"\." \ "set architecture $arch1" -gdb_test_no_output "set disassembler-options" -gdb_test "show disassembler-options" \ + gdb_test_no_output "set disassembler-options" + gdb_test "show disassembler-options" \ "The current disassembler options are ''.*" \ "show NULL disassembler-options" -gdb_test_no_output "set disassembler-options $option" -gdb_test "show disassembler-options" \ + gdb_test_no_output "set disassembler-options $option" + gdb_test "show disassembler-options" \ "The current disassembler options are '$option'.*" \ "show disassembler-options $option" +} # Change architectures and verify the disassembler options have been preserved. -gdb_test "set architecture $arch2" \ +with_test_prefix $arch2 { + gdb_test "set architecture $arch2" \ "The target architecture is set to \"$arch2\"\." \ "set architecture $arch2" -gdb_test "show disassembler-options" \ + gdb_test "show disassembler-options" \ "The current disassembler options are '$option'.*" \ "show disassembler-options $option" - +}