From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8/B3Oqdne2LElwUAWB0awg (envelope-from ) for ; Wed, 11 May 2022 03:37:11 -0400 Received: by simark.ca (Postfix, from userid 112) id E43CA1E21F; Wed, 11 May 2022 03:37:11 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=dczzj8Nj; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4EDF01E01D for ; Wed, 11 May 2022 03:37:11 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B2FD38438E6 for ; Wed, 11 May 2022 07:37:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B2FD38438E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652254630; bh=84e26PtegD/1dpT7P6FhnIdEKTba8ewrO49xPo1zVEA=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dczzj8Nji0nB+mLM09jxlot6tQiV2ua6N1WFbzIYJjznVAnnhaWdpNS/hHIdlqtFf 8t+lfaRh1DDEBc8FdF4V7aLYSP26AvCptA/SPiub97Pe/15xqi/+pK6Eg3zmWnFi28 olnB39ahSH+2YYLdHga4vxZ3sg/rbk93Liy97xPg= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 49582384B83A for ; Wed, 11 May 2022 07:34:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49582384B83A 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 7C10E1F8F7 for ; Wed, 11 May 2022 07:34:58 +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 6710913A76 for ; Wed, 11 May 2022 07:34:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tBkNGCJne2JjUwAAMHmgww (envelope-from ) for ; Wed, 11 May 2022 07:34:58 +0000 Message-ID: <66af24a4-914e-d14a-c789-73d983fc0f32@suse.de> Date: Wed, 11 May 2022 09:34:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: [commited][gdb/testsuite] Remove target limits in gdb.base/catch-syscall.exp Content-Language: en-US To: gdb-patches@sourceware.org References: <20220510085947.GA17174@delia> In-Reply-To: <20220510085947.GA17174@delia> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/10/22 10:59, Tom de Vries via Gdb-patches wrote: > Hi, > > In test-case gdb.base/catch-syscall.exp, proc test_catch_syscall_multi_arch we > test for supported targets using istarget, like so: > ... > if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } { > ... > } elseif { [istarget "powerpc-*-linux*"] \ > || [istarget "powerpc64*-linux*"] } { > ... > ... > but the tests excercised there can all be executed if gdb is configured with > --enable-targets=all. > > Rewrite the proc to iterate over all cases, and check if the test is supported > by trying "set arch $arch1" and "set arch $arch2". > > Tested on x86_64-linux, with: > - a gdb build with --enable-targets=all, and > - a gdb build build with my usual --enable-targets setting (too long to > include here) which means the sparc vs sparc:v9 case is unsupported. > > Any comments? > Committed. Thanks, - Tom > [gdb/testsuite] Remove target limits in gdb.base/catch-syscall.exp > > --- > gdb/testsuite/gdb.base/catch-syscall.exp | 106 ++++++++++++++++++------------- > 1 file changed, 61 insertions(+), 45 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp > index 1427dfece6d..be119786734 100644 > --- a/gdb/testsuite/gdb.base/catch-syscall.exp > +++ b/gdb/testsuite/gdb.base/catch-syscall.exp > @@ -565,59 +565,33 @@ proc test_catch_syscall_with_wrong_args_noxml {} { > } > } > > -proc test_catch_syscall_multi_arch {} { > +proc test_catch_syscall_multi_arch_1 { > + arch1 arch2 syscall1_name syscall2_name syscall_number > +} { > global decimal binfile > > - if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } { > - set arch1 "i386" > - set arch2 "i386:x86-64" > - set syscall1_name "exit" > - set syscall2_name "write" > - set syscall_number 1 > - } elseif { [istarget "powerpc-*-linux*"] \ > - || [istarget "powerpc64*-linux*"] } { > - set arch1 "powerpc:common" > - set arch2 "powerpc:common64" > - set syscall1_name "openat" > - set syscall2_name "unlinkat" > - set syscall_number 286 > - } elseif { [istarget "sparc-*-linux*"] \ > - || [istarget "sparc64-*-linux*"] } { > - set arch1 "sparc" > - set arch2 "sparc:v9" > - set syscall1_name "setresuid32" > - set syscall2_name "setresuid" > - set syscall_number 108 > - } elseif { [istarget "mips*-linux*"] } { > - # MIPS does not use the same numbers for syscalls on 32 and 64 > - # bits. > - verbose "Not testing MIPS for multi-arch syscall support" > - return > - } elseif { [istarget "arm*-linux*"] } { > - # catch syscall supports only 32-bit ARM for now. > - verbose "Not testing ARM for multi-arch syscall support" > - return > - } elseif { [istarget "aarch64*-linux*"] } { > - set arch1 "aarch64" > - set arch2 "arm" > - set syscall1_name "reboot" > - set syscall2_name "_newselect" > - set syscall_number 142 > - } elseif { [istarget "s390*-linux*"] } { > - set arch1 "s390:31-bit" > - set arch2 "s390:64-bit" > - set syscall1_name "_newselect" > - set syscall2_name "select" > - set syscall_number 142 > - } > - > - with_test_prefix "multiple targets" { > + with_test_prefix "multiple targets: $arch1 vs $arch2" { > # We are not interested in loading any binary here, and in > # some systems (PowerPC, for example), if we load a binary > # there is no way to set other architecture. > gdb_exit > gdb_start > > + set supported 1 > + foreach arch [list $arch1 $arch2] { > + gdb_test_multiple "set architecture $arch" "" { > + -re -wrap "Undefined item: \"$arch\"\\." { > + set supported 0 > + unsupported $gdb_test_name > + } > + -re -wrap "The target architecture is set to \"$arch\"\\." { > + } > + } > + } > + if { $supported == 0 } { > + return > + } > + > gdb_test "set architecture $arch1" \ > "The target architecture is set to \"$arch1\"\\." > > @@ -636,6 +610,48 @@ proc test_catch_syscall_multi_arch {} { > } > } > > +proc test_catch_syscall_multi_arch {} { > + set arch1 "i386" > + set arch2 "i386:x86-64" > + set syscall1_name "exit" > + set syscall2_name "write" > + set syscall_number 1 > + test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ > + $syscall2_name $syscall_number > + > + set arch1 "powerpc:common" > + set arch2 "powerpc:common64" > + set syscall1_name "openat" > + set syscall2_name "unlinkat" > + set syscall_number 286 > + test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ > + $syscall2_name $syscall_number > + > + set arch1 "sparc" > + set arch2 "sparc:v9" > + set syscall1_name "setresuid32" > + set syscall2_name "setresuid" > + set syscall_number 108 > + test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ > + $syscall2_name $syscall_number > + > + set arch1 "aarch64" > + set arch2 "arm" > + set syscall1_name "reboot" > + set syscall2_name "_newselect" > + set syscall_number 142 > + test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ > + $syscall2_name $syscall_number > + > + set arch1 "s390:31-bit" > + set arch2 "s390:64-bit" > + set syscall1_name "_newselect" > + set syscall2_name "select" > + set syscall_number 142 > + test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ > + $syscall2_name $syscall_number > +} > + > proc do_syscall_tests_without_xml {} { > # Make sure GDB doesn't load the syscalls xml from the system data > # directory.