Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gdb for openSUSE:Factory checked in 
at 2025-03-27 22:31:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gdb (Old)
 and      /work/SRC/openSUSE:Factory/.gdb.new.2696 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gdb"

Thu Mar 27 22:31:41 2025 rev:185 rq:1256455 version:15.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/gdb/gdb.changes  2025-03-16 18:58:23.135964796 
+0100
+++ /work/SRC/openSUSE:Factory/.gdb.new.2696/gdb.changes        2025-03-27 
22:31:45.731267276 +0100
@@ -1,0 +2,43 @@
+Thu Mar 27 12:24:34 UTC 2025 - Tom de Vries <tdevr...@suse.com>
+
+- Patches added:
+  * gdb-testsuite-fix-gdb.threads-access-mem-running-thr.patch
+
+-------------------------------------------------------------------
+Wed Mar 26 09:30:19 UTC 2025 - Tom de Vries <tdevr...@suse.com>
+
+- Patches updated (bsc#1240047):
+  * gdb-add-rpm-suggestion-script-suse.patch
+- Patches added (bsc#1240047):
+  * gdb-6.6-buildid-locate-tests-suse.patch
+
+-------------------------------------------------------------------
+Tue Mar 25 11:25:52 UTC 2025 - Tom de Vries <tdevr...@suse.com>
+
+- Update to fedora rawhide @ 8d5adc7.
+- Maintenance script import-fedora.sh:
+  * Remove
+  gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
+  and gdb-remove-use-of-py-isascii from skip_patches.
+- Patches dropped:
+  * gdb-6.6-buildid-locate-solib-missing-ids.patch
+  * gdb-6.6-buildid-locate.patch
+  * gdb-python-avoid-depending-on-the-curses-library.patch
+  * gdb-6.6-buildid-locate-rpm-suse.patch
+- Patches added:
+  * gdb-6.6-buildid-locate-tests.patch
+  * gdb-add-deprecated-settings-py-script.patch
+  * gdb-backport-buildid-related-changes.patch
+  * gdb-remove-qnx-neutrino-support.patch
+  * fixup-gdb-add-rpm-suggestion-script.patch
+  * gdb-add-rpm-suggestion-script-suse.patch
+  * gdb-build-fix-unused-var-in-corelow.c.patch
+- Patches updated:
+  * gdb-add-rpm-suggestion-script.patch
+
+-------------------------------------------------------------------
+Tue Mar 25 08:08:37 UTC 2025 - Tom de Vries <tdevr...@suse.com>
+
+- Mention bsc#1216488.
+
+-------------------------------------------------------------------
@@ -1461 +1504 @@
-- Patches added (backport from master):
+- Patches added (backport from master, bsc#1216488):
@@ -1463,0 +1507 @@
+- Patches added (backport from master):

Old:
----
  gdb-6.6-buildid-locate-rpm-suse.patch
  gdb-6.6-buildid-locate-solib-missing-ids.patch
  gdb-6.6-buildid-locate.patch
  gdb-python-avoid-depending-on-the-curses-library.patch

New:
----
  fixup-gdb-add-rpm-suggestion-script.patch
  gdb-6.6-buildid-locate-tests-suse.patch
  gdb-6.6-buildid-locate-tests.patch
  gdb-add-deprecated-settings-py-script.patch
  gdb-add-rpm-suggestion-script-suse.patch
  gdb-backport-buildid-related-changes.patch
  gdb-build-fix-unused-var-in-corelow.c.patch
  gdb-remove-qnx-neutrino-support.patch
  gdb-testsuite-fix-gdb.threads-access-mem-running-thr.patch

BETA DEBUG BEGIN:
  Old:  * gdb-python-avoid-depending-on-the-curses-library.patch
  * gdb-6.6-buildid-locate-rpm-suse.patch
- Patches added:
  Old:- Patches dropped:
  * gdb-6.6-buildid-locate-solib-missing-ids.patch
  * gdb-6.6-buildid-locate.patch
  Old:  * gdb-6.6-buildid-locate-solib-missing-ids.patch
  * gdb-6.6-buildid-locate.patch
  * gdb-python-avoid-depending-on-the-curses-library.patch
  Old:  * gdb-6.6-buildid-locate.patch
  * gdb-python-avoid-depending-on-the-curses-library.patch
  * gdb-6.6-buildid-locate-rpm-suse.patch
BETA DEBUG END:

BETA DEBUG BEGIN:
  New:  * gdb-remove-qnx-neutrino-support.patch
  * fixup-gdb-add-rpm-suggestion-script.patch
  * gdb-add-rpm-suggestion-script-suse.patch
  New:- Patches added (bsc#1240047):
  * gdb-6.6-buildid-locate-tests-suse.patch
  New:- Patches added:
  * gdb-6.6-buildid-locate-tests.patch
  * gdb-add-deprecated-settings-py-script.patch
  New:  * gdb-6.6-buildid-locate-tests.patch
  * gdb-add-deprecated-settings-py-script.patch
  * gdb-backport-buildid-related-changes.patch
  New:- Patches updated (bsc#1240047):
  * gdb-add-rpm-suggestion-script-suse.patch
- Patches added (bsc#1240047):
  New:  * gdb-add-deprecated-settings-py-script.patch
  * gdb-backport-buildid-related-changes.patch
  * gdb-remove-qnx-neutrino-support.patch
  New:  * gdb-add-rpm-suggestion-script-suse.patch
  * gdb-build-fix-unused-var-in-corelow.c.patch
- Patches updated:
  New:  * gdb-backport-buildid-related-changes.patch
  * gdb-remove-qnx-neutrino-support.patch
  * fixup-gdb-add-rpm-suggestion-script.patch
  New:- Patches added:
  * gdb-testsuite-fix-gdb.threads-access-mem-running-thr.patch
BETA DEBUG END:

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

Other differences:
------------------
++++++ gdb.spec ++++++
--- /var/tmp/diff_new_pack.IfD9I3/_old  2025-03-27 22:31:47.827354039 +0100
+++ /var/tmp/diff_new_pack.IfD9I3/_new  2025-03-27 22:31:47.827354039 +0100
@@ -173,15 +173,17 @@
 Patch2:         gdb-6.3-gstack-20050411.patch
 Patch3:         gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
 Patch4:         gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
-Patch5:         gdb-6.6-buildid-locate.patch
-Patch6:         gdb-6.6-buildid-locate-solib-missing-ids.patch
-Patch7:         gdb-6.5-gcore-buffer-limit-test.patch
-Patch8:         gdb-6.3-mapping-zero-inode-test.patch
-Patch10:        gdb-archer-next-over-throw-cxx-exec.patch
-Patch12:        gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
-Patch15:        gdb-rhbz1149205-catch-syscall-after-fork-test.patch
-Patch16:        gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
-Patch20:        gdb-add-rpm-suggestion-script.patch
+Patch5:         gdb-6.5-gcore-buffer-limit-test.patch
+Patch6:         gdb-6.3-mapping-zero-inode-test.patch
+Patch8:         gdb-archer-next-over-throw-cxx-exec.patch
+Patch10:        gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
+Patch12:        gdb-rhbz1149205-catch-syscall-after-fork-test.patch
+Patch13:        gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
+Patch16:        gdb-remove-qnx-neutrino-support.patch
+Patch17:        gdb-backport-buildid-related-changes.patch
+Patch18:        gdb-add-rpm-suggestion-script.patch
+Patch19:        gdb-add-deprecated-settings-py-script.patch
+Patch20:        gdb-6.6-buildid-locate-tests.patch
 Patch21:        gdb-catchpoint-re-set.patch
 #Fedora Packages end
 
@@ -190,13 +192,16 @@
 # them when upgrading.
 
 Patch1000:      fixup-gdb-6.5-gcore-buffer-limit-test.patch
+Patch1001:      fixup-gdb-add-rpm-suggestion-script.patch
 
 # openSUSE specific
 
 # Hardcodes /bin/bash, given that path is known.
 Patch1100:      gdb-gcore-bash.patch
 # Make gdb emit zypper install hints, rather than debuginfo-install hints.
-Patch1101:      gdb-6.6-buildid-locate-rpm-suse.patch
+Patch1101:      gdb-add-rpm-suggestion-script-suse.patch
+# Fixes testcase to not expect dnf message.
+Patch1102:      gdb-6.6-buildid-locate-tests-suse.patch
 
 # openSUSE specific -- testsuite
 
@@ -231,7 +236,6 @@
 Patch2001:      gdb-symtab-return-correct-reader-for-top-level-cu-in.patch
 Patch2002:      gdb-tdep-s390-add-arch15-record-replay-support.patch
 Patch2003:      gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch
-Patch2004:      gdb-python-avoid-depending-on-the-curses-library.patch
 Patch2005:      gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch
 Patch2006:      gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch
 Patch2007:      gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch
@@ -262,6 +266,7 @@
 Patch2032:      gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch
 Patch2033:      gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch
 Patch2034:      gdb-record-fix-out-of-bounds-write-in-aarch64_record.patch
+Patch2035:      gdb-build-fix-unused-var-in-corelow.c.patch
 
 # Backports from master, available in GDB 17.
 
@@ -291,6 +296,7 @@
 Patch2123:      
gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-for-amd.patch
 Patch2124:      
gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-glibc-2-41.patch
 Patch2125:      gdb-tdep-backport-i386_canonicalize_syscall-rewrite-.patch
+Patch2126:      gdb-testsuite-fix-gdb.threads-access-mem-running-thr.patch
 
 # Backport from gdb-patches
 
@@ -641,20 +647,24 @@
 %patch -P 4 -p1
 %patch -P 5 -p1
 %patch -P 6 -p1
-%patch -P 7 -p1
 %patch -P 8 -p1
 %patch -P 10 -p1
 %patch -P 12 -p1
-%patch -P 15 -p1
+%patch -P 13 -p1
 %patch -P 16 -p1
+%patch -P 17 -p1
+%patch -P 18 -p1
+%patch -P 19 -p1
 %patch -P 20 -p1
 %patch -P 21 -p1
 #Fedora patching end
 
 %patch -P 1000 -p1
+%patch -P 1001 -p1
 
 %patch -P 1100 -p1
 %patch -P 1101 -p1
+%patch -P 1102 -p1
 
 %patch -P 1200 -p1
 %patch -P 1203 -p1
@@ -672,7 +682,6 @@
 %patch -P 2001 -p1
 %patch -P 2002 -p1
 %patch -P 2003 -p1
-%patch -P 2004 -p1
 %patch -P 2005 -p1
 %patch -P 2006 -p1
 %patch -P 2007 -p1
@@ -703,6 +712,7 @@
 %patch -P 2032 -p1
 %patch -P 2033 -p1
 %patch -P 2034 -p1
+%patch -P 2035 -p1
 
 %patch -P 2100 -p1
 %patch -P 2101 -p1
@@ -730,6 +740,7 @@
 %patch -P 2123 -p1
 %patch -P 2124 -p1
 %patch -P 2125 -p1
+%patch -P 2126 -p1
 
 %patch -P 3000 -p1
 %patch -P 3001 -p1

++++++ fixup-gdb-add-rpm-suggestion-script.patch ++++++
>From a7d9abecbc24e3d68746ea5b905eba11913980e1 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevr...@suse.de>
Date: Tue, 25 Mar 2025 17:15:01 +0100
Subject: [PATCH 2/2] fixup-gdb-add-rpm-suggestion-script.patch

---
 gdb/python/lib/gdb/command/rpm-suggestions.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py 
b/gdb/python/lib/gdb/command/rpm-suggestions.py
index bb049bc66e7..066ce98d947 100644
--- a/gdb/python/lib/gdb/command/rpm-suggestions.py
+++ b/gdb/python/lib/gdb/command/rpm-suggestions.py
@@ -510,8 +510,7 @@ class rpm_suggestion_build_id_mode(gdb.Parameter):
 
 # The 'info rpm-suggestions' command.
 class rpm_suggestion_info(gdb.Command):
-    """Relist any RPM installation suggestions that have been made
-    since the executable was last changed."""
+    """Relist any RPM installation suggestions that have been made since the 
executable was last changed."""
     def __init__(self):
         super().__init__("info rpm-suggestions", gdb.COMMAND_NONE, 
gdb.COMPLETE_NONE)
 
-- 
2.43.0


++++++ gdb-6.6-buildid-locate-tests-suse.patch ++++++
>From 4aaa960916b069dd82a293bf0e876dbc8710801e Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevr...@suse.de>
Date: Wed, 26 Mar 2025 10:25:38 +0100
Subject: [PATCH 4/4] gdb-6.6-buildid-locate-tests-suse.patch

---
 ...z981154-misleading-yum-install-warning.exp | 20 ++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git 
a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 
b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
index 991ffef474d..ab5f1667f31 100644
--- a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
@@ -55,6 +55,20 @@ gdb_test "set build-id-verbose 1" "" \
 gdb_test "set debug-file-directory /usr/lib/" "" \
     "set debug-file-directory"
 
-gdb_test "core-file [standard_output_file gcore.test]" \
-    "Missing file\\(s\\), try: dnf --enablerepo='\\*debug\\*' install 
[string_to_regexp /usr/lib/$build_id_without_debug] [string_to_regexp 
/usr/lib/debug/$build_id_debug_file]" \
-    "test first yum/dnf warning"
+# Supporting this for SUSE/openSUSE requires a gdb.missing_objfile handler,
+# but that's not enabled.  Zypper doesn't support finding packages based on
+# build-id, unless the package's installed.
+# So, instead of testing for the SUSE/openSUSE-specific solution, check that
+# the fedora solution doesn't appear.
+
+set cmd "core-file [standard_output_file gcore.test]"
+set test "test first yum/dnf warning"
+set fail_re [string_to_regexp "Missing file(s), try: dnf "].*
+gdb_test_multiple $cmd $test {
+    -re -wrap $fail_re {
+       fail $gdb_test_name
+    }
+    -re -wrap "" {
+       pass $gdb_test_name
+    }
+}
-- 
2.43.0


++++++ gdb-6.6-buildid-locate-tests.patch ++++++
>From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <inva...@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-buildid-locate-tests.patch

;; Tests and test updates related to the rpm suggestion feature.

diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 
b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
@@ -0,0 +1,21 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   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 <http://www.gnu.org/licenses/>.  */
+
+void
+lib (void)
+{
+}
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 
b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
@@ -0,0 +1,25 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   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 <http://www.gnu.org/licenses/>.  */
+
+extern void lib (void);
+
+int
+main (void)
+{
+  lib ();
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 
b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
@@ -0,0 +1,104 @@
+# Copyright 2016 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 <http://www.gnu.org/licenses/>.
+
+require allow_shlib_tests
+
+set testfile "gcore-buildid-exec-but-not-solib"
+set srcmainfile ${testfile}-main.c
+set srclibfile ${testfile}-lib.c
+set libfile [standard_output_file ${testfile}-lib.so]
+set objfile [standard_output_file ${testfile}-main.o]
+set executable ${testfile}-main
+set binfile [standard_output_file ${executable}]
+set gcorefile [standard_output_file ${executable}.gcore]
+set outdir [file dirname $binfile]
+
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug 
additional_flags=-Wl,--build-id"] != ""
+     || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object 
{debug}] != "" } {
+     unsupported "-Wl,--build-id compilation failed"
+     return -1
+}
+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
+     unsupported "-Wl,--build-id compilation failed"
+     return -1
+}
+
+clean_restart $executable
+gdb_load_shlib $libfile
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+    -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
+       # gcore command not supported -- nothing to test here.
+       unsupported "gdb does not support gcore on this target"
+       return -1;
+    }
+    -re "Save a core file .*\r\n$gdb_prompt $" {
+       pass $test
+    }
+}
+
+if { ![runto lib] } then {
+    return -1
+}
+
+set escapedfilename [string_to_regexp ${gcorefile}]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${gcorefile}" $test {
+    -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
+       pass $test
+    }
+    -re "Can't create a corefile\r\n$gdb_prompt $" {
+       unsupported $test
+       return -1
+    }
+}
+
+# Now restart gdb and load the corefile.
+
+clean_restart $executable
+gdb_load_shlib $libfile
+
+set buildid [build_id_debug_filename_get $libfile]
+
+regsub {\.debug$} $buildid {} buildid
+
+set debugdir [standard_output_file ${testfile}-debugdir]
+file delete -force -- $debugdir
+
+file mkdir $debugdir/[file dirname $libfile]
+file copy $libfile $debugdir/${libfile}
+
+file mkdir $debugdir/[file dirname $buildid]
+file copy $libfile $debugdir/${buildid}
+
+remote_exec build "ln -s /lib       ${debugdir}/"
+remote_exec build "ln -s /lib64     ${debugdir}/"
+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 
ld-linux-x86-64.so.2
+
+gdb_test_no_output "set solib-absolute-prefix $debugdir" \
+    "set solib-absolute-prefix"
+
+gdb_test_no_output "set debug-file-directory $debugdir" "set 
debug-file-directory"
+
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated 
corefile"
+
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
+
+gdb_test "bt"
+gdb_test "info shared"
diff --git 
a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 
b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
@@ -0,0 +1,60 @@
+# Copyright (C) 2014  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 <http://www.gnu.org/licenses/>.
+
+# Create a core file, then hide the executable.  Restart GDB and load
+# the core file.  Check GDB gives a message suggesting a 'dnf' command
+# to try and install the executable based on its build-id.
+
+standard_testfile "normal.c"
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+    return -1
+}
+
+# Get the build-id of the file.
+set build_id_debug_file [build_id_debug_filename_get $binfile]
+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug
+
+# Run to main.
+if { ![runto_main] } {
+    return -1
+}
+
+# We first need to generate a corefile.
+set corefilename "[standard_output_file gcore.test]"
+if { ![gdb_gcore_cmd "$corefilename" "save corefile"] } {
+    untested "could not generate a corefile"
+    return -1
+}
+
+# Move the binfile to a temporary name.
+remote_exec build "mv $binfile ${binfile}.old"
+
+# Reinitialize GDB and see if we get a dnf suggestion.
+clean_restart
+
+gdb_test "set build-id-verbose 1" "" \
+    "set build-id-verbose"
+
+# GDB only makes build-id based RPM suggestions if /usr/lib is in
+# the debug-file-directory list, the reason being that system RPMs
+# will always install under this location.  If GDB is not looking
+# here then there's no point making suggestions.
+gdb_test "set debug-file-directory /usr/lib/" "" \
+    "set debug-file-directory"
+
+gdb_test "core-file [standard_output_file gcore.test]" \
+    "Missing file\\(s\\), try: dnf --enablerepo='\\*debug\\*' install 
[string_to_regexp /usr/lib/$build_id_without_debug] [string_to_regexp 
/usr/lib/debug/$build_id_debug_file]" \
+    "test first yum/dnf warning"

