Compare commits

..

3 Commits
c10s ... c9s

Author SHA1 Message Date
Václav Kadlčík
a7af5e7ee3 Standardize tier0 testing
Drop unmaintained copy of downstream tests and re-use
centos-stream/tests/dwz.
2025-10-09 11:49:06 +02:00
Maciej W. Rozycki
2316c5161e 0.14-1 - Add support for version 9 .gdb_index
Resolves: RHEL-113936
2025-10-06 15:12:11 +01:00
Václav Kadlčík
56eaeb13aa Avoid rpminspect "specname" failures in gating
The spec filename (dwz.spec) does not exactly match the name of the
package (gcc-toolset-14-dwz) which with the default rpminspect
configuration leads to:

  The spec file name does not match the expected NAME.spec
  format. Rename the spec file to conform to this policy.

Let's add a piece of configuration for rpminspect that would accept
the difference.
2024-09-25 17:16:45 +02:00
12 changed files with 428 additions and 181 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

377
dwz-0.14-sw-pr-32146.patch Normal file
View File

@ -0,0 +1,377 @@
From 1ae37f476bc6c9f7a756fee4830766f03600866c Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Wed, 2 Oct 2024 23:20:57 +0200
Subject: [PATCH] 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
endif
CFLAGS = -O2 -g
DWZ_VERSION := $(shell cat $(srcdir)/VERSION)
-override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 \
+override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-DDWZ_VERSION='"$(DWZ_VERSION)"' $(shell cat $(srcdir)/COPYRIGHT_YEARS)
prefix = /usr
exec_prefix = $(prefix)
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 <mark@klomp.org>
Written by Jakub Jelinek <jakub@redhat.com>, 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.20.1

View File

@ -6,7 +6,7 @@ BuildRequires: scl-utils-build
Summary: DWARF optimization and duplicate removal tool
Name: %{?scl_prefix}dwz
Version: 0.14
Release: 0%{?dist}
Release: 1%{?dist}
License: GPLv2+ and GPLv3+
# git archive --format=tar --remote=git://sourceware.org/git/dwz.git \
# --prefix=dwz-%%{version}/ dwz-%%{version} \
@ -16,6 +16,9 @@ BuildRequires: gcc, gcc-c++, gdb, elfutils-libelf-devel, dejagnu
BuildRequires: make
%{?scl:Requires:%scl_runtime}
# Patches
Patch: dwz-0.14-sw-pr-32146.patch
%description
The dwz package contains a program that attempts to optimize DWARF
debugging information contained in ELF shared libraries and ELF executables
@ -26,7 +29,7 @@ DW_TAG_partial_unit compilation units (CUs) for duplicated information
and using DW_TAG_imported_unit to import it into each CU that needs it.
%prep
%setup -q -n dwz
%autosetup -p1 -n dwz
%build
%make_build CFLAGS='%{optflags}' LDFLAGS='%{build_ldflags}' \
@ -45,5 +48,8 @@ make check
%{_mandir}/man1/dwz.1*
%changelog
* Fri Oct 3 2025 Maciej W. Rozycki <macro@redhat.com> 0.14-1
- Add dwz-0.14-sw-pr-32146.patch
* Mon Apr 29 2024 Marek Polacek <polacek@redhat.com> 0.14-0
- new package (RHEL-29852)

32
plans/tier0.fmf Normal file
View File

@ -0,0 +1,32 @@
# Tier 0 test plan. It's actually Tier 1
# - limited to its public part
# - executed on the architecture at hand
# When run by osci.tier0 on CentOS Stream or RHEL, it receives the following
# context:
# arch=x86_64 (the architecture at hand, currently OSCI uses just x86_64)
# distro=rhel<M>.<m> (even for CentOS Stream builds)
# trigger=build
summary: Tier 0 test plan
context:
component: gcc-toolset-14-dwz
discover:
- name: collect_info
how: shell
tests:
- name: /info/rpms
test: rpm -qa --last
- name: public_tests
how: fmf
url: https://gitlab.com/redhat/centos-stream/tests/dwz.git
filter: tier:1
execute:
how: tmt
prepare+:
how: shell
script:
- dnf config-manager --set-enabled '*CRB*' || true
- dnf config-manager --set-enabled crb || true
environment+:
COLLECTIONS: gcc-toolset-14
WITH_SCL: "scl enable gcc-toolset-14"

10
rpminspect.yaml Normal file
View File

@ -0,0 +1,10 @@
runpath:
allowed_paths:
- /usr/lib64
specname:
# In GCC toolsets builds, the spec file name and the package are not
# exactly the same, the package is prefixed with gcc-toolset-NN-.
# Let's ignore the prefix in the specname test.
match: suffix
primary: filename

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/dwz/dwz-quick-test
# Description: Quick sanity test
# Author: Miroslav Franc <mfranc@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/dwz/dwz-quick-test
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE something.c cmd.txt
.PHONY: all install download clean
run: $(FILES) build
scl enable gcc-toolset-14 ./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Miroslav Franc <mfranc@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Quick sanity test" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 2m" >> $(METADATA)
@echo "RunFor: dwz" >> $(METADATA)
@echo "Requires: dwz gcc gdb glibc-debuginfo" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/dwz/dwz-quick-test
Description: Quick sanity test
Author: Miroslav Franc <mfranc@redhat.com>

View File

@ -1,7 +0,0 @@
b f
r
s
p x
p/x var
c
q

View File

@ -1,60 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/dwz/dwz-quick-test
# Description: Quick sanity test
# Author: Miroslav Franc <mfranc@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlAssertRpm gcc
rlAssertRpm gdb
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp something.c cmd.txt $TmpDir"
rlRun "pushd $TmpDir"
rlRun "gcc -g -O0 something.c -o something.out"
rlRun "cp something.out something.dwz"
rlPhaseEnd
rlPhaseStartTest "no crash + saved space"
rlRun "dwz something.dwz"
rlRun "[[ $(wc -c <something.out) -gt $(wc -c <something.dwz) ]]"
rlPhaseEnd
rlPhaseStartTest "can we debug it?"
rlRun "gdb -x cmd.txt -batch -q ./something.dwz > log 2>&1"
rlRun "[[ $(grep -c 'hello, world' log) -eq 2 ]]"
rlAssertGrep '$1 = -1' log
rlAssertGrep '$2 = 0x2a' log
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,21 +0,0 @@
#include <stdio.h>
void f (int x);
int
main (int argc, char *argv[])
{
int a = -1;
f(a);
return 0;
}
void
f (int x)
{
static int var __attribute__ ((used)) = 42;
if(x)
puts("hello, world");
}

View File

@ -1,4 +0,0 @@
#!/bin/bash
export TEST_DOCKER_EXTRA_ARGS="--cap-add=SYS_PTRACE"
exec merge-standard-inventory "$@"

View File

@ -1,21 +0,0 @@
- hosts: localhost
tags:
- classic
- container # needs SYS_PTRACE
pre_tasks:
- name: Install deguginfo-install
shell: dnf -y install "dnf-command(debuginfo-install)"
- name: Install debuginfo for packages
shell: dnf -y debuginfo-install --best {{item}}
with_items:
- glibc
roles:
- role: standard-test-beakerlib
tests:
- dwz-quick-test
required_packages:
- gcc-toolset-14-dwz
- gcc-toolset-14-runtime
- gcc
- gdb
- glibc-debuginfo