From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id A1A37385AC3C for ; Wed, 19 Oct 2022 09:02:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1A37385AC3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x435.google.com with SMTP id m6so16665713pfb.0 for ; Wed, 19 Oct 2022 02:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FUMJCMxOWeXy6oc3DIo9pyalEjZ0JXdnTcf6CU4Dzqo=; b=PW2FZVeU4EtXBxxMplsr+ZA294Af1eAR4FX4+HkJMZGkxnSnK+c4iu1yPrELgkeWxz ef9V/CwUmg3J47VRFC2lPWma2qZA19B1GJjZ4Kop5WMglsBVOoABCAK6JOEgVxdnl/UK 6kRmcUZ1r77yQbGIgNCghC0J4HXf3dJtm0IKqgRV09CEUAPIND6NOhXxifdN/B6tm4TT sMpMgSiqLdDDZWkKIP1l8K7/eon2oaNywiO79sBEZOtgYXvcMaduKG8fNhjV6y/HiQoP J6saCsi2FtgdVg5lC/bKUEb3V37BvdbvtK2+6woMXV5EXk50+IlOMdppL122x4aQCx6E RpoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FUMJCMxOWeXy6oc3DIo9pyalEjZ0JXdnTcf6CU4Dzqo=; b=WaZRaXmotSdz7I5EBxVJS9XN/8zam0f78+cBm/YjIjCPoGHlXxKIc1o0wCZHkjaarJ 7BPSUfjHeIRFtElT5L9pkjbW1bEA6LUk8U9PrTwqkzSwJg26ZxzAmQx5XvzvicVG1Q5K yNBdSDkatLnc5/mxa4mKy16g4PpBf+bi10cZMQWjb9M1Dhc72zaaHO7BNXSq+ycuAUsw H+a0ODJpCIkmK+0wPFjWe+sFSOw3QQz5pqaEZFIvajWIdXRCx+EZKNoPBdZhAUetfqMI IaMNat+VPZ7TN35mVG24pn+eGxMwKwcWHbUw56Ha306TMm9h2tx08dVaFTv2BnUkeD8t fU7w== X-Gm-Message-State: ACrzQf3ZUJshon192Gg4NrNFHkpJXrIolSM5+h24qMpx1pAAcpjcAfBh ti/Bk3WaT53sBmnvM3ibkrOces00fPc= X-Google-Smtp-Source: AMsMyM65kBAJmybIN2+Ve8k8t2ZPmbXJAzmdcenD67fZm/Tiq3PJKL+YGgbusuShik2AKh915IoCLA== X-Received: by 2002:a63:6a09:0:b0:43a:20d4:85fe with SMTP id f9-20020a636a09000000b0043a20d485femr6161094pgc.625.1666170164525; Wed, 19 Oct 2022 02:02:44 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:1cc1:f0c0:dfa1:b903]) by smtp.gmail.com with ESMTPSA id i17-20020a056a00005100b0053e4baecc14sm10913669pfk.108.2022.10.19.02.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 02:02:42 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 145E21142370; Wed, 19 Oct 2022 19:32:40 +1030 (ACDT) Date: Wed, 19 Oct 2022 19:32:40 +1030 From: Alan Modra To: Tom de Vries Cc: rupesh potharla , Binutils Subject: Re: =?utf-8?Q?=E2=98=A0_Buildbot_=28GN?= =?utf-8?Q?U?= Toolchain): binutils-gdb - failed test (failure) (master) Message-ID: References: <20221019073533.3F8543858D3C@sourceware.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3035.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Wed, Oct 19, 2022 at 09:55:59AM +0200, Tom de Vries via Binutils wrote: > looks like this: > ... > regexp -line {^([0-9a-fA-F]+)?[ ]+T main} $output contents > set list [regexp -inline -all -- {\S+} $contents] > ... > is causing: > ... > ERROR: tcl error sourcing /var/lib/buildbot/workers/wildebeest/binutils-debian-ppc64/binutils-gdb/binutils/testsuite/binutils-all/addr2line.exp. > ERROR: tcl error code TCL LOOKUP VARNAME contents > ERROR: can't read "contents": no such variable > while executing > "regexp -inline -all -- {\S+} $contents" > (file "/var/lib/buildbot/workers/wildebeest/binutils-debian-ppc64/binutils-gdb/binutils/testsuite/binutils-all/addr2line.exp" > line 31) > invoked from within > ... > > If the regexp doesn't match, contents is not set. Right. It doesn't match for PowerPC64 ELFv1 because function symbols are defined on a descriptor and are flagged as "D" not "T". The test also fails on cygwin/mingw where the compiler output is testprog.exe. I think the following will do the trick, I'll commit after a full test run. diff --git a/binutils/testsuite/binutils-all/addr2line.exp b/binutils/testsuite/binutils-all/addr2line.exp index 15e60366ac2..c37b8b9cdc6 100644 --- a/binutils/testsuite/binutils-all/addr2line.exp +++ b/binutils/testsuite/binutils-all/addr2line.exp @@ -24,35 +24,43 @@ if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog executable debug return } +set exe [exeext] + #testcase for default option. #Run nm command and input the main symbol address to addr2line. -set output [binutils_run $NM "tmpdir/testprog"] -regexp -line {^([0-9a-fA-F]+)?[ ]+T main} $output contents -set list [regexp -inline -all -- {\S+} $contents] -set got [binutils_run $ADDR2LINE "-e tmpdir/testprog [lindex $list 0]"] -set want "$srcdir/$subdir/testprog.c:\[0-9\]+" -if ![regexp $want $got] then { - fail "$testname $got\n" +set output [binutils_run $NM "tmpdir/testprog$exe"] +if ![regexp -line {^([0-9a-fA-F]+)?[ ]+[TD] main} $output contents] then { + fail "$testname" } else { - pass "$testname" + set list [regexp -inline -all -- {\S+} $contents] + set got [binutils_run $ADDR2LINE "-e tmpdir/testprog$exe [lindex $list 0]"] + set want "$srcdir/$subdir/testprog.c:\[0-9\]+" + if ![regexp $want $got] then { + fail "$testname $got\n" + } else { + pass "$testname" + } } #testcase for -f option. #Run nm command and input the fn function symbol address to addr2line. -regexp -line {^([0-9a-fA-F]+)?[ ]+T fn} $output contents -pass "output is $output \n contents is $contents\n" -set list [regexp -inline -all -- {\S+} $contents] -set got [binutils_run $ADDR2LINE "-f -e tmpdir/testprog [lindex $list 0]"] -set want "fn\n$srcdir/$subdir/testprog.c:\[0-9\]+" -if ![regexp $want $got] then { - fail "$testname -f option $got\n" +if ![regexp -line {^([0-9a-fA-F]+)?[ ]+[TD] fn} $output contents] then { + fail "$testname -f option" } else { - pass "$testname -f option" + pass "output is $output \n contents is $contents\n" + set list [regexp -inline -all -- {\S+} $contents] + set got [binutils_run $ADDR2LINE "-f -e tmpdir/testprog$exe [lindex $list 0]"] + set want "fn\n$srcdir/$subdir/testprog.c:\[0-9\]+" + if ![regexp $want $got] then { + fail "$testname -f option $got\n" + } else { + pass "$testname -f option" + } } #testcase for -s option. #Using the same fn function address used in -f option. -set got [binutils_run $ADDR2LINE "-s -e tmpdir/testprog [lindex $list 0]"] +set got [binutils_run $ADDR2LINE "-s -e tmpdir/testprog$exe [lindex $list 0]"] set want "testprog.c:\[0-9\]+" if ![regexp $want $got] then { fail "$testname -s option $got\n" -- Alan Modra Australia Development Lab, IBM