public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed][testsuite] Fix tcl error in dwz-tests.exp
@ 2021-02-09 22:41 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-02-09 22:41 UTC (permalink / raw)
  To: dwz, jakub

Hi,

When running:
...
$ make check CC="clang -gdwarf-5"
...
I run into:
...
ERROR: tcl error sourcing testsuite/dwz.tests/dwz-tests.exp.
ERROR: 2
readelf: Warning: DIE at offset 0xe6 refers to abbreviation number 8 \
  which does not exist while executing
"exec readelf -wi min | grep DW_AT_name | grep -c / "
...

Fix this by wrapping the exec in a catch.

Committed to trunk.

Thanks,
- Tom

[testsuite] Fix tcl error in dwz-tests.exp

2021-02-09  Tom de Vries  <tdevries@suse.de>

	* testsuite/dwz.tests/dwz-tests.exp: Wrap "exec readelf" in catch.

---
 testsuite/dwz.tests/dwz-tests.exp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/testsuite/dwz.tests/dwz-tests.exp b/testsuite/dwz.tests/dwz-tests.exp
index 2e5d19a..48c0015 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -24,11 +24,16 @@ foreach test $tests {
 	lappend required_execs "py-section-script"
     }
     if { $basename == "pr24341.sh" } {
-	# The exec min is used for the regression test for pr24341, but it only
-	# functions as such if the DWARF only contains the CUs of the test-case
-	# itself.
-	set matches [exec readelf -wi min | grep DW_AT_name | grep -c / ]
+	if { [catch {exec readelf -wi min | grep DW_AT_name | grep -c / } matches] } {
+	    # Some error occurred in the supported test, f.i. DWARF in min
+	    # unsupported by readelf.
+	    unsupported "$test"
+	    continue
+	}
 	if { $matches != 2 } {
+	    # The exec min is used for the regression test for pr24341, but it
+	    # only functions as such if the DWARF only contains the CUs of the
+	    # test-case itself.
 	    unsupported "$test"
 	    continue
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-09 22:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 22:41 [committed][testsuite] Fix tcl error in dwz-tests.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).