Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package dwz for openSUSE:Factory checked in 
at 2025-03-05 13:38:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dwz (Old)
 and      /work/SRC/openSUSE:Factory/.dwz.new.19136 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dwz"

Wed Mar  5 13:38:04 2025 rev:25 rq:1250002 version:0.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/dwz/dwz.changes  2025-01-31 16:01:54.773854385 
+0100
+++ /work/SRC/openSUSE:Factory/.dwz.new.19136/dwz.changes       2025-03-05 
13:38:06.302471149 +0100
@@ -1,0 +2,11 @@
+Tue Mar  4 08:30:59 UTC 2025 - Tom de Vries <[email protected]>
+
+- Add patch (backport from upstream trunk):
+  * dwz-add-support-for-version-9-gdb-index.patch
+  * dwz-make-dejagnu-logs-more-elaborate.patch
+  * dwz-make-dejagnu-test-names-environment-insensitive.patch
+  * dwz-testsuite-fix-finding-gdb-without-which.patch
+- Drop patch:
+  * dwz-remove-odr-struct-multifile.sh.patch
+
+-------------------------------------------------------------------

Old:
----
  dwz-remove-odr-struct-multifile.sh.patch

New:
----
  dwz-add-support-for-version-9-gdb-index.patch
  dwz-make-dejagnu-logs-more-elaborate.patch
  dwz-make-dejagnu-test-names-environment-insensitive.patch
  dwz-testsuite-fix-finding-gdb-without-which.patch

BETA DEBUG BEGIN:
  Old:- Drop patch:
  * dwz-remove-odr-struct-multifile.sh.patch
BETA DEBUG END:

BETA DEBUG BEGIN:
  New:- Add patch (backport from upstream trunk):
  * dwz-add-support-for-version-9-gdb-index.patch
  * dwz-make-dejagnu-logs-more-elaborate.patch
  New:  * dwz-add-support-for-version-9-gdb-index.patch
  * dwz-make-dejagnu-logs-more-elaborate.patch
  * dwz-make-dejagnu-test-names-environment-insensitive.patch
  New:  * dwz-make-dejagnu-logs-more-elaborate.patch
  * dwz-make-dejagnu-test-names-environment-insensitive.patch
  * dwz-testsuite-fix-finding-gdb-without-which.patch
  New:  * dwz-make-dejagnu-test-names-environment-insensitive.patch
  * dwz-testsuite-fix-finding-gdb-without-which.patch
- Drop patch:
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dwz.spec ++++++
--- /var/tmp/diff_new_pack.J5dwBf/_old  2025-03-05 13:38:07.566524175 +0100
+++ /var/tmp/diff_new_pack.J5dwBf/_new  2025-03-05 13:38:07.570524343 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package dwz
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -80,7 +80,10 @@
 Source2:        tramp3d-v4.cpp.xz
 
 Patch1:         dwz-enable-odr-by-default.patch
-Patch2:         dwz-remove-odr-struct-multifile.sh.patch
+Patch3:         dwz-make-dejagnu-logs-more-elaborate.patch
+Patch4:         dwz-make-dejagnu-test-names-environment-insensitive.patch
+Patch5:         dwz-testsuite-fix-finding-gdb-without-which.patch
+Patch6:         dwz-add-support-for-version-9-gdb-index.patch
 
 %if %{build_main}
 %description

++++++ dwz-add-support-for-version-9-gdb-index.patch ++++++
>From 1ae37f476bc6c9f7a756fee4830766f03600866c Mon Sep 17 00:00:00 2001
From: Mark Wielaard <[email protected]>
Date: Wed, 2 Oct 2024 23:20:57 +0200
Subject: [PATCH 4/4] Add support for version 9 .gdb_index

Version 9 .gdb_index adds a new shortcut table. The table itself is
just two offset_type values (2 * 4 bytes) describing the language of
the main function expresses as an DW_LANG_ constant and the offset of
the main function's name in the constant pool.

The offset to the shortcut table in the header is between the symbol
table and constant pool offsets.

write_gdb_index explicitly copies the function's name into the new
constant pool (if lang is not zero) because it might not be an offset
to an existing name of a symbol.

Some extra checks and warnings have been added to let the user know
when parsing the .gdb_index fails. Add a const char *file argument to
write_gdb_index for better error reporting.

