From ff5514afc9c3e9a0ea76b5bcac70b4dc85ac91d7b7afe06e9dbc21e7a98ce280 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 1 Feb 2024 07:32:03 +0000 Subject: [PATCH] - Maintenance script qa.sh: * Add PR31214 kfail. * Add kfail for fails in gdb.reverse/solib-precsave.exp / gdb.reverse/solib-reverse.exp fixed by commit fe6356def67 ("PowerPC and aarch64: Fix reverse stepping failure"). * Extend PR31004 kfail. - Don't require %{python}-base for gdb-testresults package. - Fix debuginfod handling: * Enable for sle_version >= 150400 (bsc#1185605, jsc#PED-1149, jsc#PED-1138), SLE15-SP4 and later. * Enable for suse_version >= 1600, ALP and Tumbleweed. * Add back "BuildRequires: libdebuginfod1" to prevent selecting dummy variant. * Add "BuildRequires: debuginfod-client" to prevent unresolved due to conflict with dummy variant. * Add --with-debuginfod=yes to prevent silently dropping support. - Patches added (backport from master): * gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch * gdb-testsuite-remove-spurious-in-save_vars.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=375 --- ...d-missing-no-prompt-anchor-in-gdb.ba.patch | 45 ++++++++++++++++ ...stsuite-remove-spurious-in-save_vars.patch | 53 +++++++++++++++++++ gdb.changes | 23 ++++++++ gdb.spec | 25 ++++++++- qa.sh | 34 +++++++++++- 5 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch create mode 100644 gdb-testsuite-remove-spurious-in-save_vars.patch diff --git a/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch b/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch new file mode 100644 index 0000000..b2826a4 --- /dev/null +++ b/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch @@ -0,0 +1,45 @@ +From 08ce0d63c343f7db9a504d37de25391a997b46e2 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 8 Jan 2024 13:01:50 +0100 +Subject: [PATCH] [gdb/testsuite] Add missing -no-prompt-anchor in + gdb.base/vfork-follow-parent.exp + +When running test-case gdb.base/vfork-follow-parent.exp it passes fine, but +when running it with "taskset -c 0" I run into: +... +(gdb) inferior 1^M +[Switching to inferior 1 [process 26606] (vfork-follow-parent-exit)]^M +[Switching to thread 1.1 (process 26606)]^M +(gdb) Reading symbols from vfork-follow-parent-exit...^M +FAIL: $exp: exec_file=vfork-follow-parent-exit: target-non-stop=on: \ + non-stop=off: resolution_method=schedule-multiple: inferior 1 (timeout) +... + +Fix this by using -no-prompt-anchor. + +Tested on x86_64-linux. + +PR testsuite/31166 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31166 +--- + gdb/testsuite/gdb.base/vfork-follow-parent.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/vfork-follow-parent.exp b/gdb/testsuite/gdb.base/vfork-follow-parent.exp +index 89c38001dac..ee6f2835d8e 100644 +--- a/gdb/testsuite/gdb.base/vfork-follow-parent.exp ++++ b/gdb/testsuite/gdb.base/vfork-follow-parent.exp +@@ -64,7 +64,7 @@ proc do_test { resolution_method } { + gdb_test "set schedule-multiple on" + gdb_test "continue" "$::inferior_exited_re normally.*" \ + "continue to end of inferior 2" +- gdb_test "inferior 1" ".*Switching to inferior 1.*" ++ gdb_test -no-prompt-anchor "inferior 1" ".*Switching to inferior 1.*" + gdb_test "print unblock_parent = 1" " = 1" + } else { + error "invalid resolution method: $resolution_method" + +base-commit: 19185006cfe0901da907da4f09fbc197aba976a2 +-- +2.35.3 + diff --git a/gdb-testsuite-remove-spurious-in-save_vars.patch b/gdb-testsuite-remove-spurious-in-save_vars.patch new file mode 100644 index 0000000..63cdf99 --- /dev/null +++ b/gdb-testsuite-remove-spurious-in-save_vars.patch @@ -0,0 +1,53 @@ +From d3fbb4d91ba2784df267fe1ac2e9ec42581a6fac Mon Sep 17 00:00:00 2001 +From: Simon Marchi +Date: Mon, 15 Jan 2024 16:23:42 +0000 +Subject: [PATCH] gdb/testsuite: remove spurious $ in save_vars + +I noticed that running the whole testsuite in serial mode (which means +all the .exp files are ran in the same TCL environment, one after the +other) with the native-extended-gdbserver board caused some weird +failures, for instance a lot of internal errors in the reverse tests, +like: + + continue^M + Continuing.^M + /home/jenkins/workspace/binutils-gdb_master_linuxbuild/platform/deb12-amd64/target_board/native-extended-gdbserver/src/binutils-gdb/gdb/remot e.c:6922: internal-error: resume: Assertion `scope_ptid == inferior_ptid' failed.^M + A problem internal to GDB has been detected,^M + further debugging may prove unreliable.^M + ----- Backtrace -----^M + FAIL: gdb.reverse/break-precsave.exp: run to end of main (GDB internal error) + +This only happens after running gdb.multi/attach-while-running.exp. +That test does not restore GDBFLAGS properly when it's done, it leaves +`-ex \"maint set target-non-stop on\""` in there, which breaks some +subsequent tests. The problem is that this line: + + save_vars { $::GDBFLAGS } { + +should not use a `$` before the variable name. Passes the content of +`::GDBFLAGS` to save_vars, which is not what we want. We want to pass +the `::GDBFLAGS` string. Fix that. + +Change-Id: I5ad32c527795fd10d0d94020e4fd15cebaca3a77 +--- + gdb/testsuite/gdb.multi/attach-while-running.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp +index d3e0d462413..8fce34eaa65 100644 +--- a/gdb/testsuite/gdb.multi/attach-while-running.exp ++++ b/gdb/testsuite/gdb.multi/attach-while-running.exp +@@ -46,7 +46,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } { + } + + proc do_test {} { +- save_vars { $::GDBFLAGS } { ++ save_vars { ::GDBFLAGS } { + append ::GDBFLAGS " -ex \"maint set target-non-stop on\"" + clean_restart $::binfile + } + +base-commit: 08ce0d63c343f7db9a504d37de25391a997b46e2 +-- +2.35.3 + diff --git a/gdb.changes b/gdb.changes index 6478f40..aa5b1e6 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Wed Jan 10 13:40:34 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR31214 kfail. + * Add kfail for fails in gdb.reverse/solib-precsave.exp / + gdb.reverse/solib-reverse.exp fixed by commit fe6356def67 + ("PowerPC and aarch64: Fix reverse stepping failure"). + * Extend PR31004 kfail. +- Don't require %{python}-base for gdb-testresults package. +- Fix debuginfod handling: + * Enable for sle_version >= 150400 (bsc#1185605, jsc#PED-1149, + jsc#PED-1138), SLE15-SP4 and later. + * Enable for suse_version >= 1600, ALP and Tumbleweed. + * Add back "BuildRequires: libdebuginfod1" to prevent selecting + dummy variant. + * Add "BuildRequires: debuginfod-client" to prevent unresolved + due to conflict with dummy variant. + * Add --with-debuginfod=yes to prevent silently dropping support. +- Patches added (backport from master): + * gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch + * gdb-testsuite-remove-spurious-in-save_vars.patch + ------------------------------------------------------------------- Wed Dec 13 14:58:14 UTC 2023 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 7e2dec9..50ceaaf 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # Copyright (c) 2012 RedHat # # All modifications and additions to the file contributed by third parties @@ -349,6 +349,8 @@ Patch2071: gdb-symtab-add-producer_is_gas.patch Patch2072: gdb-symtab-work-around-gas-pr28629.patch Patch2073: gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch Patch2074: gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch +Patch2075: gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch +Patch2076: gdb-testsuite-remove-spurious-in-save_vars.patch # Backport from gdb-patches @@ -428,17 +430,28 @@ BuildRequires: rpm-devel BuildRequires: xz-devel %endif BuildRequires: zlib-devel + %if 0%{!?_without_python:1} +%if %{build_testsuite} +BuildRequires: %{python}-base +%else Requires: %{python}-base +%endif BuildRequires: %{python}-devel %endif # 0%{!?_without_python:1} + %global have_libdebuginfod 0 -%if 0%{?suse_version} > 1500 +# Enable for SLE15-SP4/Leap-15.4, ALP/Factory. +%if 0%{?sle_version} >= 150400 || 0%{?suse_version} >= 1600 %global have_libdebuginfod 1 %endif + %if 0%{have_libdebuginfod} BuildRequires: libdebuginfod-devel +# Indicate that we prefer libdebuginfod1 over libdebuginfod1-dummy. +BuildRequires: libdebuginfod1 %endif + %global have_libipt 0 %if 0%{suse_version} > 1110 %ifarch %{ix86} x86_64 @@ -586,6 +599,9 @@ BuildRequires: systemtap-sdt-devel %if 0%{have_libdebuginfod} BuildRequires: curl BuildRequires: elfutils-debuginfod +# Fix: unresolvable: have choice for debuginfod-client needed by +# elfutils-debuginfod: debuginfod-client debuginfod-dummy-client. +BuildRequires: debuginfod-client %endif # SLE-10 doesn't have xz. @@ -817,6 +833,8 @@ find -name "*.info*"|xargs rm -f %patch2072 -p1 %patch2073 -p1 %patch2074 -p1 +%patch2075 -p1 +%patch2076 -p1 %patch2100 -p1 %patch2101 -p1 @@ -979,6 +997,9 @@ EXTRA_TARGETS= %endif %endif --with-separate-debug-dir=/usr/lib/debug \ +%if 0%{have_libdebuginfod} + --with-debuginfod=yes \ +%endif --disable-sim \ --disable-rpath \ --with-system-zlib \ diff --git a/qa.sh b/qa.sh index 0b68caa..10bc2db 100644 --- a/qa.sh +++ b/qa.sh @@ -491,7 +491,28 @@ kfail_factory=( # Sets breakpoints in gdb build with lto. This is known to be slow, and # likely to cause timeouts. gdb.gdb/python-helper.exp - + + # Should be fixed by commit fe6356def67 ("PowerPC and aarch64: Fix reverse + # stepping failure"), available in gdb 15. + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function two" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function two" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main two" + "FAIL: gdb.reverse/solib-precsave.exp: run until end part two" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main two" + "FAIL: gdb.reverse/solib-reverse.exp: run until end part two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-next over solib function one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-next over solib function two" + ) # kfail_factory kfail_aarch64=( @@ -504,6 +525,15 @@ kfail_aarch64=( "FAIL: gdb.base/watchpoint-unaligned.exp: continue \(timeout\)" "FAIL: gdb.base/watchpoint-unaligned.exp: size8twice write" + # https://sourceware.org/bugzilla/show_bug.cgi?id=31214 + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 0->5: continue" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.a: 1->0: print expression before" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.a: 1->0: continue \(the program exited\)" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 5->4: print expression before" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 5->4: continue \(the program is no longer running\)" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 5->4: print expression after" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: continue until exit \(the program is no longer running\)" + # https://sourceware.org/bugzilla/show_bug.cgi?id=28561 # "[gdb/testsuite] Error due to not reading \r\n at end of mi prompt" # We match pretty aggressively here. @@ -589,6 +619,8 @@ kfail_powerpc64le=( # https://sourceware.org/bugzilla/show_bug.cgi?id=31004 "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=run: run" + "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=start: start" + ) kfail_powerpc64le_sle12=(