From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yMbTMyeer2CiPQAAWB0awg (envelope-from ) for ; Thu, 27 May 2021 09:27:03 -0400 Received: by simark.ca (Postfix, from userid 112) id D28F01F11C; Thu, 27 May 2021 09:27:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 2C5FF1E783 for ; Thu, 27 May 2021 09:27:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E6BD13955426; Thu, 27 May 2021 13:27:02 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id E45D23860C39 for ; Thu, 27 May 2021 13:26:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E45D23860C39 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 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 01BCC1FD2F for ; Thu, 27 May 2021 13:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622122019; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=vGo5iilb+JGQ1kkVE0PIrdKyTdcNLYIDysO1RRuUhj4=; b=NK0dPsef/yByTc997WByB7hlr8XotGJ9y3StMESLMBdtTRylA368Xv4WzfDwe2Kmm3DSRJ Fm2dzssGvfp4gvs7h6nCzfOyOXLDHiprSZOWvk93BFxXVz7oxC5Pf7K6dD6pOWTDFGdEaA 7kZ/aY9EWI1l/KUQ4uEwXvf4+qWwl/A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622122019; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=vGo5iilb+JGQ1kkVE0PIrdKyTdcNLYIDysO1RRuUhj4=; b=2LVj+u5Zsi8UiryaBLRrYSSykKqX3vMKhhO6J/EzR/QhFVMYYDf85oDQgiw5HvzzjeGSpq 4KvexGPvbzCL0HDw== Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id E704311A98 for ; Thu, 27 May 2021 13:26:58 +0000 (UTC) Date: Thu, 27 May 2021 15:26:57 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Prevent proc override in gdb-index.exp Message-ID: <20210527132656.GA3354@delia.home> 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, When running these two test-cases in this specific order we get: ... $ make check 'RUNTESTFLAGS=gdb.dwarf2/gdb-index.exp \ gdb.dwarf2/gdb-add-index-symlink.exp' ... Running gdb.dwarf2/gdb-index.exp ... Running gdb.dwarf2/gdb-add-index-symlink.exp ... FAIL: gdb.dwarf2/gdb-add-index-symlink.exp: gdb-index file created FAIL: gdb.dwarf2/gdb-add-index-symlink.exp: Unable to call \ gdb-add-index with a symlink to a symfile ... The problem is that gdb-index.exp introduces a proc add_gdb_index which overrides the one in lib/gdb.exp and stays active after the test is done. Consequently it's used in gdb-add-index-symlink.exp, which should use the one from lib/gdb.exp. Fix this by renaming proc add_gdb_index in gdb-index.exp. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Prevent proc override in gdb-index.exp gdb/testsuite/ChangeLog: 2021-05-27 Tom de Vries PR testsuite/27921 * gdb.dwarf2/gdb-index.exp (add_gdb_index): Rename to ... (local_add_gdb_index): ... this. --- gdb/testsuite/gdb.dwarf2/gdb-index.exp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp index 3807c75294f..0b7adb5379d 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp @@ -31,8 +31,9 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \ # PROGRAM is assumed to be the output of standard_output_file. # Returns the path of the program or "" if there is a failure. # If there is a failure it will have already been logged. +# Use local prefix to prevent overriding add_gdb_index from lib/gdb.exp. -proc add_gdb_index { program } { +proc local_add_gdb_index { program } { set index_file ${program}.gdb-index set dir [file dirname ${program}] set filename [file tail ${program}] @@ -90,7 +91,7 @@ gdb_test_multiple "mt print objfiles ${testfile}" $test { set binfile_with_index $binfile } -re "Psymtabs.*${gdb_prompt} $" { - set binfile_with_index [add_gdb_index $binfile] + set binfile_with_index [local_add_gdb_index $binfile] if { ${binfile_with_index} == "" } { return -1 }