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-06-18 19:29:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gdb (Old) and /work/SRC/openSUSE:Factory/.gdb.new.19631 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gdb" Wed Jun 18 19:29:33 2025 rev:188 rq:1286144 version:16.3 Changes: -------- --- /work/SRC/openSUSE:Factory/gdb/gdb.changes 2025-04-24 17:25:05.020252128 +0200 +++ /work/SRC/openSUSE:Factory/.gdb.new.19631/gdb.changes 2025-06-18 19:29:35.236690362 +0200 @@ -1,0 +2,70 @@ +Fri Jun 6 08:16:36 UTC 2025 - Tom de Vries <tdevr...@suse.com> + +- Patches added: + * gdb-testsuite-fix-timeout-in-gdb.multi-attach-while-.patch +- Patches added (swo#32167): + * gdb-python-reimplement-gdb.interrupt-race-fix.patch +- Maintenance script qa.sh: + * Drop PR32167 kfail. + +------------------------------------------------------------------- +Wed Jun 4 09:08:02 UTC 2025 - Tom de Vries <tdevr...@suse.com> + +- Simplify outdated comment in gdb.spec. +- Update to fedora rawhide @ 0481d32. + Maintenance script import-fedora.sh: + * Skip gdb-fix-bg-execution-repeat.patch. +- Add MIT in License tag due to gdbsupport/unordered_dense.h. +- Update to fedora rawhide @ 89e3933. + Maintenance script import-fedora.sh: + * Drop gdb-6.8-bz466901-backtrace-full-prelinked.patch from + skip_patches. +- Update to fedora rawhide @ 660c52f. + Drop patches: + * gdb-rhbz1149205-catch-syscall-after-fork-test.patch +- Update to fedora rawhide @ 885cdf8. + Update patches: + * gdb-add-rpm-suggestion-script.patch + Drop patches: + * fixup-gdb-add-rpm-suggestion-script.patch +- Update to fedora rawhide @ 9c718a5. + Drop patches: + * gdb-6.3-mapping-zero-inode-test.patch +- Update to fedora rawhide @ 15778f3. + Drop patches: + * gdb-archer-next-over-throw-cxx-exec.patch +- Update to fedora rawhide @ 152468c. + Maintenance script import-fedora.sh: + * Rename gdb-6.3-rh-testversion-20041202.patch to + gdb-test-show-version.patch in skip_patches. + Patches dropped (Renamed to ...): + * gdb-add-rpm-suggestion-script.patch + Patches added (... this): + * gdb-rpm-suggestion-script.patch +- Move some patches from "Backport from gdb-patches" to + "Backports from master, available in GDB 17". +- Add patches (swo#33000): + * gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch +- Add patches (swo#32409): + * gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch +- Add patches: + * gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch + * gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch + * gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch + * gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch + * gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch + * gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch + * gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch + * gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch + +------------------------------------------------------------------- +Tue May 27 13:30:13 UTC 2025 - Tom de Vries <tdevr...@suse.com> + +- Fix "ERROR: is not a date". + +------------------------------------------------------------------- +Thu May 8 11:27:29 UTC 2025 - Friedrich Haubensak <hs...@mail.de> + +- Add libipt-cmake4-patch to fix build failure w/ cmake-4 + +------------------------------------------------------------------- @@ -2169 +2238,0 @@ - @@ -2176 +2244,0 @@ - @@ -3004 +3071,0 @@ - Old: ---- fixup-gdb-add-rpm-suggestion-script.patch gdb-6.3-mapping-zero-inode-test.patch gdb-add-rpm-suggestion-script.patch gdb-archer-next-over-throw-cxx-exec.patch gdb-rhbz1149205-catch-syscall-after-fork-test.patch New: ---- gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch gdb-python-reimplement-gdb.interrupt-race-fix.patch gdb-rpm-suggestion-script.patch gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch gdb-testsuite-fix-timeout-in-gdb.multi-attach-while-.patch gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch libipt-cmake4-patch ----------(Old B)---------- Old: Drop patches: * fixup-gdb-add-rpm-suggestion-script.patch - Update to fedora rawhide @ 9c718a5. Old: Drop patches: * gdb-6.3-mapping-zero-inode-test.patch - Update to fedora rawhide @ 15778f3. Old: Update patches: * gdb-add-rpm-suggestion-script.patch Drop patches: Old: Drop patches: * gdb-archer-next-over-throw-cxx-exec.patch - Update to fedora rawhide @ 152468c. Old: Drop patches: * gdb-rhbz1149205-catch-syscall-after-fork-test.patch - Update to fedora rawhide @ 885cdf8. ----------(Old E)---------- ----------(New B)---------- New:- Add patches (swo#32409): * gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch - Add patches: New:- Patches added (swo#32167): * gdb-python-reimplement-gdb.interrupt-race-fix.patch - Maintenance script qa.sh: New: Patches added (... this): * gdb-rpm-suggestion-script.patch - Move some patches from "Backport from gdb-patches" to New:- Add patches (swo#33000): * gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch - Add patches (swo#32409): New: * gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch * gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch New: * gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch * gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch * gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch New: * gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch * gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch * gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch New: * gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch * gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch * gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch New: * gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch * gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch * gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch New: * gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch * gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch * gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch New:- Patches added: * gdb-testsuite-fix-timeout-in-gdb.multi-attach-while-.patch - Patches added (swo#32167): New: * gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch * gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch * gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch New:- Add patches: * gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch * gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gdb.spec ++++++ --- /var/tmp/diff_new_pack.7uacNi/_old 2025-06-18 19:29:37.828797638 +0200 +++ /var/tmp/diff_new_pack.7uacNi/_new 2025-06-18 19:29:37.832797804 +0200 @@ -59,7 +59,7 @@ %if %{build_main} Summary: A GNU source-level debugger for C, C++, Fortran and other languages -License: GPL-3.0-only WITH GCC-exception-3.1 AND GPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later +License: GPL-3.0-only WITH GCC-exception-3.1 AND GPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later AND MIT Group: Development/Languages/C and C++ %endif %if %{build_testsuite} @@ -162,20 +162,17 @@ NoSource: 20 %endif -# Fedora import from branch f38, commit 82cc8e0. +# Fedora import. #Fedora Packages begin -Patch2: gdb-6.3-mapping-zero-inode-test.patch -Patch4: gdb-archer-next-over-throw-cxx-exec.patch -Patch5: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch7: gdb-add-rpm-suggestion-script.patch +Patch3: gdb-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup # These need a number with at least four digits, otherwise patchlist.pl removes # them when upgrading. -Patch1001: fixup-gdb-add-rpm-suggestion-script.patch +# # openSUSE specific @@ -241,6 +238,23 @@ Patch2128: gdb-testsuite-fix-gdb.dwarf2-implptr.exp-regression.patch Patch2129: gdb-symtab-fix-gdb.base-fission-macro.exp-with-unix-.patch Patch2130: gdb-testsuite-fix-gdb.threads-clone-attach-detach.ex.patch +Patch2131: gdb-doc-fix-standard-replies-xref.patch +Patch2132: gdb-testsuite-use-c-flag-in-c-test-cases.patch +Patch2133: gdb-tui-enable-work-around-libncurses-segfault.patch +Patch2134: gdb-testsuite-fix-another-timeout-in-gdb.base-bg-exe.patch +Patch2135: gdb-testsuite-fix-another-timeout-in-gdb.base-bg-exe.1.patch +Patch2136: gdb-testsuite-fix-timeout-in-gdb.threads-inf-thr-cou.patch +Patch2137: gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch +Patch2138: gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch +Patch2139: gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch +Patch2140: gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch +Patch2141: gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch +Patch2142: gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch +Patch2143: gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch +Patch2144: gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch +Patch2145: gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch +Patch2146: gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch +Patch2147: gdb-testsuite-fix-timeout-in-gdb.multi-attach-while-.patch # Backport from gdb-patches @@ -250,28 +264,22 @@ Patch3001: gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch # https://sourceware.org/pipermail/gdb-patches/2021-May/178990.html Patch3002: gdb-cli-add-ignore-errors-command.patch -# https://sourceware.org/pipermail/gdb-patches/2025-January/214982.html -Patch3005: gdb-doc-fix-standard-replies-xref.patch # https://sourceware.org/pipermail/gdb-patches/2023-December/205054.html Patch3006: gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch -# https://sourceware.org/bugzilla/show_bug.cgi?id=30380#c1 -Patch3007: gdb-testsuite-use-c-flag-in-c-test-cases.patch # https://sourceware.org/pipermail/gdb-patches/2025-March/216050.html +# Can be dropped when updating to GDB 17, obsoleted by +# commit fba43b6e5df ("[gdb/testsuite] Add selftest disassemble-s390x"). Patch3008: gdb-testsuite-add-gdb.arch-s390-disassemble.exp.patch -# https://sourceware.org/pipermail/gdb-patches/2025-April/217015.html -Patch3009: gdb-tui-enable-work-around-libncurses-segfault.patch -# https://sourceware.org/pipermail/gdb-patches/2025-April/217098.html -Patch3010: gdb-testsuite-fix-another-timeout-in-gdb.base-bg-exe.patch # https://sourceware.org/pipermail/gdb-patches/2025-February/215898.html Patch3011: gdb-block-sigterm-during-fetch_inferior_event.patch -# https://sourceware.org/pipermail/gdb-patches/2025-April/217188.html -Patch3012: gdb-testsuite-fix-another-timeout-in-gdb.base-bg-exe.1.patch # https://sourceware.org/pipermail/gdb-patches/2025-April/217193.html +# Can be dropped when updating to GDB 17, obsoleted by +# commit 6b4f72a01e6 ("[gdb/breakpoints] Stabilize info breakpoints output"). Patch3013: gdb-testsuite-fix-regexp-in-gdb.multi-pending-bp-del.patch # https://sourceware.org/pipermail/gdb-patches/2025-March/216441.html Patch3014: gdb-testsuite-fix-timeout-in-gdb.threads-main-thread.patch -# https://sourceware.org/pipermail/gdb-patches/2025-April/217269.html -Patch3015: gdb-testsuite-fix-timeout-in-gdb.threads-inf-thr-cou.patch +# https://sourceware.org/pipermail/gdb-patches/2025-June/218637.html +Patch3015: gdb-python-reimplement-gdb.interrupt-race-fix.patch # Debug patches. @@ -279,6 +287,9 @@ # Other. Needs comment for each patch. +# fix build failure w/ cmake-4; cf. github.com/intel/libipt/commit/fa7d42d +Patch4001: libipt-cmake4-patch + # # End of patches. @@ -592,14 +603,9 @@ find -name "*.info*"|xargs rm -f #Fedora patching start -%patch -P 2 -p1 -%patch -P 4 -p1 -%patch -P 5 -p1 -%patch -P 7 -p1 +%patch -P 3 -p1 #Fedora patching end -%patch -P 1001 -p1 - %patch -P 1100 -p1 %patch -P 1101 -p1 %patch -P 1102 -p1 @@ -643,18 +649,30 @@ %patch -P 2128 -p1 %patch -P 2129 -p1 %patch -P 2130 -p1 +%patch -P 2131 -p1 +%patch -P 2132 -p1 +%patch -P 2133 -p1 +%patch -P 2134 -p1 +%patch -P 2135 -p1 +%patch -P 2136 -p1 +%patch -P 2137 -p1 +%patch -P 2138 -p1 +%patch -P 2139 -p1 +%patch -P 2140 -p1 +%patch -P 2141 -p1 +%patch -P 2142 -p1 +%patch -P 2143 -p1 +%patch -P 2144 -p1 +%patch -P 2145 -p1 +%patch -P 2146 -p1 +%patch -P 2147 -p1 %patch -P 3000 -p1 %patch -P 3001 -p1 %patch -P 3002 -p1 -%patch -P 3005 -p1 %patch -P 3006 -p1 -%patch -P 3007 -p1 %patch -P 3008 -p1 -%patch -P 3009 -p1 -%patch -P 3010 -p1 %patch -P 3011 -p1 -%patch -P 3012 -p1 %patch -P 3013 -p1 %patch -P 3014 -p1 %patch -P 3015 -p1 @@ -662,6 +680,7 @@ #unpack libipt %if 0%{have_libipt} tar xzf %{SOURCE7} +%patch -P 4001 -p1 mv libipt-%{libipt_version} processor-trace-%{libipt_version} %endif ++++++ gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch ++++++ >From 75397d995ffe1e1bbcfb75f9b4f744ba9c036d6d Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Tue, 15 Apr 2025 16:59:32 +0200 Subject: [PATCH 1/2] [gdb/ada] Fix gdb.ada/overloads.exp on s390x On s390x-linux, with test-case gdb.ada/overloads.exp and gcc 7.5.0 I run into: ... (gdb) print Oload(CA)^M Could not find a match for oload^M (gdb) FAIL: $exp: print Oload(CA) ... The mismatch happens here in ada_type_match: ... return ftype->code () == atype->code (); ... with: ... (gdb) p ftype->code () $3 = TYPE_CODE_TYPEDEF (gdb) p atype->code () $4 = TYPE_CODE_ARRAY ... At the start of ada_type_match, typedefs are skipped: ... ftype = ada_check_typedef (ftype); atype = ada_check_typedef (atype); ... but immediately after this, refs are skipped: ... if (ftype->code () == TYPE_CODE_REF) ftype = ftype->target_type (); if (atype->code () == TYPE_CODE_REF) atype = atype->target_type (); ... which in this case makes ftype a typedef. Fix this by using ada_check_typedef after skipping the refs as well. Tested on x86_64-linux and s390x-linux. Approved-By: Tom Tromey <t...@tromey.com> PR ada/32409 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32409 --- gdb/ada-lang.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index fdb89cb0bb3..e9311c179b9 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3944,9 +3944,9 @@ ada_type_match (struct type *ftype, struct type *atype) atype = ada_check_typedef (atype); if (ftype->code () == TYPE_CODE_REF) - ftype = ftype->target_type (); + ftype = ada_check_typedef (ftype->target_type ()); if (atype->code () == TYPE_CODE_REF) - atype = atype->target_type (); + atype = ada_check_typedef (atype->target_type ()); switch (ftype->code ()) { base-commit: bb86ddf7c6827ec9b467cc0107395f91b9cbc5d2 -- 2.43.0 ++++++ gdb-python-reimplement-gdb.interrupt-race-fix.patch ++++++ >From 8ed241a885f7a2d2f713aecfe471f335ae1e230b Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Tue, 29 Apr 2025 16:58:24 +0200 Subject: [PATCH] [gdb/python] Reimplement gdb.interrupt race fix Once in a while, when running test-case gdb.base/bp-cmds-continue-ctrl-c.exp, I run into: ... Breakpoint 2, foo () at bp-cmds-continue-ctrl-c.c:23^M 23 usleep (100);^M ^CFAIL: $exp: run: stop with control-c (unexpected) (timeout) FAIL: $exp: run: stop with control-c ... This is PR python/32167, observed both on x86_64-linux and powerpc64le-linux. This is not a timeout due to accidental slowness, gdb actually hangs. The backtrace at the hang is (on cfarm120 running AlmaLinux 9.6): ... (gdb) bt #0 0x00007fffbca9dd94 in __lll_lock_wait () from /lib64/glibc-hwcaps/power10/libc.so.6 #1 0x00007fffbcaa6ddc in pthread_mutex_lock@@GLIBC_2.17 () from /lib64/glibc-hwcaps/power10/libc.so.6 #2 0x000000001067aee8 in __gthread_mutex_lock () at /usr/include/c++/11/ppc64le-redhat-linux/bits/gthr-default.h:749 #3 0x000000001067afc8 in __gthread_recursive_mutex_lock () at /usr/include/c++/11/ppc64le-redhat-linux/bits/gthr-default.h:811 #4 0x000000001067b0d4 in std::recursive_mutex::lock () at /usr/include/c++/11/mutex:108 #5 0x000000001067b380 in std::lock_guard<std::recursive_mutex>::lock_guard () at /usr/include/c++/11/bits/std_mutex.h:229 #6 0x0000000010679d3c in set_quit_flag () at gdb/extension.c:865 #7 0x000000001066b6dc in handle_sigint () at gdb/event-top.c:1264 #8 0x00000000109e3b3c in handler_wrapper () at gdb/posix-hdep.c:70 #9 <signal handler called> #10 0x00007fffbcaa6d14 in pthread_mutex_lock@@GLIBC_2.17 () from /lib64/glibc-hwcaps/power10/libc.so.6 #11 0x000000001067aee8 in __gthread_mutex_lock () at /usr/include/c++/11/ppc64le-redhat-linux/bits/gthr-default.h:749 #12 0x000000001067afc8 in __gthread_recursive_mutex_lock () at /usr/include/c++/11/ppc64le-redhat-linux/bits/gthr-default.h:811 #13 0x000000001067b0d4 in std::recursive_mutex::lock () at /usr/include/c++/11/mutex:108 #14 0x000000001067b380 in std::lock_guard<std::recursive_mutex>::lock_guard () at /usr/include/c++/11/bits/std_mutex.h:229 #15 0x00000000106799cc in set_active_ext_lang () at gdb/extension.c:775 #16 0x0000000010b287ac in gdbpy_enter::gdbpy_enter () at gdb/python/python.c:232 #17 0x0000000010a8e3f8 in bpfinishpy_handle_stop () at gdb/python/py-finishbreakpoint.c:414 ... What happens here is the following: - the gdbpy_enter constructor attempts to set the current extension language to python using set_active_ext_lang - set_active_ext_lang attempts to lock ext_lang_mutex - while doing so, it is interrupted by sigint_wrapper (the SIGINT handler), handling a SIGINT - sigint_wrapper calls handle_sigint, which calls set_quit_flag, which also tries to lock ext_lang_mutex - since std::recursive_mutex::lock is not async-signal-safe, things go wrong, resulting in a hang. The hang bisects to commit 8bb8f834672 ("Fix gdb.interrupt race"), which introduced the lock, making PR python/32167 a regression since gdb 15.1. Commit 8bb8f834672 fixes PR dap/31263, a race reported by ThreadSanitizer: ... WARNING: ThreadSanitizer: data race (pid=615372) Read of size 1 at 0x00000328064c by thread T19: #0 set_active_ext_lang(extension_language_defn const*) gdb/extension.c:755 #1 scoped_disable_cooperative_sigint_handling::scoped_disable_cooperative_sigint_handling() gdb/extension.c:697 #2 gdbpy_interrupt gdb/python/python.c:1106 #3 cfunction_vectorcall_NOARGS <null> Previous write of size 1 at 0x00000328064c by main thread: #0 scoped_disable_cooperative_sigint_handling::scoped_disable_cooperative_sigint_handling() gdb/extension.c:704 #1 fetch_inferior_event() gdb/infrun.c:4591 ... Location is global 'cooperative_sigint_handling_disabled' of size 1 at 0x00000328064c ... SUMMARY: ThreadSanitizer: data race gdb/extension.c:755 in \ set_active_ext_lang(extension_language_defn const*) ... The problem here is that gdb.interrupt is called from a worker thread, and its implementation, gdbpy_interrupt races with the main thread on some variable. Reimplement the fix for PR dap/31263, by: - reverting the parts of commit 8bb8f834672 related to the lock, and - reimplementing gdbpy_interrupt using kill. This way of fixing it doesn't require a lock, and consequently fixes PR python/32167. Tested on x86_64-linux and ppc64le-linux. I also verified that PR dap/31263 remains fixed by building gdb with ThreadSanitizer and running the testsuite on x86_64-linux. I left in the requirement (introduced by commit 8bb8f834672) that DAP requires thread support by the C++ compiler. It possible that this is no longer required, but I haven't looked into it. Now the RFC part. There is a problem with using kill though: it's not supported when building gdb using mingw. Does anybody know what should be used instead? I found GenerateConsoleCtrlEvent [1] which looks like a candidate. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32167 [1] https://learn.microsoft.com/en-us/windows/console/generateconsolectrlevent --- gdb/extension.c | 39 --------------------------------------- gdb/python/python.c | 11 +---------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/gdb/extension.c b/gdb/extension.c index b78ea4f2716..4b9f973f75a 100644 --- a/gdb/extension.c +++ b/gdb/extension.c @@ -638,21 +638,6 @@ breakpoint_ext_lang_cond_says_stop (struct breakpoint *b) This requires cooperation with the extension languages so the support is defined here. */ -#if CXX_STD_THREAD - -#include <mutex> - -/* DAP needs a way to interrupt the main thread, so we added - gdb.interrupt. However, as this can run from any thread, we need - locking for the current extension language. If threading is not - available, DAP will not start. - - This lock is held for accesses to quit_flag, active_ext_lang, and - cooperative_sigint_handling_disabled. */ -static std::recursive_mutex ext_lang_mutex; - -#endif /* CXX_STD_THREAD */ - /* This flag tracks quit requests when we haven't called out to an extension language. it also holds quit requests when we transition to an extension language that doesn't have cooperative SIGINT handling. */ @@ -708,10 +693,6 @@ static bool cooperative_sigint_handling_disabled = false; scoped_disable_cooperative_sigint_handling::scoped_disable_cooperative_sigint_handling () { -#if CXX_STD_THREAD - std::lock_guard guard (ext_lang_mutex); -#endif /* CXX_STD_THREAD */ - /* Force the active extension language to the GDB scripting language. This ensures that a previously saved SIGINT is moved to the quit_flag global, as well as ensures that future SIGINTs @@ -729,10 +710,6 @@ scoped_disable_cooperative_sigint_handling::scoped_disable_cooperative_sigint_ha scoped_disable_cooperative_sigint_handling::~scoped_disable_cooperative_sigint_handling () { -#if CXX_STD_THREAD - std::lock_guard guard (ext_lang_mutex); -#endif /* CXX_STD_THREAD */ - cooperative_sigint_handling_disabled = m_prev_cooperative_sigint_handling_disabled; restore_active_ext_lang (m_prev_active_ext_lang_state); } @@ -771,10 +748,6 @@ scoped_disable_cooperative_sigint_handling::~scoped_disable_cooperative_sigint_h struct active_ext_lang_state * set_active_ext_lang (const struct extension_language_defn *now_active) { -#if CXX_STD_THREAD - std::lock_guard guard (ext_lang_mutex); -#endif /* CXX_STD_THREAD */ - #if GDB_SELF_TEST if (selftests::hook_set_active_ext_lang) selftests::hook_set_active_ext_lang (); @@ -827,10 +800,6 @@ set_active_ext_lang (const struct extension_language_defn *now_active) void restore_active_ext_lang (struct active_ext_lang_state *previous) { -#if CXX_STD_THREAD - std::lock_guard guard (ext_lang_mutex); -#endif /* CXX_STD_THREAD */ - if (cooperative_sigint_handling_disabled) { /* See set_active_ext_lang. */ @@ -861,10 +830,6 @@ restore_active_ext_lang (struct active_ext_lang_state *previous) void set_quit_flag () { -#if CXX_STD_THREAD - std::lock_guard guard (ext_lang_mutex); -#endif /* CXX_STD_THREAD */ - if (active_ext_lang->ops != NULL && active_ext_lang->ops->set_quit_flag != NULL) active_ext_lang->ops->set_quit_flag (active_ext_lang); @@ -886,10 +851,6 @@ set_quit_flag () bool check_quit_flag () { -#if CXX_STD_THREAD - std::lock_guard guard (ext_lang_mutex); -#endif /* CXX_STD_THREAD */ - bool result = false; for (const struct extension_language_defn *extlang : extension_languages) diff --git a/gdb/python/python.c b/gdb/python/python.c index acd80e5515c..ecd9d8d5101 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1166,16 +1166,7 @@ gdbpy_post_event (PyObject *self, PyObject *args) static PyObject * gdbpy_interrupt (PyObject *self, PyObject *args) { - { - /* Make sure the interrupt isn't delivered immediately somehow. - This probably is not truly needed, but at the same time it - seems more clear to be explicit about the intent. */ - gdbpy_allow_threads temporarily_exit_python; - scoped_disable_cooperative_sigint_handling no_python_sigint; - - set_quit_flag (); - } - + kill (getpid (), SIGINT); Py_RETURN_NONE; } base-commit: e6828c8f629fd52d7b065c45d52b6bd04acd616f -- 2.43.0 ++++++ gdb-rpm-suggestion-script.patch ++++++ ++++ 1012 lines (skipped) ++++++ gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch ++++++ >From 6e547cf3a928dcf23db35fc7892401ce04c877fc Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Sun, 1 Jun 2025 14:06:01 +0200 Subject: [PATCH 1/6] [gdb/tdep] Fix gdb.ada/finish-var-size.exp on ppc64le-linux On openSUSE Tumbleweed ppc64le-linux using gcc 14.3.0, with a gdb 16.3 based package and test-case gdb.ada/finish-var-size.exp, I run into: ... (gdb) finish^M Run till exit from #0 pck.get (value=true) at pck.adb:19^M 0x0000000100004a20 in p () at finish-var-size/p.adb:18^M 18 V : Result_T := Get (True);^M Value returned is $1 = <error reading variable: \ Cannot access memory at address 0x0>^M (gdb) FAIL: gdb.ada/finish-var-size.exp: finish ... Function pck.get returns type Result_T: ... type Array_Type is array (1 .. 64) of Integer; type Maybe_Array (Defined : Boolean := False) is record Arr : Array_Type; Arr2 : Array_Type; end record; type Result_T (Defined : Boolean := False) is record case Defined is when False => Arr : Maybe_Array; when True => Payload : Boolean; end case; end record; ... and uses r3 as address of the return value, which means RETURN_VALUE_STRUCT_CONVENTION, but while executing finish_command we do: ... return_value = gdbarch_return_value_as_value (gdbarch, read_var_value (sm->function, nullptr, callee_frame), val_type, nullptr, nullptr, nullptr); ... and get: ... (gdb) p return_value $1 = RETURN_VALUE_REGISTER_CONVENTION ... This is caused by this check in ppc64_sysv_abi_return_value: ... /* In the ELFv2 ABI, aggregate types of up to 16 bytes are returned in registers r3:r4. */ if (tdep->elf_abi == POWERPC_ELF_V2 && valtype->length () <= 16 ... which succeeds because valtype->length () == 0. Fix this by also checking for !TYPE_HAS_DYNAMIC_LENGTH (valtype). [ I also tested a version of this patch using "!is_dynamic_type (valtype)" instead, but ran into a regression in test-case gdb.ada/variant-record.exp, because type T: ... Length : constant Positive := 8; subtype Name_T is String (1 .. Length); type A_Record_T is record X1 : Natural; X2 : Natural; end record; type Yes_No_T is (Yes, No); type T (Well : Yes_No_T := Yes) is record case Well is when Yes => Name : Name_T; when No => Unique_Name : A_Record_T; end case; end record; ... while being dynamic, also has a non-zero size, and is small enough to be returned in registers r3:r4. ] Fixing this causes the test-case to fail with the familiar: ... warning: Cannot determine the function return value. Try compiling with -fvar-tracking. ... and indeed using -fvar-tracking makes the test-case pass. Tested on ppc64le-linux. PR tdep/33000 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33000 --- gdb/ppc-sysv-tdep.c | 1 + gdb/testsuite/gdb.ada/finish-var-size.exp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index f317c94ef59..e5a28d40d34 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -2112,6 +2112,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, /* In the ELFv2 ABI, aggregate types of up to 16 bytes are returned in registers r3:r4. */ if (tdep->elf_abi == POWERPC_ELF_V2 + && !TYPE_HAS_DYNAMIC_LENGTH (valtype) && valtype->length () <= 16 && (valtype->code () == TYPE_CODE_STRUCT || valtype->code () == TYPE_CODE_UNION diff --git a/gdb/testsuite/gdb.ada/finish-var-size.exp b/gdb/testsuite/gdb.ada/finish-var-size.exp index 7b20d7d9b7d..a8a765abed8 100644 --- a/gdb/testsuite/gdb.ada/finish-var-size.exp +++ b/gdb/testsuite/gdb.ada/finish-var-size.exp @@ -22,7 +22,13 @@ require {expr [gcc_major_version] >= 12} standard_ada_testfile p -if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} { +set opts {} +lappend opts debug +if { [have_fvar_tracking] } { + lappend opts additional_flags=-fvar-tracking +} + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $opts] != ""} { return -1 } base-commit: 976171b383814e7b27146276bdc88efea08040b6 -- 2.43.0 ++++++ gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch ++++++ >From 0293f33bd589d8d3a4c9cbc889934975e5fe50f2 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Thu, 17 Apr 2025 17:57:29 +0200 Subject: [PATCH 2/2] [gdb/testsuite] Don't run to main in gdb.cp/cplusfuncs.exp After building gdb with -fsanitize=threads, and running test-case gdb.cp/cplusfuncs.exp, I run into a single timeout: ... FAIL: gdb.cp/cplusfuncs.exp: info function operator=( (timeout) ... and the test-case takes 2m33s to finish. This is due to expanding CUs from libstdc++. After de-installing package libstdc++6-debuginfo, the timeout disappears and testing time goes down to 9 seconds. Fix this by not running to main, which brings testing time down to 3 seconds. With a gdb built without -fsanitize=threads, testing time goes down from 11 seconds to less than 1 second. Tested on x86_64-linux. Reviewed-By: Keith Seitz <kei...@redhat.com> --- gdb/testsuite/gdb.cp/cplusfuncs.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp index d789a1dbc88..75466e2d6bb 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.exp +++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp @@ -579,7 +579,8 @@ proc do_tests {} { gdb_test_no_output "set width 0" - runto_main + # Don't run to main, to avoid loading and expanding debug info for + # libstdc++. gdb_test_no_output "set language c++" probe_demangler -- 2.43.0 ++++++ gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch ++++++ >From fb9de096f43a1494d11b8f17779159a96d0a0a63 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Tue, 15 Apr 2025 16:59:32 +0200 Subject: [PATCH 2/2] [gdb/testsuite] Fix gdb.ada/scalar_storage.exp on s390x On s390x-linux, with test-case gdb.ada/scalar_storage.exp we have: ... (gdb) print V_LE^M $1 = (value => 126, another_value => 12, color => 3)^M (gdb) FAIL: gdb.ada/scalar_storage.exp: print V_LE print V_BE^M $2 = (value => 125, another_value => 9, color => green)^M (gdb) KFAIL: $exp: print V_BE (PRMS: DW_AT_endianity on enum types) ... The KFAIL is incorrect in the sense that gdb is behaving as expected. The problem is incorrect debug info, so change this into an xfail. Furthermore, extend the xfail to cover V_LE. Tested on s390x-linux and x86_64-linux. Approved-By: Tom Tromey <t...@tromey.com> PR testsuite/32875 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32875 --- gdb/testsuite/gdb.ada/scalar_storage.exp | 28 ++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.ada/scalar_storage.exp b/gdb/testsuite/gdb.ada/scalar_storage.exp index 5dccaef8f14..5a7e0e6191c 100644 --- a/gdb/testsuite/gdb.ada/scalar_storage.exp +++ b/gdb/testsuite/gdb.ada/scalar_storage.exp @@ -33,10 +33,30 @@ if {![runto "storage.adb:$bp_location"]} { return } -gdb_test "print V_LE" "= \\(value => 126, another_value => 12, color => green\\)" +set re "value => 126, another_value => 12, color => green" # This requires a compiler fix that is in GCC 14. -if { ![gnatmake_version_at_least 14] } { - setup_kfail "DW_AT_endianity on enum types" *-*-* +set have_xfail [expr ![gnatmake_version_at_least 14]] +set re_color "(red|green|blue|$decimal)" +set re_xfail \ + "value => $decimal, another_value => $decimal, color => $re_color" + +set re_pre [string_to_regexp " = ("] +set re_post [string_to_regexp ")"] +set re $re_pre$re$re_post +set re_xfail $re_pre$re_xfail$re_post + +foreach var { V_LE V_BE } { + gdb_test_multiple "print $var" "" { + -re -wrap $re { + pass $gdb_test_name + } + -re -wrap $re_xfail { + if { $have_xfail } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } + } + } } -gdb_test "print V_BE" "= \\(value => 126, another_value => 12, color => green\\)" -- 2.43.0 ++++++ gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch ++++++ >From b96df07528a707ebcb25ac445481fc827cdb0cf1 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Thu, 5 Jun 2025 07:37:09 +0200 Subject: [PATCH 1/2] [gdb/testsuite] Fix gdb.base/bp-permanent.exp with gcc 15 With test-case gdb.base/bp-permanent.exp and gcc 15 I run into: ... gdb compile failed, bp-permanent.c: In function 'test_signal_nested': bp-permanent.c:118:20: error: passing argument 2 of 'signal' from \ incompatible pointer type [-Wincompatible-pointer-types] 118 | signal (SIGALRM, test_signal_nested_handler); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void (*)(void) In file included from bp-permanent.c:20: /usr/include/signal.h:88:57: note: expected '__sighandler_t' \ {aka 'void (*)(int)'} but argument is of type 'void (*)(void)' ... Fix this by adding an int parameter to test_signal_nested_handler. Tested on x86_64-linux. PR testsuite/32756 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32756 --- gdb/testsuite/gdb.base/bp-permanent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/bp-permanent.c b/gdb/testsuite/gdb.base/bp-permanent.c index 99f1c410bea..a733d3b17eb 100644 --- a/gdb/testsuite/gdb.base/bp-permanent.c +++ b/gdb/testsuite/gdb.base/bp-permanent.c @@ -101,7 +101,7 @@ test_signal_no_handler (void) } static void -test_signal_nested_handler () +test_signal_nested_handler (int sig) { test (); } base-commit: fb9de096f43a1494d11b8f17779159a96d0a0a63 -- 2.43.0 ++++++ gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch ++++++ >From f55b4c909bb988fd264bdcae417e5f6ebb17fd93 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Tue, 29 Apr 2025 17:30:07 +0200 Subject: [PATCH 5/6] [gdb/testsuite] Fix gdb.base/ptype.exp with gcc 15 With test-case gdb.base/ptype.exp and gcc 15 I run into: ... (gdb) ptype old_fptr^M type = double (*)(void)^M (gdb) FAIL: $exp: ptype old_fptr (compiler doesn't emit unprototyped types) ... Since C23, non-prototype function declarations are no longer supported, so "double (*old_fptr) ()" is interpreted as "double (*old_fptr) (void)". We could try to fix this by detecting the language dialect used, and accepting the output in that case, but that feels fragile. We could try to fix this by hard-coding the language dialect, but that doesn't work for all compilers. So instead, we opt for the simplest solution: just accept this output, and produce a pass. Tested on aarch64-linux. Approved-By: Tom Tromey <t...@tromey.com> PR testsuite/32756 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32756 --- gdb/testsuite/gdb.base/ptype.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp index bdec993dc2b..702839c87c9 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -544,10 +544,10 @@ proc ptype_maybe_prototyped { id prototyped plain { overprototyped "NO-MATCH" } fail "ptype $id (compiler doesn't emit prototyped types)" } -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" { - if { [test_compiler_info "armcc-*"] } { - setup_xfail "*-*-*" - } - fail "ptype $id (compiler doesn't emit unprototyped types)" + # C23 no longer supports non-prototype function declaration, in which + # case the overprototyped regexp is the expected one. Simply pass + # in all cases. + pass "ptype $id (overprototyped)" } } } -- 2.43.0 ++++++ gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch ++++++ >From bb86ddf7c6827ec9b467cc0107395f91b9cbc5d2 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Tue, 29 Apr 2025 17:30:07 +0200 Subject: [PATCH 6/6] [gdb/testsuite] Fix gdb.python/py-objfile.exp with gcc 15 When running test-case gdb.python/py-objfile.exp with gcc 15, we get: ... (gdb) p main^M $2 = {int (void)} 0x40066c <main>^M (gdb) FAIL: $exp: print main with debug info ... The source file declares main as "int main ()" ... and until C23 this meant a non-prototype function declaration and we'd have: ... (gdb) p main^M $2 = {int ()} 0x40066c <main>^M ... However, starting C23 "int main ()" is simply equivalent to "int main (void)". Fix this by: - declaring main as "int main (void)" in the test-case, and - updating the regexp to expect an "int (void)" prototype. Likewise in gdb.base/jit-bfd-name.exp. Tested on aarch64-linux. Approved-By: Tom Tromey <t...@tromey.com> PR testsuite/32756 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32756 --- gdb/testsuite/gdb.base/jit-bfd-name.exp | 6 ++++-- gdb/testsuite/gdb.base/jit-elf-solib.c | 2 +- gdb/testsuite/gdb.python/py-objfile.c | 2 +- gdb/testsuite/gdb.python/py-objfile.exp | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/jit-bfd-name.exp b/gdb/testsuite/gdb.base/jit-bfd-name.exp index 36c82a10d41..cd6fa046f0d 100644 --- a/gdb/testsuite/gdb.base/jit-bfd-name.exp +++ b/gdb/testsuite/gdb.base/jit-bfd-name.exp @@ -67,11 +67,13 @@ gdb_breakpoint [gdb_get_line_number "break here 1" $::main_srcfile] gdb_continue_to_breakpoint "break here 1" # Confirm that the two expected functions are available. +set re_f1 [string_to_regexp "int jit_function_0001(void)"] +set re_f2 [string_to_regexp "int jit_function_0002(void)"] gdb_test "info function ^jit_function" \ [multi_line \ "File \[^\r\n\]+jit-elf-solib.c:" \ - "${decimal}:\\s+int jit_function_0001\\(\\);" \ - "${decimal}:\\s+int jit_function_0002\\(\\);"] + "${decimal}:\\s+$re_f1;" \ + "${decimal}:\\s+$re_f2;"] # Capture the addresses of each JIT symfile. set symfile_addrs {} diff --git a/gdb/testsuite/gdb.base/jit-elf-solib.c b/gdb/testsuite/gdb.base/jit-elf-solib.c index f98d1d1f740..5cf960688ae 100644 --- a/gdb/testsuite/gdb.base/jit-elf-solib.c +++ b/gdb/testsuite/gdb.base/jit-elf-solib.c @@ -22,4 +22,4 @@ #error "Must define the FUNCTION_NAME macro to set a jited function name" #endif -int FUNCTION_NAME() { return 42; } +int FUNCTION_NAME(void) { return 42; } diff --git a/gdb/testsuite/gdb.python/py-objfile.c b/gdb/testsuite/gdb.python/py-objfile.c index 1c38ff9bc0b..1bf776fb809 100644 --- a/gdb/testsuite/gdb.python/py-objfile.c +++ b/gdb/testsuite/gdb.python/py-objfile.c @@ -19,7 +19,7 @@ int global_var = 42; static int __attribute__ ((used)) static_var = 50; int -main () +main (void) { int some_var = 0; return 0; diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp index 2f5b7752b43..4fcad2666df 100644 --- a/gdb/testsuite/gdb.python/py-objfile.exp +++ b/gdb/testsuite/gdb.python/py-objfile.exp @@ -144,7 +144,8 @@ gdb_test "python print (sep_objfile.owner.filename)" "${testfile}2" \ gdb_test "python print (sep_objfile.owner.username)" "${testfile}2" \ "Test user-name of owner of separate debug file" -gdb_test "p main" "= {int \\(\\)} $hex <main>" \ +set re_prototype [string_to_regexp "int (void)"] +gdb_test "p main" "= {$re_prototype} $hex <main>" \ "print main with debug info" # Separate debug files are not findable. -- 2.43.0 ++++++ gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch ++++++ >From dfe2f3417cbb50c46d4ecf5905615613511a7f72 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Fri, 2 May 2025 16:48:14 +0200 Subject: [PATCH 3/6] [gdb/testsuite] Fix gdb.reverse/time-reverse.exp timeout After building gdb with "-O0 -g -fsanitize=thread" on aarch64-linux, with test-case gdb.reverse/time-reverse.exp I run into: ... (gdb) continue^M Continuing.^M FAIL: $exp: mode=c: continue to breakpoint: marker2 (timeout) ... The problem is that instruction stepping gets stuck in a loop with this call stack: time -> __GI___clock_gettime -> __kernel_clock_gettime -> __cvdso_clock_gettime. This is not specific to fsanitize=thread, it just makes gdb slow, which makes instruction stepping slow, which results in the application getting stuck. I ran into this as well with a regular gdb build on a 32-bit i686 laptop with 1GB of memory, an inherently slow setup. In that instance, I was able to observe that the loop we're stuck in is the outer loop in do_coarse in linux kernel source lib/vdso/gettimeofday.c. Fix this by setting "record full insn-number-max" to 2000, and handling running into the limit. Initially I tried the approach of using "stepi 2000" instead of continue, but that made the issue more likely to show up (for instance, I observed it after building gdb with -O0 on aarch64-linux). Tested on aarch64-linux. Approved-By: Guinevere Larsen <guinev...@redhat.com> PR testsuite/32678 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32678 --- gdb/testsuite/gdb.reverse/time-reverse.exp | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp index 98085f0ebc9..5a77fcd09f5 100644 --- a/gdb/testsuite/gdb.reverse/time-reverse.exp +++ b/gdb/testsuite/gdb.reverse/time-reverse.exp @@ -45,6 +45,8 @@ proc test {mode} { # Activate process record/replay gdb_test_no_output "record" "turn on process record" + gdb_test_no_output "set record full stop-at-limit on" + gdb_test_no_output "set record full insn-number-max 2000" set re_srcfile [string_to_regexp $::srcfile] @@ -52,7 +54,29 @@ proc test {mode} { "Breakpoint $::decimal at $::hex: file .*$re_srcfile, line $::decimal.*" \ "set breakpoint at marker2" - gdb_continue_to_breakpoint "marker2" ".*$re_srcfile:.*" + set re_question \ + [string_list_to_regexp \ + "Do you want to auto delete previous execution log entries when" \ + " record/replay buffer becomes full" \ + { (record full stop-at-limit)?([y] or n)}] + set re_program_stopped \ + [multi_line \ + [string_to_regexp "Process record: stopped by user."] \ + "" \ + [string_to_regexp "Program stopped."]] + set re_marker2 [string_to_regexp "marker2 ()"] + gdb_test_multiple "continue" "continue to breakpoint: marker2" { + -re "$re_question " { + send_gdb "n\n" + exp_continue + } + -re -wrap "Breakpoint $::decimal, $re_marker2 .*" { + pass $gdb_test_name + } + -re -wrap "\r\n$re_program_stopped\r\n.*" { + unsupported $gdb_test_name + } + } # Show how many instructions we've recorded. gdb_test "info record" "Active record target: .*" -- 2.43.0 ++++++ gdb-testsuite-fix-timeout-in-gdb.multi-attach-while-.patch ++++++ >From e6828c8f629fd52d7b065c45d52b6bd04acd616f Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Fri, 6 Jun 2025 10:14:47 +0200 Subject: [PATCH] [gdb/testsuite] Fix timeout in gdb.multi/attach-while-running.exp With test-case gdb.multi/attach-while-running.exp usually I get: ... (gdb) run &^M Starting program: attach-while-running ^M (gdb) PASS: $exp: run & [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M add-inferior^M [New inferior 2]^M Added inferior 2 on connection 1 (native)^M (gdb) PASS: $exp: add-inferior ... or: ... (gdb) run & Starting program: attach-while-running (gdb) PASS: $exp: run & add-inferior [New inferior 2] Added inferior 2 on connection 1 (native) (gdb) PASS: $exp: add-inferior [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". ... but sometimes I run into: ... (gdb) run & Starting program: attach-while-running (gdb) PASS: $exp: run & add-inferior [New inferior 2] Added inferior 2 on connection 1 (native) (gdb) [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". FAIL: $exp: add-inferior (timeout) ... Fix this by using -no-prompt-anchor. Tested on x86_64-linux. --- 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 ca4fa635467..b67e03d87e8 100644 --- a/gdb/testsuite/gdb.multi/attach-while-running.exp +++ b/gdb/testsuite/gdb.multi/attach-while-running.exp @@ -49,7 +49,7 @@ proc do_test {} { } gdb_test -no-prompt-anchor "run &" - gdb_test "add-inferior" "Added inferior 2 on connection 1 .*" + gdb_test -no-prompt-anchor "add-inferior" "Added inferior 2 on connection 1 .*" gdb_test "inferior 2" "Switching to inferior 2 .*" set spawn_id [spawn_wait_for_attach $::binfile] base-commit: 0293f33bd589d8d3a4c9cbc889934975e5fe50f2 -- 2.43.0 ++++++ gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch ++++++ >From 84b4925c08c85d30c8116e0e87db08df8a835dec Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Wed, 30 Apr 2025 13:41:20 +0200 Subject: [PATCH 4/6] [gdb/testsuite] Handle asm frame in gdb.python/py-missing-objfile.exp On arm-linux, with test-case gdb.python/py-missing-objfile.exp I get: ... (gdb) whatis global_exec_var^M type = volatile exec_type^M (gdb) FAIL: $exp: initial sanity check: whatis global_exec_var ... instead of the expected "type = volatile struct exec_type". The problem is that the current language is ASM instead of C, because the inner frame at the point of the core dump has language ASM: ... #0 __libc_do_syscall () at libc-do-syscall.S:47 #1 0xf7882920 in __pthread_kill_implementation () at pthread_kill.c:43 #2 0xf784df22 in __GI_raise (sig=sig@entry=6) at raise.c:26 #3 0xf783f03e in __GI_abort () at abort.c:73 #4 0x009b0538 in dump_core () at py-missing-objfile.c:34 #5 0x009b0598 in main () at py-missing-objfile.c:46 ... Fix this by manually setting the language to C. Tested on arm-linux and x86_64-linux. PR testsuite/32445 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32445 --- gdb/testsuite/gdb.python/py-missing-objfile.exp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.python/py-missing-objfile.exp b/gdb/testsuite/gdb.python/py-missing-objfile.exp index 8afd5477453..8488047d105 100644 --- a/gdb/testsuite/gdb.python/py-missing-objfile.exp +++ b/gdb/testsuite/gdb.python/py-missing-objfile.exp @@ -79,6 +79,16 @@ proc setup_debugdir { dirname files } { # executable (when EXEC_LOADED is true) and/or the library (when LIB_LOADED # is true). proc check_loaded_debug { exec_loaded lib_loaded } { + set re_warn \ + [string_to_regexp \ + "Warning: the current language does not match this frame."] + set cmd "set lang c" + gdb_test_multiple $cmd "" { + -re -wrap "${cmd}(\r\n$re_warn)?" { + pass $gdb_test_name + } + } + if { $exec_loaded } { gdb_test "whatis global_exec_var" "^type = volatile struct exec_type" -- 2.43.0 ++++++ gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch ++++++ >From 5a533536994a8855e54e593ec83816e366ee35c9 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevr...@suse.de> Date: Fri, 2 May 2025 16:48:14 +0200 Subject: [PATCH 2/6] [gdb/testsuite] Make gdb.reverse/time-reverse.exp more robust I noticed that test-case gdb.reverse/time-reverse.exp contains: ... if [supports_process_record] { # Activate process record/replay gdb_test_no_output "record" "turn on process record" ... So I tried out forcing supports_process_record to 0, and got: ... FAIL: gdb.reverse/time-reverse.exp: mode=syscall: info record FAIL: gdb.reverse/time-reverse.exp: mode=syscall: reverse to marker1 FAIL: gdb.reverse/time-reverse.exp: mode=syscall: check time record FAIL: gdb.reverse/time-reverse.exp: mode=c: info record FAIL: gdb.reverse/time-reverse.exp: mode=c: reverse to marker1 FAIL: gdb.reverse/time-reverse.exp: mode=c: check time record ... Fix this by requiring supports_process_record alongside supports_reverse. I also noticed when running make-check-all.sh that there were a lot of failures with target board dwarf5-fission-debug-types. Fix this by not ignoring the result of "runto marker1". Then I noticed that $srcfile is used as a regexp. Fix this by applying string_to_regexp. Tested on x86_64-linux. Approved-By: Guinevere Larsen <guinev...@redhat.com> --- gdb/testsuite/gdb.reverse/time-reverse.exp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp index 35415a0fe1f..98085f0ebc9 100644 --- a/gdb/testsuite/gdb.reverse/time-reverse.exp +++ b/gdb/testsuite/gdb.reverse/time-reverse.exp @@ -20,6 +20,7 @@ # require supports_reverse +require supports_process_record standard_testfile @@ -38,23 +39,25 @@ proc test {mode} { return } - runto marker1 - - if [supports_process_record] { - # Activate process record/replay - gdb_test_no_output "record" "turn on process record" + if { ![runto marker1] } { + return } + # Activate process record/replay + gdb_test_no_output "record" "turn on process record" + + set re_srcfile [string_to_regexp $::srcfile] + gdb_test "break marker2" \ - "Breakpoint $::decimal at $::hex: file .*$::srcfile, line $::decimal.*" \ + "Breakpoint $::decimal at $::hex: file .*$re_srcfile, line $::decimal.*" \ "set breakpoint at marker2" - gdb_continue_to_breakpoint "marker2" ".*$::srcfile:.*" + gdb_continue_to_breakpoint "marker2" ".*$re_srcfile:.*" # Show how many instructions we've recorded. gdb_test "info record" "Active record target: .*" - gdb_test "reverse-continue" ".*$::srcfile:$::decimal.*" "reverse to marker1" + gdb_test "reverse-continue" ".*$re_srcfile:$::decimal.*" "reverse to marker1" # If the variable was recorded properly, the old contents (-1) # will be remembered. If not, new contents (current time) will be -- 2.43.0 ++++++ import-fedora.sh ++++++ --- /var/tmp/diff_new_pack.7uacNi/_old 2025-06-18 19:29:38.372820153 +0200 +++ /var/tmp/diff_new_pack.7uacNi/_new 2025-06-18 19:29:38.376820319 +0200 @@ -5,10 +5,12 @@ skip_patches=( # Not applicable for openSUSE. gdb-add-index.patch - gdb-6.3-rh-testversion-20041202.patch - gdb-6.8-bz466901-backtrace-full-prelinked.patch + gdb-test-show-version.patch # Dropped by fedora. + + # Already present. + gdb-fix-bg-execution-repeat.patch ) usage () ++++++ libipt-cmake4-patch ++++++ github.com/intel/libipt/issues/114 github.com/intel/libipt/commit/fa7d42d adapted to opensuse's source tree --- a/libipt-2.0.5/CMakeLists.txt +++ b/libipt-2.0.5/CMakeLists.txt @@ -25,7 +25,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(PT C) ++++++ qa.sh ++++++ --- /var/tmp/diff_new_pack.7uacNi/_old 2025-06-18 19:29:38.452823464 +0200 +++ /var/tmp/diff_new_pack.7uacNi/_new 2025-06-18 19:29:38.456823630 +0200 @@ -361,9 +361,6 @@ # https://sourceware.org/bugzilla/show_bug.cgi?id=32619 "FAIL: gdb.dap/eof.exp: exceptions in log file" - # https://sourceware.org/bugzilla/show_bug.cgi?id=32167 - "FAIL: gdb.base/bp-cmds-continue-ctrl-c.exp: (attach|run): stop with control-c" - # https://sourceware.org/bugzilla/show_bug.cgi?id=32688 "FAIL: gdb.threads/thread-specific-bp.exp: non_stop=on: continue to end"