++++++ gdb-add-deprecated-settings-py-script.patch ++++++
>From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Burgess <aburg...@redhat.com>
Date: Tue, 19 Nov 2024 13:56:56 +0000
Subject: gdb-add-deprecated-settings-py-script.patch

;; Not a backport.  Add a new script which defines a setting which is
;; deprecated, but we don't want to remove it from Fedora GDB just yet.

gdb: add script which defines a deprecated settings

The build-id-core-load setting has not been useful since 2020, but its
not clear when it will be OK to remove this from GDB.

Rather than defining this setting in C++ code, lets just create it
using this Python script, this helps keep the Fedora stuff out of core
GDB.

diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -86,6 +86,7 @@ PYTHON_FILE_LIST = \
        gdb/unwinder.py \
        gdb/xmethod.py \
        gdb/command/__init__.py \
+       gdb/command/deprecated-settings.py \
        gdb/command/explore.py \
        gdb/command/frame_filters.py \
        gdb/command/missing_files.py \
diff --git a/gdb/python/lib/gdb/command/deprecated-settings.py 
b/gdb/python/lib/gdb/command/deprecated-settings.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/command/deprecated-settings.py
@@ -0,0 +1,35 @@
+import gdb
+
+# This setting was added to Fedora GDB back in 2007.  It controlled
+# whether GDB would use the build-id extracted from a core file to
+# auto-load the executable if the user had not already loaded an
+# executable.
+#
+# In 2020 this setting was effectively deprecated as the only use of
+# the setting's value was removed.  After this GDB would always
+# auto-load an executable based on the build-id if no executable was
+# already loaded.
+#
+# For now we maintain this setting for backward compatibility reasons.
+
+class build_id_core_load(gdb.Parameter):
+    """This setting is deprecated.  Changing it will have no effect.
+    This is maintained only for backwards compatibility.
+
+    When opening a core-file, and no executable is loaded, GDB will
+    always try to auto-load a suitable executable using the build-id
+    extracted from the core file (if a suitable build-id can be
+    found)."""
+
+    def __init__(self):
+        self.set_doc = "This setting is deprecated and has no effect."
+        self.show_doc = "This setting is deprecated and has no effect."
+        self.value = True
+
+        super().__init__("build-id-core-load", gdb.COMMAND_DATA, 
gdb.PARAM_BOOLEAN)
+    def validate(self):
+        return True
+    def get_set_string(self):
+        raise gdb.GdbError("The 'build-id-core-load' setting is deprecated.")
+
+build_id_core_load()

