From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 91B4D3858D38 for ; Mon, 3 Oct 2022 16:06:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 91B4D3858D38 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-326-sQedJkEGMsOZl2LeT-MfVQ-1; Mon, 03 Oct 2022 12:06:40 -0400 X-MC-Unique: sQedJkEGMsOZl2LeT-MfVQ-1 Received: by mail-wm1-f69.google.com with SMTP id p24-20020a05600c1d9800b003b4b226903dso9399407wms.4 for ; Mon, 03 Oct 2022 09:06:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=4o/JnhKJonHNvVnAEYJyqTxCQNTrFKtZYsBEem2yHlc=; b=MzDk4rktV7GPCwReYViDAoL4YJEFgoDKEym+1hgrYgPD1TUX83psZ2WP1E8YODy5xz MP/d/Ipi+A7jfOnhJYL03wY2p8rLxbzpv/w9eARY8bCbQC3O2ncEjo0HhvNYPVGJm0YX OAwjG7FOn9irsJV47sRlGw287rozVVfTGKsKhF9LQWTnLjyQn0y88ilhl1RYbjTxOoHY 9mvoJk8iTYjYXfPnHwQ/Ao3xGMgpzDyvIDW7YY6vyqnMIM/5RC9/qvWMBKTfiBuGCOcU xnvfoENrdpvDDz/FJrJoGT+BtUuuGdUJZYPalKhA7/LoZ4ow7UuSA90W+VxQCaZ2N6TS uv7g== X-Gm-Message-State: ACrzQf3TFxUKSQ4RzUhKQTxCFy3Y5tjYD0VlCAvqlyICTx9XCbequQNF xOrLkMGA0dtkRzWcFwmq95L/aEWXmeMSqLu/sPMMZ8yUh1IDhMnF8n1y19SL7ZQgaFx1odm+a+9 JKEOmzVdVr8tHLkNKHb+3/A== X-Received: by 2002:a05:600c:6026:b0:3b5:b00:3a5a with SMTP id az38-20020a05600c602600b003b50b003a5amr7356651wmb.108.1664813197424; Mon, 03 Oct 2022 09:06:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Q70BsFoiaB3kdU5mudTVZAkPMN/lOZiygb/QtDpFWP7DWl0iSZpXonpjXVjtc6s3Ig09kXA== X-Received: by 2002:a05:600c:6026:b0:3b5:b00:3a5a with SMTP id az38-20020a05600c602600b003b50b003a5amr7356640wmb.108.1664813197206; Mon, 03 Oct 2022 09:06:37 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id o2-20020a05600c4fc200b003b4924493bfsm22030109wmq.9.2022.10.03.09.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 09:06:36 -0700 (PDT) From: Andrew Burgess To: Lancelot SIX Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] gdb/testsuite: avoid creating files in gdb/testsuite directory In-Reply-To: <20221003111213.rzfci537xl3xbfkw@octopus> References: <337887b9594348c5880b7adbc0850e72e319e857.1664721741.git.aburgess@redhat.com> <20221003111213.rzfci537xl3xbfkw@octopus> Date: Mon, 03 Oct 2022 17:06:36 +0100 Message-ID: <87bkqshoxf.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Mon, 03 Oct 2022 16:06:43 -0000 Lancelot SIX writes: > Hi Andrew, > > On Sun, Oct 02, 2022 at 03:43:56PM +0100, Andrew Burgess via Gdb-patches wrote: >> I spotted that the test gdb.dwarf2/dw2-using-debug-str.exp was >> creating an output file (called debug_str_section) in the root >> build/gdb/testsuite directory instead of using the >> build/gdb/testsuite/output/gdb.dwarf2/dw2-using-debug-str/ directory. >> >> This is a result of not using standard_output_file in the test >> script. >> >> With this commit the file is now placed in the expected output >> directory. The test still passes for me. >> --- >> gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp >> index d27554f2f89..729961c99b5 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp >> @@ -105,7 +105,8 @@ gdb_test "p global_var" " = \\{aa = 0, bb = 0, cc = 0\\}" >> # cc-with-dwz-m.exp and cc-with-gnu-debuglink.exp. Handle this by >> # skipping the remainder of the test-case. >> set debug_str_section "${binfile}-debug-str" >> -set args "--dump-section .debug_str=debug_str_section $binfile" >> +set debug_str_file [standard_output_file "debug_str_section"] >> +set args "--dump-section .debug_str=${debug_str_file} $binfile" > > Just above your change, there is the following line: > > set debug_str_section "${binfile}-debug-str" > > I believe that the original intent was to use this as output file name, > but the '$' was use in the set args line. > > It looks to me that the change should be: > > -set args "--dump-section .debug_str=debug_str_section $binfile" > +set args "--dump-section .debug_str=$debug_str_section $binfile" > > If you prefer your change, the `set debug_str_section` line should be > removed. Good spot. Updated patch below. Thanks, Andrew --- commit 8e855f184d30f17a7bd0638f6cb8ee211be789e2 Author: Andrew Burgess Date: Sun Oct 2 15:18:15 2022 +0100 gdb/testsuite: avoid creating files in gdb/testsuite directory I spotted that the test gdb.dwarf2/dw2-using-debug-str.exp was creating an output file called debug_str_section in the root build/gdb/testsuite directory instead of using the build/gdb/testsuite/output/gdb.dwarf2/dw2-using-debug-str/ directory. This appears to be caused by a missing '$' character. We setup a variable debug_str_section which contains a path within the output directory, but then when we build the objcopy command we use 'debug_str_section' without a '$' prefix, as a result, we create the debug_str_section file. This commit adds the missing '$', the file is now created in the output directory. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp index d27554f2f89..4d1c49044d5 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp @@ -105,7 +105,7 @@ gdb_test "p global_var" " = \\{aa = 0, bb = 0, cc = 0\\}" # cc-with-dwz-m.exp and cc-with-gnu-debuglink.exp. Handle this by # skipping the remainder of the test-case. set debug_str_section "${binfile}-debug-str" -set args "--dump-section .debug_str=debug_str_section $binfile" +set args "--dump-section .debug_str=${debug_str_section} $binfile" set result [remote_exec host "[gdb_find_objcopy] $args"] set status [lindex $result 0] set output [lindex $result 1]