From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8PmWGuwqpF8EdwAAWB0awg (envelope-from ) for ; Thu, 05 Nov 2020 11:40:12 -0500 Received: by simark.ca (Postfix, from userid 112) id 68BB21F08B; Thu, 5 Nov 2020 11:40:12 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 A61731E552 for ; Thu, 5 Nov 2020 11:40:11 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E73339F8417; Thu, 5 Nov 2020 16:40:11 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 370AA39F8417 for ; Thu, 5 Nov 2020 16:40:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 370AA39F8417 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4C5A0AB4C for ; Thu, 5 Nov 2020 16:40:08 +0000 (UTC) Date: Thu, 5 Nov 2020 17:40:06 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Handle multiple sources in build_executable_from_fission_assembler Message-ID: <20201105164005.GA26356@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, The proc build_executable_from_fission_assembler currently only handles one source file. Remove that restriction, and add a parameter to specify regular, non-fission sources. Tested gdb.dwarf2/*.exp on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Handle multiple sources in build_executable_from_fission_assembler gdb/testsuite/ChangeLog: 2020-11-05 Tom de Vries * gdb.dwarf2/fission-base.exp: Add extra arg to * build_executable_from_fission_assembler call. * gdb.dwarf2/fission-loclists-pie.exp: Same. * gdb.dwarf2/fission-loclists.exp: Same. * gdb.dwarf2/fission-multi-cu.exp: Same. * gdb.dwarf2/fission-reread.exp: Same. * lib/dwarf.exp (build_object_from_fission_assembler): New proc, factored out of ... (build_executable_from_fission_assembler): ... here. Handle more than one fission source. Add parameter to handle non-fission sources. --- gdb/testsuite/gdb.dwarf2/fission-base.exp | 2 +- gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp | 2 +- gdb/testsuite/gdb.dwarf2/fission-loclists.exp | 2 +- gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp | 2 +- gdb/testsuite/gdb.dwarf2/fission-reread.exp | 2 +- gdb/testsuite/lib/dwarf.exp | 43 +++++++++++++++++------ 6 files changed, 37 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp b/gdb/testsuite/gdb.dwarf2/fission-base.exp index 41e30a73fb..ce929dfe04 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-base.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp @@ -33,7 +33,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} { standard_testfile .S if [build_executable_from_fission_assembler \ - "$testfile.exp" "$binfile" "$srcfile" {nodebug}] { + "$testfile.exp" "$binfile" "$srcfile" {} {nodebug}] { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp index 519d4aa5dc..c9ce46ea44 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp @@ -38,7 +38,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} { standard_testfile .S if [build_executable_from_fission_assembler \ - "$testfile.exp" "$binfile" "$srcfile" \ + "$testfile.exp" "$binfile" "$srcfile" {} \ [list "nodebug" "ldflags=-pie"]] { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists.exp b/gdb/testsuite/gdb.dwarf2/fission-loclists.exp index d80ec2ba63..b3ce6d2eb1 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-loclists.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-loclists.exp @@ -33,7 +33,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} { standard_testfile .S if [build_executable_from_fission_assembler \ - "$testfile.exp" "$binfile" "$srcfile" {nodebug}] { + "$testfile.exp" "$binfile" "$srcfile" {} {nodebug}] { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp b/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp index f2be5b91d6..e1b9351c62 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp @@ -33,7 +33,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} { standard_testfile .S if [build_executable_from_fission_assembler \ - "$testfile.exp" "$binfile" "$srcfile" {nodebug}] { + "$testfile.exp" "$binfile" "$srcfile" {} {nodebug}] { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.exp b/gdb/testsuite/gdb.dwarf2/fission-reread.exp index 1994ad7a59..1a82cd799c 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-reread.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-reread.exp @@ -31,7 +31,7 @@ set additional_flags [gdb_target_symbol_prefix_flags_asm] standard_testfile .S if [build_executable_from_fission_assembler \ - "$testfile.exp" "$binfile" "$srcfile" \ + "$testfile.exp" "$binfile" "$srcfile" {} \ [list nodebug $additional_flags]] { return -1 } diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 7bb745c71d..c18130b74d 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -29,27 +29,20 @@ proc dwarf2_support {} { return 0 } -# Build an executable from a fission-based .S file. +# Build an object from a fission-based .S file SOURCE. # This handles the extra work of splitting the .o into non-dwo and dwo # pieces, making sure the .dwo is available if we're using cc-with-tweaks.sh # to build a .dwp file. -# The arguments and results are the same as for build_executable. +# The options argument is the same as for gdb_compile. # # Current restrictions: -# - only supports one source file # - cannot be run on remote hosts -proc build_executable_from_fission_assembler { testname executable sources options } { - verbose -log "build_executable_from_fission_assembler $testname $executable $sources $options" - if { [llength $sources] != 1 } { - error "Only one source file supported." - } +proc build_object_from_fission_assembler { source_file options } { if [is_remote host] { error "Remote hosts are not supported." } - global srcdir subdir - set source_file ${srcdir}/${subdir}/${sources} set root_name [file rootname [file tail $source_file]] set output_base [standard_output_file $root_name] set object_file ${output_base}.o @@ -78,7 +71,35 @@ proc build_executable_from_fission_assembler { testname executable sources optio return -1 } - set result [gdb_compile $object_file $executable executable $options] + return $object_file +} + +# Build an executable from fission-based .S files FISSION_SOURCES, and regular +# SOURCES. The arguments and results are the same as for build_executable. + +# Current restrictions: +# - cannot be run on remote hosts + +proc build_executable_from_fission_assembler { testname executable fission_sources sources options } { + verbose -log "build_executable_from_fission_assembler $testname $executable $fission_sources $sources $options" + if [is_remote host] { + error "Remote hosts are not supported." + } + + global srcdir subdir + + set l [list] + foreach source $fission_sources { + if { [file pathtype $source] ne "absolute" } { + set source ${srcdir}/${subdir}/${source} + } + set object_file [build_object_from_fission_assembler $source $options] + lappend l $object_file + } + foreach source $sources { + lappend l ${srcdir}/${subdir}/$source + } + set result [gdb_compile $l $executable executable $options] if { "$result" != "" } { return -1 }