From 00c47a8576c7a691af08fbf136411b25054ccbd7b194409e089624439f48c39e Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 5 Nov 2021 20:33:16 +0000 Subject: [PATCH] - Patch added (move zypper hint test to testsuite): * gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=294 --- ...stsuite-add-gdb.suse-zypper-hint.exp.patch | 89 +++++++++++++++++++ gdb.changes | 6 ++ gdb.spec | 71 +-------------- qa.sh | 11 ++- 4 files changed, 107 insertions(+), 70 deletions(-) create mode 100644 gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch diff --git a/gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch b/gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch new file mode 100644 index 0000000..ef85ceb --- /dev/null +++ b/gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch @@ -0,0 +1,89 @@ +[gdb/testsuite] Add gdb.suse/zypper-hint.exp + +--- + gdb/testsuite/gdb.suse/zypper-hint.c | 25 +++++++++++++++++++ + gdb/testsuite/gdb.suse/zypper-hint.exp | 45 ++++++++++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+) + +diff --git a/gdb/testsuite/gdb.suse/zypper-hint.c b/gdb/testsuite/gdb.suse/zypper-hint.c +new file mode 100644 +index 00000000000..e179788f04f +--- /dev/null ++++ b/gdb/testsuite/gdb.suse/zypper-hint.c +@@ -0,0 +1,25 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2021 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ 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, see . */ ++ ++#include ++ ++int ++main (void) ++{ ++ printf ("hello\n"); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.suse/zypper-hint.exp b/gdb/testsuite/gdb.suse/zypper-hint.exp +new file mode 100644 +index 00000000000..a9dc84b96f2 +--- /dev/null ++++ b/gdb/testsuite/gdb.suse/zypper-hint.exp +@@ -0,0 +1,45 @@ ++# Copyright 2021 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# 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, see . ++ ++standard_testfile .c ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { ++ return -1 ++} ++ ++clean_restart ${binfile} ++ ++gdb_test_no_output "set build-id-verbose 1" ++ ++set test "zypper hint printed" ++if { ![gdb_breakpoint main qualified] } { ++ unresolved $test ++ return -1 ++} ++ ++gdb_run_cmd ++ ++set re_64 \ ++ "Missing separate debuginfos, use: zypper install glibc-debuginfo-" ++set re_32 \ ++ "Missing separate debuginfos, use: zypper install glibc-32bit-debuginfo-" ++gdb_test_multiple "" $test { ++ -re -wrap ($re_64|$re_32).* { ++ pass $gdb_test_name ++ } ++} ++ ++# To give some background information in case the previous test failed. ++gdb_test "info shared" diff --git a/gdb.changes b/gdb.changes index d25eb94..012a840 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 5 19:15:43 UTC 2021 - Tom de Vries + +- Patch added (move zypper hint test to testsuite): + * gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch + ------------------------------------------------------------------- Fri Nov 5 15:21:03 UTC 2021 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 0d049d3..1d82a8b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -273,6 +273,8 @@ Patch1101: gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch # It would be nice to upstream this, but in order to do that I'd like to have # an explanation of why this happens, so for now, park this here. Patch1102: gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch +# Tests the zypper install hints. +Patch1103: gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch # Patches to upstream @@ -728,6 +730,7 @@ find -name "*.info*"|xargs rm -f %patch1100 -p1 %patch1101 -p1 %patch1102 -p1 +%patch1103 -p1 %patch1500 -p1 %patch1501 -p1 @@ -1012,74 +1015,6 @@ then cd .. fi -# This is a build-time test, but still a test. So, skip if we don't do tests. -# This is relevant for %%qemu_user_space_build == 1 builds, which atm is -# the case for riscv64. -%if %{build_testsuite} -if [ "$LIBRPM" != "no" ]; then - cd gdb - cat \ - > hello.c \ - < -int -main (void) -{ - printf ("hello\n"); - return 0; -} -EOF - $CC hello.c - libc=$(ldd a.out \ - | grep libc.so \ - | awk '{print $3}') - if readelf -SW $libc \ - | grep -q "\.gnu_debuglink"; then - cat \ - > test.exp \ - <