Add -D_GNU_SOURCE to Makefile CFLAGS_COMMON to use memrchr.

This fixes the gdb-add-index.sh testcase with gdb 15+.

https://sourceware.org/bugzilla/show_bug.cgi?id=32146
---
 Makefile |   2 +-
 dwz.c    | 180 +++++++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 144 insertions(+), 38 deletions(-)

diff --git a/Makefile b/Makefile
index 8b7cf76..3dc6c6f 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ CFLAGS = -O2 -g
 DWZ_VERSION := $(shell cat $(srcdir)/VERSION)
 CFLAGS_VERSION = -DDWZ_VERSION='"$(DWZ_VERSION)"'
 CFLAGS_COPYRIGHT = $(shell cat $(srcdir)/COPYRIGHT_YEARS)
-CFLAGS_COMMON = -Wall -W -D_FILE_OFFSET_BITS=64
+CFLAGS_COMMON = -Wall -W -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 XXH_PROG = "\#define XXH_INLINE_ALL 1\n\#include <xxhash.h>\n"
 XXH_INLINE_ALL_WORKS = $(shell printf $(XXH_PROG) \
                | $(CC) -xc -c - -o /dev/null 2>/dev/null \
diff --git a/dwz.c b/dwz.c
index 3bc6038..da4121f 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1,6 +1,7 @@
 /* Copyright (C) 2001-2021 Red Hat, Inc.
    Copyright (C) 2003 Free Software Foundation, Inc.
    Copyright (C) 2019-2021 SUSE LLC.
+   Copyright (C) 2024 Mark J. Wielaard <[email protected]>
    Written by Jakub Jelinek <[email protected]>, 2012.
 
    This program is free software; you can redistribute it and/or modify
@@ -13222,12 +13223,13 @@ gdb_index_tu_cmp (const void *p, const void *q)
 /* Construct new .gdb_index section in malloced memory
    if it needs adjustment.  */
 static void
-write_gdb_index (void)
+write_gdb_index (const char *file)
 {
   dw_cu_ref cu, cu_next, first_tu = NULL;
-  unsigned char *gdb_index, *ptr, *inptr, *end;
+  unsigned char *gdb_index, *ptr, *inptr, *end, *conststart;
   unsigned int ncus = 0, npus = 0, ntus = 0, ndelcus = 0, ver;
   unsigned int culistoff, cutypesoff, addressoff, symboloff, constoff;
+  unsigned int headersize, shortcutoff, nextoff;
   unsigned int *tuindices = NULL, tuidx = 0, *cumap = NULL, i, j, k;
   bool fail = false;
 
@@ -13235,14 +13237,27 @@ write_gdb_index (void)
   if (likely (!op_multifile)
       && (debug_sections[GDB_INDEX].data == NULL
          || debug_sections[GDB_INDEX].size < 0x18))
-    return;
+    {
+      if (file && debug_sections[GDB_INDEX].data != NULL)
+       error (0, 0, "%s: .gdb_index too small 0x%zx", file,
+              debug_sections[GDB_INDEX].size);
+      return;
+    }
   inptr = (unsigned char *) debug_sections[GDB_INDEX].data;
   if (unlikely (op_multifile))
     ver = multi_gdb_index_ver;
   else
     ver = buf_read_ule32 (inptr);
-  if (ver < 4 || ver > 8)
-    return;
+  if (ver < 4 || ver > 9)
+    {
+      if (file)
+       error (0, 0, "%s: Unknown .gdb_index section version 0x%x", file, ver);
+      return;
+    }
+
+  /* Version 9 added a shortcut table offset (4 bytes) between the
+     address and symbol table offsets.  */
+  headersize = ver < 9 ? 0x18 : 0x1c;
 
   for (cu = first_cu; cu; cu = cu->cu_next)
     if (cu->cu_kind == CU_PU)
@@ -13259,25 +13274,38 @@ write_gdb_index (void)
   /* Starting with version 7 CU indexes are limited to 24 bits,
      so if we have more CUs, give up.  */
   if (npus + ncus + ntus - ndelcus >= (1U << 24))
-    return;
+    {
+      if (file)
+       error (0, 0, "%s: Cannot write %u CUs to .gdb_index",
+              file, npus + ncus + ntus - ndelcus);
+      return;
+    }
 
   if (unlikely (op_multifile))
     {
       assert (ncus == 0 && ntus == 0);
+      /* Version 9 index contain an (empty) shortcut table of 2 32bit
+        entries (8 byte).  */
       debug_sections[GDB_INDEX].new_size
-       = 0x18 + npus * 16 + 16;
+       = headersize + npus * 16 + 16 + (ver >= 9 ? 8 : 0);
       gdb_index = malloc (debug_sections[GDB_INDEX].new_size);
       if (gdb_index == NULL)
        dwz_oom ();
       debug_sections[GDB_INDEX].new_data = gdb_index;
       /* Write new header.  */
       buf_write_le32 (gdb_index + 0x00, ver);
-      buf_write_le32 (gdb_index + 0x04, 0x18);
-      buf_write_le32 (gdb_index + 0x08, 0x18 + npus * 16);
-      buf_write_le32 (gdb_index + 0x0c, 0x18 + npus * 16);
-      buf_write_le32 (gdb_index + 0x10, 0x18 + npus * 16);
-      buf_write_le32 (gdb_index + 0x14, 0x18 + npus * 16 + 16);
-      ptr = gdb_index + 0x18;
+      buf_write_le32 (gdb_index + 0x04, headersize);
+      buf_write_le32 (gdb_index + 0x08, headersize + npus * 16);
+      buf_write_le32 (gdb_index + 0x0c, headersize + npus * 16);
+      buf_write_le32 (gdb_index + 0x10, headersize + npus * 16);
+      if (ver >= 9)
+       {
+         buf_write_le32 (gdb_index + 0x14, headersize + npus * 16 + 16);
+         buf_write_le32 (gdb_index + 0x18, headersize + npus * 16 + 16 + 8);
+       }
+      else
+       buf_write_le32 (gdb_index + 0x14, headersize + npus * 16 + 16);
+      ptr = gdb_index + headersize;
       /* Write new CU list.  */
       for (cu = first_cu; cu; cu = cu->cu_next)
        {
@@ -13290,6 +13318,10 @@ write_gdb_index (void)
        }
       /* Write an empty hash table (with two entries).  */
       memset (ptr, '\0', 16);
+      /* Write an empty shortcut table (two zero offset types,
+        indicating no main function or language).  */
+      if (ver >= 9)
+       memset (ptr + 16, '\0', 8);
       return;
     }
 
@@ -13297,18 +13329,34 @@ write_gdb_index (void)
   cutypesoff = buf_read_ule32 (inptr + 0x08);
   addressoff = buf_read_ule32 (inptr + 0x0c);
   symboloff = buf_read_ule32 (inptr + 0x10);
-  constoff = buf_read_ule32 (inptr + 0x14);
-  if (culistoff != 0x18
-      || cutypesoff != 0x18 + ncus * 16
+  if (ver >= 9)
+    {
+      shortcutoff = buf_read_ule32 (inptr + 0x14);
+      constoff = buf_read_ule32 (inptr + 0x18);
+      nextoff = shortcutoff;
+    }
+  else
+    {
+      shortcutoff = 0;
+      constoff = buf_read_ule32 (inptr + 0x14);
+      nextoff = constoff;
+    }
+
+  if (culistoff != headersize
+      || cutypesoff != headersize + ncus * 16
       || addressoff != cutypesoff + ntus * 24
       || symboloff < addressoff
       || ((symboloff - addressoff) % 20) != 0
-      || constoff < symboloff
-      || ((constoff - symboloff) & (constoff - symboloff - 1)) != 0
-      || ((constoff - symboloff) & 7) != 0
+      || nextoff < symboloff
+      || ((nextoff - symboloff) & (nextoff - symboloff - 1)) != 0
+      || ((nextoff - symboloff) & 7) != 0
       || debug_sections[GDB_INDEX].size < constoff)
-    return;
-  inptr += 0x18;
+    {
+      if (file)
+       error (0, 0, "%s: Unexpected offsets in .gdb_index", file);
+      return;
+    }
+  inptr += headersize;
   if (ndelcus)
     cumap = (unsigned int *)
            obstack_alloc (&ob2, ncus * sizeof (unsigned int));
@@ -13319,6 +13367,8 @@ write_gdb_index (void)
          {
            if (cumap)
              obstack_free (&ob2, (void *) cumap);
+           if (file)
+             error (0, 0, "%s: unexpected cu cu_offset in .gdb_index", file);
            return;
          }
        inptr += 16;
@@ -13353,6 +13403,8 @@ write_gdb_index (void)
              obstack_free (&ob2, (void *) cumap);
            else
              obstack_free (&ob2, (void *) tuindices);
+           if (file)
+             error (0, 0, "%s: unexpected tui cu_offset in .gdb_index", file);
            return;
          }
     }
@@ -13375,8 +13427,16 @@ write_gdb_index (void)
   buf_write_le32 (gdb_index + 0x08, cutypesoff + npus * 16 - ndelcus * 16);
   buf_write_le32 (gdb_index + 0x0c, addressoff + npus * 16 - ndelcus * 16);
   buf_write_le32 (gdb_index + 0x10, symboloff + npus * 16 - ndelcus * 16);
-  buf_write_le32 (gdb_index + 0x14, constoff + npus * 16 - ndelcus * 16);
-  ptr = gdb_index + 0x18;
+  if (ver >= 9)
+    {
+      buf_write_le32 (gdb_index + 0x14,
+                     shortcutoff + npus * 16 - ndelcus * 16);
+      buf_write_le32 (gdb_index + 0x18,
+                     constoff + npus * 16 - ndelcus * 16);
+    }
+  else
+    buf_write_le32 (gdb_index + 0x14, constoff + npus * 16 - ndelcus * 16);
+  ptr = gdb_index + headersize;
   /* Write new CU list.  */
   for (cu = first_cu; cu; cu = cu_next)
     {
@@ -13434,12 +13494,43 @@ write_gdb_index (void)
       inptr += 20;
     }
   /* Copy the symbol hash table.  */
-  memcpy (ptr, inptr, constoff - symboloff);
+  memcpy (ptr, inptr, nextoff - symboloff);
   /* Clear the const pool initially.  */
-  memset (ptr + (constoff - symboloff), '\0',
+  memset (ptr + (nextoff - symboloff) + (ver < 9 ? 0 : 8), '\0',
          debug_sections[GDB_INDEX].size - constoff);
+  /* Copy the shortcut table.  */
+  if (ver >= 9)
+    {
+      unsigned char *inscptr = inptr + (nextoff - symboloff);
+      unsigned char *scptr = ptr + (nextoff - symboloff);
+      uint32_t lang = buf_read_ule32 (inscptr);
+      uint32_t name = buf_read_ule32 (inscptr + 4);
+      buf_write_le32 (scptr, lang);
+      buf_write_le32 (scptr + 4, name);
+
+      /* If lang is not zero then put the name in the const table, it
+        might not be an offset to the name of a symbol.  */
+      if (lang != 0)
+       {
+         if (name > debug_sections[GDB_INDEX].size - constoff - 1
+             || memrchr (debug_sections[GDB_INDEX].data
+                         + debug_sections[GDB_INDEX].size, '\0',
+                         debug_sections[GDB_INDEX].size
+                         - constoff - name) == NULL)
+           {
+             error (0, 0, "%s: bad shortcut table name in .gdb_index", file);
+             goto fail;
+           }
+         strcpy ((char *) ptr + (constoff - symboloff) + name,
+                 (char *) inptr + (constoff - symboloff) + name);
+       }
+    }
   ptr = ptr + (constoff - symboloff);
-  end = inptr + (constoff - symboloff);
+  end = inptr + (nextoff - symboloff);
+  if (ver >= 9)
+    conststart = end + (constoff - nextoff);
+  else
+    conststart = end;
   /* Finally copy over const objects into the const pool, strings as is,
      CU vectors with CU indexes adjusted.  */
   while (inptr < end)
@@ -13450,9 +13541,11 @@ write_gdb_index (void)
       inptr += 8;
       if (name == 0 && cuvec == 0)
        continue;
-      if (name > debug_sections[GDB_INDEX].size - constoff - 1
-         || cuvec > debug_sections[GDB_INDEX].size - constoff - 4)
+      if (name > debug_sections[GDB_INDEX].size - nextoff - 1
+         || cuvec > debug_sections[GDB_INDEX].size - nextoff - 4)
        {
+         if (file)
+           error (0, 0, "%s: name or cuvec too large in .gdb_index", file);
        fail:
          free (gdb_index);
          debug_sections[GDB_INDEX].new_size = 0;
@@ -13460,26 +13553,36 @@ write_gdb_index (void)
        }
       if (ptr[name] == '\0')
        {
-         unsigned char *strend = end + name;
+         unsigned char *strend = conststart + name;
          while (*strend != '\0')
            {
              if (strend + 1
-                 == end + (debug_sections[GDB_INDEX].size - constoff))
-               goto fail;
+                 == conststart + (debug_sections[GDB_INDEX].size - constoff))
+               {
+                 if (file)
+                   error (0, 0, "%s: name too large in .gdb_index", file);
+                 goto fail;
+               }
              strend++;
            }
-         memcpy (ptr + name, end + name, strend + 1 - (end + name));
+         memcpy (ptr + name, conststart + name,
+                 strend + 1 - (conststart + name));
        }
       if (buf_read_ule32 (ptr + cuvec) == 0)
        {
-         unsigned int count = buf_read_ule32 (end + cuvec);
+         unsigned int count = buf_read_ule32 (conststart + cuvec);
          if (count * 4
              > debug_sections[GDB_INDEX].size - constoff - cuvec - 4)
-           goto fail;
+           {
+             if (file)
+               error (0, 0, "%s: count (%u) too large in .gdb_index",
+                      file, count);
+             goto fail;
+           }
          buf_write_le32 (ptr + cuvec, count);
          for (i = 0; i < count; i++)
            {
-             j = buf_read_ule32 (end + cuvec + (i + 1) * 4);
+             j = buf_read_ule32 (conststart + cuvec + (i + 1) * 4);
              if (ver >= 7)
                k = j & ((1U << 24) - 1);
              else
@@ -13506,6 +13609,9 @@ write_gdb_index (void)
     obstack_free (&ob2, (void *) tuindices);
   if (fail)
     {
+      if (file)
+       error (0, 0, "%s: fail in .gdb_index", file);
+
       free (debug_sections[GDB_INDEX].new_data);
       debug_sections[GDB_INDEX].new_data = NULL;
       debug_sections[GDB_INDEX].new_size = 0;
@@ -15549,7 +15655,7 @@ dwz (const char *file, const char *outfile, struct 
file_result *res)
              report_progress ();
              fprintf (stderr, "write_gdb_index\n");
            }
-         write_gdb_index ();
+         write_gdb_index (file);
          /* These sections are optional and it is unclear
             how to adjust them.  Just remove them.  */
          debug_sections[DEBUG_PUBNAMES].new_data = NULL;
@@ -15808,7 +15914,7 @@ optimize_multifile (unsigned int *die_count)
 
          write_abbrev ();
          write_info (die_count);
-         write_gdb_index ();
+         write_gdb_index (NULL);
          if (write_multifile_line ())
            goto fail;
        }
-- 
2.43.0


++++++ dwz-make-dejagnu-logs-more-elaborate.patch ++++++
>From 5ae6047adef9648f50e007b23df09d38de5e0729 Mon Sep 17 00:00:00 2001
From: "Frank Ch. Eigler" <[email protected]>
Date: Sat, 18 Feb 2023 12:36:15 +0100
Subject: [PATCH 1/4] make dejagnu logs more elaborate

dwz-tests.exp produces totally barebones dwz.log files, basically
duplicating the .sum file.  If there are any errors, there's
basically no info to go on.

The patch runs the .sh subtests in -x trace mode, and logs
stdout/stderr to the .log file, so e.g. bunsen can safe-keep it.
Otherwise I believe no-op.
---
 testsuite/dwz.tests/dwz-tests.exp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testsuite/dwz.tests/dwz-tests.exp 
b/testsuite/dwz.tests/dwz-tests.exp
index 811767f..85e6fcd 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -116,16 +116,17 @@ foreach test $tests {
     exec mkdir $dir
 
     cd $dir
-    if { [catch { exec sh -e $test } msg] } {
+    if { [catch { exec sh -x -e $test 2>@1 } msg] } {
+        verbose -log "$msg"
        if { [lindex $::errorCode 0] == "CHILDSTATUS" && \
                 [lindex $::errorCode 2] == 77 } {
            unsupported "$test"
            exec rm -Rf $dir
        } else {
-           puts "$msg"
            fail "$test"
        }
     } else {
+        verbose -log "$msg"
        if { [file exists dwz.info ] } {
            set info [exec cat dwz.info]
            verbose -log "$test:" 1
-- 
2.43.0


++++++ dwz-make-dejagnu-test-names-environment-insensitive.patch ++++++
>From 9621200e66f0339da5a80e1abf46f4789a4a3690 Mon Sep 17 00:00:00 2001
From: "Frank Ch. Eigler" <[email protected]>
Date: Wed, 1 Mar 2023 16:51:58 +0100
Subject: [PATCH 2/4] make dejagnu test names environment-insensitive

Previous versions of dwz-tests.exp emit the full path names to the
per-test .sh scripts into the .sum/.log files.  This version replaces
those patn names with just the $basename, which is enough to identify
the tests uniquely, and allows proper regression/comparison analysis.

https://sourceware.org/bugzilla/show_bug.cgi?id=30182
---
 testsuite/dwz.tests/dwz-tests.exp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/testsuite/dwz.tests/dwz-tests.exp 
b/testsuite/dwz.tests/dwz-tests.exp
index 85e6fcd..20affea 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -27,20 +27,20 @@ foreach test $tests {
        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"
+           unsupported $basename
            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"
+           unsupported $basename
            continue
        }
     }
     if { $basename == "pr24172.sh" } {
        if { ![istarget x86_64-*-*] } {
-           unsupported "$test"
+           unsupported $basename
            continue
        }
        lappend required_execs "dw2-skip-prologue"
@@ -62,17 +62,17 @@ foreach test $tests {
     }
     if { ![istarget x86_64-*-*] } {
        if { $basename == "pr24468.sh" } {
-           unsupported "$test"
+           unsupported $basename
            continue
        }
        if { $basename == "ld-2.26.1-multifile.sh" } {
-           unsupported "$test"
+           unsupported $basename
            continue
        }
     }
     if { $basename == "gdb-add-index.sh" } {
         if { [catch { exec which gdb-add-index } ] } {
-            unsupported "$test"
+            unsupported $basename
             continue
         }
     }
@@ -82,7 +82,7 @@ foreach test $tests {
        if { $basename == "eu-strip-unstrip.sh" || \
                 $basename == "eu-strip-unstrip-multifile.sh" || \
                 $basename == "pr24173.sh" } {
-           unsupported "$test"
+           unsupported $basename
            continue
        }
     }
@@ -107,7 +107,7 @@ foreach test $tests {
        }
     }
     if { $unsupported == 1 } {
-       unsupported "$test"
+       unsupported $basename
        continue
     }
 
@@ -120,10 +120,10 @@ foreach test $tests {
         verbose -log "$msg"
        if { [lindex $::errorCode 0] == "CHILDSTATUS" && \
                 [lindex $::errorCode 2] == 77 } {
-           unsupported "$test"
+           unsupported $basename
            exec rm -Rf $dir
        } else {
-           fail "$test"
+           fail $basename
        }
     } else {
         verbose -log "$msg"
@@ -136,9 +136,9 @@ foreach test $tests {
        set file_list [glob -nocomplain "$dir/*"]
        if {[llength $file_list] != 0} {
            puts "$dir is not empty"
-           fail "$test"
+           fail $basename
        } else {
-           pass "$test"
+           pass $basename
            exec rm -Rf $dir
        }
     }
-- 
2.43.0


++++++ dwz-testsuite-fix-finding-gdb-without-which.patch ++++++
>From 0171f3e7ac09fa44cb1eb299f2703faa113a207e Mon Sep 17 00:00:00 2001
From: Sam James <[email protected]>
Date: Sat, 27 Jul 2024 15:07:56 +0100
Subject: [PATCH 3/4] testsuite: fix finding gdb without `which`

which isn't considered portable. Some Linux distributions like Debian and
Gentoo are seeking to remove it from their base set of packages [0].

Use POSIX's `command -v` instead.

[0] https://lwn.net/Articles/874049/
---
 testsuite/dwz.tests/dwz-tests.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/dwz.tests/dwz-tests.exp 
b/testsuite/dwz.tests/dwz-tests.exp
index 20affea..8e407d4 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -71,7 +71,7 @@ foreach test $tests {
        }
     }
     if { $basename == "gdb-add-index.sh" } {
-        if { [catch { exec which gdb-add-index } ] } {
+        if { [catch { exec sh -c "command -v gdb-add-index" } ] } {
             unsupported $basename
             continue
         }
-- 
2.43.0

Reply via email to