++++++ gdb-add-rpm-suggestion-script-suse.patch ++++++
>From 423c53757e2fe22815fef8a04abf21caff951937 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevr...@suse.de>
Date: Tue, 25 Mar 2025 14:12:51 +0100
Subject: [PATCH 1/4] [distro] Update gdb-add-rpm-suggestion-script.patch for
 SUSE

---
 gdb/python/lib/gdb/command/rpm-suggestions.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py 
b/gdb/python/lib/gdb/command/rpm-suggestions.py
index 156fce0672b..f1034070989 100644
--- a/gdb/python/lib/gdb/command/rpm-suggestions.py
+++ b/gdb/python/lib/gdb/command/rpm-suggestions.py
@@ -358,7 +358,7 @@ else:
     # Take a non-empty list of RPM names and print a command line a
     # user could run to install these RPMs.
     def print_rpm_suggestions(rpm_name_list):
-        print("Missing rpms, try: dnf --enablerepo='*debug*' install " + ' 
'.join(rpm_name_list))
+        print("Missing separate debuginfos, use: zypper install " + ' 
'.join(rpm_name_list))
 
     # Take a non-empty list of build-id strings and print a series of
     # lines that a user could run to instll the RPMs that provide
@@ -423,7 +423,10 @@ else:
 
     # Register the missing debug and missing objfile handlers with GDB.
     gdb.missing_debug.register_handler(None, RPM_MissingDebugHandler())
-    gdb.missing_objfile.register_handler(None, RPM_MissingObjfileHandler())
+
+    # Not enabled for SUSE/openSUSE.  Zypper doesn't support finding packages
+    # based on build-id, unless the package's installed.
+    #gdb.missing_objfile.register_handler(None, RPM_MissingObjfileHandler())
 
     # Implement the core of 'info rpm-suggestions'.  Reprint all rpm
     # suggestions.

base-commit: 956ad1d51aa6e4117a98c4124bd7154a1aaeec55
-- 
2.43.0


++++++ gdb-add-rpm-suggestion-script.patch ++++++
++++ 789 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/gdb/gdb-add-rpm-suggestion-script.patch
++++ and 
/work/SRC/openSUSE:Factory/.gdb.new.2696/gdb-add-rpm-suggestion-script.patch

++++++ gdb-backport-buildid-related-changes.patch ++++++
++++ 6754 lines (skipped)

++++++ gdb-build-fix-unused-var-in-corelow.c.patch ++++++
>From c179fc89cf61d3d9c58db571d709969bfa566289 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevr...@suse.de>
Date: Tue, 10 Sep 2024 10:08:29 +0200
Subject: [PATCH] [gdb/build] Fix unused var in corelow.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On x86_64-linux, with gcc 7.5.0 and CFLAGS/CXXFLAGS="-O0 -g -Wall" I ran into
a build breaker:
...
gdb/corelow.c: In member function ‘void mapped_file_info::add(const char*, 
const char*, const char*, std::vector<mem_range>&&, const bfd_build_id*)’:
gdb/corelow.c:1822:27: error: unused variable ‘it’ [-Werror=unused-variable]
   const auto [it, inserted]
                           ^
...

Fix this by dropping the variable it.

Tested on x86_64-linux.

Reviewed-By: Lancelot Six<lancelot....@amd.com>
---
 gdb/corelow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/corelow.c b/gdb/corelow.c
index 1884075ec67..30b98c2865d 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -1872,8 +1872,8 @@ mapped_file_info::add (const char *soname,
      parsed, we group the build-id information based on the file name.  As
      a consequence, we should see each EXPECTED_FILENAME value exactly
      once.  This means that each insertion should always succeed.  */
-  const auto [it, inserted]
-    = m_filename_to_build_id_map.emplace (expected_filename, build_id);
+  const auto inserted
+    = m_filename_to_build_id_map.emplace (expected_filename, build_id).second;
   gdb_assert (inserted);
 
   /* Setup the reverse build-id to file name map.  */

base-commit: a7d9abecbc24e3d68746ea5b905eba11913980e1
-- 
2.43.0


++++++ gdb-remove-qnx-neutrino-support.patch ++++++
++++ 2924 lines (skipped)

++++++ gdb-testsuite-fix-gdb.threads-access-mem-running-thr.patch ++++++
>From 87a754a5b94b2360f39525f63f2292f23e9e0fe6 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevr...@suse.de>
Date: Thu, 27 Mar 2025 13:18:57 +0100
Subject: [PATCH] [gdb/testsuite] Fix
 gdb.threads/access-mem-running-thread-exit.exp

In OBS (Open Build Service), with a 15.2 based gdb package, occasionally I run
into:
...
(gdb) inferior 2
[Switching to inferior 2 [process 31372] (access-mem-running-thread-exit)]
[Switching to thread 2.1 (Thread 0xf7db9700 (LWP 31372))](running)
(gdb) print global_var = 555
$1 = 555
(gdb) print global_var
$2 = 556
(gdb) FAIL: $exp: all-stop: access mem \
  (print global_var after writing, inf=2, iter=1)
...

I managed to reproduce this on current trunk using a reproducer patch (posted
in the PR).

The problem is due to commit 31c21e2c13d ("[gdb/testsuite] Fix
gdb.threads/access-mem-running-thread-exit.exp with clang"), which introduced
an increment of global_var at the start of main.

This created a race between:
- gdb modifying global_var, and
- the inferior modifying global_var.

Fix this by:
- adding a new empty function setup_done,
- adding a call to setup_done after the increment of global_var, and
- rather than running to main, running to setup_done.

Tested on x86_64-linux.

PR testsuite/32822
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32822
---
 .../gdb.threads/access-mem-running-thread-exit.c       |  7 +++++++
 .../gdb.threads/access-mem-running-thread-exit.exp     | 10 +++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c 
b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c
index af05b13c763..e22bf12df75 100644
--- a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c
+++ b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c
@@ -97,6 +97,11 @@ thread_fn (void *arg)
   return NULL;
 }
 
+static void
+setup_done (void)
+{
+}
+
 int
 main (void)
 {
@@ -104,6 +109,8 @@ main (void)
 
   global_var++;
 
+  setup_done ();
+
   for (i = 0; i < 4; i++)
     {
       struct thread_arg *p;
diff --git a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp 
b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
index 784f17ff3b2..42222c0fb35 100644
--- a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
+++ b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
@@ -54,7 +54,7 @@ proc test { non_stop } {
       clean_restart ${binfile}
     }
 
-    if ![runto_main] {
+    if ![runto setup_done] {
        return -1
     }
 
@@ -76,7 +76,7 @@ proc test { non_stop } {
     # Start the second inferior.
     with_test_prefix "second inferior" {
        # With stub targets that do reload on run, if we let the new
-       # inferior share inferior 1's connection, runto_main would
+       # inferior share inferior 1's connection, runto would
        # fail because GDB is already connected to something, like
        # e.g. with --target_board=native-gdbserver:
        #
@@ -86,10 +86,10 @@ proc test { non_stop } {
        #  Already connected to a remote target.  Disconnect? (y or n)
        #
        # Instead, start the inferior with no connection, and let
-       # gdb_load/runto_main spawn a new remote connection/gdbserver.
+       # gdb_load/runto spawn a new remote connection/gdbserver.
        #
        # OTOH, with extended-remote, we must let the new inferior
-       # reuse the current connection, so that runto_main below can
+       # reuse the current connection, so that runto below can
        # issue the "run" command, and have the inferior run on the
        # remote target.  If we forced no connection, then "run" would
        # either fail if "set auto-connect-native-target" is on, like
@@ -108,7 +108,7 @@ proc test { non_stop } {
 
        gdb_load $binfile
 
-       if ![runto_main] {
+       if ![runto setup_done] {
            return -1
        }
     }

base-commit: af5d18ee9fd221ca8a54de4957ec5c351599f13c
-- 
2.43.0


++++++ import-fedora.sh ++++++
--- /var/tmp/diff_new_pack.IfD9I3/_old  2025-03-27 22:31:48.407378048 +0100
+++ /var/tmp/diff_new_pack.IfD9I3/_new  2025-03-27 22:31:48.407378048 +0100
@@ -6,16 +6,12 @@
     # Not applicable for openSUSE.
     gdb-add-index.patch
     gdb-6.3-rh-testversion-20041202.patch
-    
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
     gdb-6.8-bz466901-backtrace-full-prelinked.patch
 
     # Dropped by fedora.
     gdb-rhbz1156192-recursive-dlopen-test.patch
     gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
     gdb-test-bt-cfi-without-die.patch
-    
-    # No longer needed.
-    gdb-remove-use-of-py-isascii
 )
 
 usage ()

Reply via email to