From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 962F13893647 for ; Thu, 21 Apr 2022 18:36:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 962F13893647 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 23LIa0lo029428 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Apr 2022 14:36:05 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 23LIa0lo029428 Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 899D51E15D; Thu, 21 Apr 2022 14:36:00 -0400 (EDT) Message-ID: Date: Thu, 21 Apr 2022 14:36:00 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 6/6] gdb/testsuite: add macros test for source files compiled in various ways Content-Language: tl To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20220407015159.1734834-1-simon.marchi@polymtl.ca> <20220407015159.1734834-7-simon.marchi@polymtl.ca> <87k0bmuycn.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87k0bmuycn.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 21 Apr 2022 18:36:00 +0000 X-Spam-Status: No, score=-3034.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP 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: Thu, 21 Apr 2022 18:36:10 -0000 On 2022-04-18 12:53, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> +set out_dir [standard_output_file ""] > Simon> +file mkdir $out_dir/cwd > Simon> +file mkdir $out_dir/other > Simon> +file copy -force $srcdir/$subdir/$srcfile $out_dir/cwd > Simon> +file copy -force $srcdir/$subdir/$srcfile $out_dir/other > > I never remember exactly but it seems to me that this may need to use > remote_upload? Hmm, don't know. When testing with a remote host, where are the target programs compiled? I just checked default_target_compile in DejaGNU, it does execute the target compiler on the possibly remote host. It uploads the source file and puts them all in the same default directory on the remote host. So the test wouldn't make sense then. I think I'll just skip the test if the host is remote, if that's fine with you. > Simon> +cd $out_dir/cwd > > It seems like this will interfere with other tests. > At the very least this test should 'cd' back. > > But I wonder if this will work with remote host testing. Or if we even > allow that any more. I'm not sure anybody does it, because I have never seen fixes regarding this (and I'm sure there are many cases where we would get it wrong). > > Maybe a different approach would be to let the compile command take a > 'working directory' parameter. Oh, looks like we have the "with_cwd" proc just for that, I'll use it. I prefer not to mess with gdb_compile just for a single test, especially since it's easy to do with with_cwd. Simon