From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77367 invoked by alias); 13 Sep 2019 19:50:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 76964 invoked by uid 89); 13 Sep 2019 19:50:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Sep 2019 19:50:31 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A00ACB087 for ; Fri, 13 Sep 2019 19:50:29 +0000 (UTC) Subject: [PING^2][PATCH][gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir From: Tom de Vries To: gdb-patches@sourceware.org References: <20190822144220.GA6937@delia> <3e167875-f407-2a47-fb3e-74ee7c3d1ece@suse.de> Openpgp: preference=signencrypt Message-ID: <7f0c7cc2-96d3-813f-8f80-dcfe66649d02@suse.de> Date: Fri, 13 Sep 2019 19:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <3e167875-f407-2a47-fb3e-74ee7c3d1ece@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00240.txt.bz2 On 06-09-19 17:28, Tom de Vries wrote: > On 22-08-19 16:42, Tom de Vries wrote: >> Hi, >> >> When running a test-case gdb.base/foo.exp with cc-with-dwz-m, a file >> build/gdb/testsuite/outputs/gdb.base/foo/foo.dwz will be created, alongside >> executable build/gdb/testsuite/outputs/gdb.base/foo/foo. >> >> This can cause problems in f.i. test-cases that test file name completion. >> >> Make these problems less likely by moving foo.dwz to a .tmp subdir: >> build/gdb/testsuite/outputs/gdb.base/foo/.tmp/foo.dwz. >> >> Tested on x86_64-linux. >> >> OK for trunk? > Ping^2. Thanks, - Tom >> [gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir >> >> gdb/ChangeLog: >> >> 2019-08-22 Tom de Vries >> >> * contrib/cc-with-tweaks.sh (get_tmpdir): New function. >> Use $tmpdir/$(basename "$output_file").dwz instead of >> "${output_file}.dwz". >> >> --- >> gdb/contrib/cc-with-tweaks.sh | 16 ++++++++++++---- >> 1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh >> index 7df16bc6c1..98c4f89afc 100755 >> --- a/gdb/contrib/cc-with-tweaks.sh >> +++ b/gdb/contrib/cc-with-tweaks.sh >> @@ -163,6 +163,12 @@ then >> exit 1 >> fi >> >> +get_tmpdir () >> +{ >> + tmpdir=$(dirname "$output_file")/.tmp >> + mkdir -p "$tmpdir" >> +} >> + >> if [ "$want_objcopy_compress" = true ]; then >> $OBJCOPY --compress-debug-sections "$output_file" >> rc=$? >> @@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then >> ;; >> esac >> elif [ "$want_multi" = true ]; then >> + get_tmpdir >> + dwz_file=$tmpdir/$(basename "$output_file").dwz >> # Remove the dwz output file if it exists, so we don't mistake it for a >> # new file in case dwz fails. >> - rm -f "${output_file}.dwz" >> + rm -f "$dwz_file" >> >> cp $output_file ${output_file}.alt >> - $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null >> + $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null >> rm -f ${output_file}.alt >> >> # Validate dwz's work by checking if the expected output file exists. >> - if [ ! -f "${output_file}.dwz" ]; then >> - echo "$myname: dwz file ${output_file}.dwz missing." >> + if [ ! -f "$dwz_file" ]; then >> + echo "$myname: dwz file $dwz_file missing." >> exit 1 >> fi >> fi >>