SHA256
8
0
forked from pool/gdb
Files
gdb/gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch
Tom de Vries 356d71c00b - Update to fedora rawhide @ c65d4ba.
Patched dropped:
  * gdb-6.6-buildid-locate-tests.patch
  Patches modified:
  * gdb-add-rpm-suggestion-script.patch
- Update to fedora rawhide @ 12e32a6.
  Patches modified:
  * gdb-add-rpm-suggestion-script.patch
  * gdb-backport-buildid-related-changes.patch
  * gdb-remove-qnx-neutrino-support.patch
- Update to fedora rawhide @ 264209d.
  Maintenance script import-fedora.sh:
  * Drop gdb-rhbz1156192-recursive-dlopen-test.patch
    from skip_patches.
- Update to fedora rawhide @ 020018c.
  Maintenance script import-fedora.sh:
  * Drop gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch from
    skip_patches.
- Update to fedora rawhide @ 1e3eb79.
  Maintenance script import-fedora.sh:
  * Drop gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch from
    skip_patches.
- Update to fedora rawhide @ 1a098a7.
  Patches dropped:
  * gdb-6.3-gstack-20050411.patch
  * gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch
- Update to fedora rawhide @ 5fc2d96.
  Patches dropped:
  * gdb-backport-buildid-related-changes.patch
  * gdb-catchpoint-re-set.patch
  * gdb-remove-qnx-neutrino-support.patch
- Update to fedora rawhide @ 6b0ca99 (gdb 16.2).
  Patches updated (fedora):
  * gdb-add-rpm-suggestion-script.patch
  Maintenance script qa-local.sh:
  * Update version to 16.2.
  Patches updated:
  * gdb-testsuite-ada-pie.patch
  * gdb-tui-enable-work-around-libncurses-segfault.patch
  * gdb-guile-use-scm_debug_typing_strictness-0.patch
  * add-gdbarch_dwarf2_reg_piece_offset-hook.patch
  * gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch
  * gdb-cli-add-ignore-errors-command.patch
  * fixup-gdb-add-rpm-suggestion-script.patch
  Patches dropped:
  * gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch  
  * gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch
  * gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch
  * fix-gdb.dap-step-out.exp-on-s390x.patch
  * fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch
  * gdb-build-fix-unused-var-in-corelow.c.patch
  * gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch
  * gdb-prune-inferior-after-switching-inferior.patch
  * gdb-record-fix-out-of-bounds-write-in-aarch64_record.patch
  * gdb-symtab-fix-target-type-of-complex-long-double-on.patch
  * gdb-symtab-return-correct-reader-for-top-level-cu-in.patch
  * gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch
  * gdb-tdep-fix-recording-of-t1-push.patch
  * gdb-tdep-handle-sycall-statx-for-arm-linux.patch
  * gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch
  * gdb-tdep-s390-add-arch15-record-replay-support.patch
  * gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch
  * gdb-testsuite-don-t-use-set-auto-solib-add-off.patch
  * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch
  * gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch
  * gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch
  * gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch
  * gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch
  * gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch
  * gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch
  * gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch
  * gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch
  * gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch
  * gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch
  * gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch
  * gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch
  * gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch
  * gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch
  * gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch
  * gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch
  * gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch
  * handle-address-class-annotation-for-s390x-in-some-te.patch
  * opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch
  * s390-add-arch15-concurrent-functions-facility-insns.patch
  * s390-add-arch15-instruction-names.patch
  * s390-add-arch15-instructions.patch
  * s390-align-opcodes-to-lower-case.patch
  * s390-fix-disassembly-of-optional-addressing-operands.patch
  * s390-relax-risbg-n-z-risb-h-l-gz-rns-ros-rxs-bgt-ope.patch
  * s390-simplify-dis-assembly-of-insn-operands-with-con.patch
  * s390-treat-addressing-operand-sequence-as-one-in-dis.patch
  * use-setvariable-in-gdb.dap-scopes.exp.patch
  Patches added:
  * gdb-testsuite-fix-gdb.dwarf2-implptr.exp-regression.patch
  * gdb-testsuite-work-around-pr32850.patch
  * gdb-symtab-fix-gdb.base-fission-macro.exp-with-unix-.patch
  * gdb-testsuite-fix-another-timeout-in-gdb.base-bg-exe.patch
- Add "BuildRequires: glibc-locale" for gdb:testsuite to fix
  SLFO testsuite failures.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=454
2025-04-10 03:19:12 +00:00

106 lines
4.1 KiB
Diff

From cc96eb70e17260381e6c59c8de671468b59eee7f Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevries@suse.de>
Date: Thu, 16 Jan 2025 09:39:55 +0100
Subject: [PATCH] [gdb/testsuite] Fix timeouts in
gdb.threads/step-over-thread-exit.exp
Once in a while, I run into a timeout in test-case
gdb.threads/step-over-thread-exit.exp:
...
(gdb) continue^M
Continuing.^M
[New Thread 0xfffff7cff1a0 (LWP 2874854)]^M
^M
Thread 97 "step-over-threa" hit Breakpoint 2, 0x0000000000410314 in \
my_exit_syscall () at gdb/testsuite/lib/my-syscalls.S:74^M
74 SYSCALL (my_exit, __NR_exit)^M
(gdb) [Thread 0xfffff7cff1a0 (LWP 2874853) exited]^M
FAIL: $exp: step_over_mode=displaced: non-stop=on: target-non-stop=on: \
schedlock=off: cmd=continue: ns_stop_all=0: iter 95: continue (timeout)
...
I can reproduce it more frequently by running with taskset -c <slow core id>.
Fix this by using -no-prompt-anchor.
This requires us to add -no-prompt-anchor to proc gdb_test_multiple.
Tested on aarch64-linux.
PR testsuite/32489
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32489
---
gdb/testsuite/gdb.threads/step-over-thread-exit.exp | 5 +++--
gdb/testsuite/lib/gdb.exp | 9 ++++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
index 8eb93995657..98cc94e9528 100644
--- a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
+++ b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
@@ -193,7 +193,7 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} {
with_test_prefix "iter $i" {
set ok 0
set thread "<unknown>"
- gdb_test_multiple "continue" "" {
+ gdb_test_multiple "continue" "" -no-prompt-anchor {
-re -wrap "Thread ($::decimal) .*hit Breakpoint $::decimal.* my_exit_syscall .*" {
set thread $expect_out(1,string)
set ok 1
@@ -206,7 +206,8 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} {
}
if {${non-stop}} {
- gdb_test -nopass "thread $thread" "Switching to thread .*" \
+ gdb_test -nopass -no-prompt-anchor "thread $thread" \
+ "Switching to thread .*" \
"switch to event thread"
}
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 577eb9368cf..b103c117258 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1024,6 +1024,10 @@ proc command_to_message { command } {
# if one of them matches. If MESSAGE is empty COMMAND will be used.
# -prompt PROMPT_REGEXP specifies a regexp matching the expected prompt
# after the command output. If empty, defaults to "$gdb_prompt $".
+# -no-prompt-anchor specifies that if the default prompt regexp is used, it
+# should not be anchored at the end of the buffer. This means that the
+# pattern can match even if there is stuff output after the prompt. Does not
+# have any effect if -prompt is specified.
# -lbl specifies that line-by-line matching will be used.
# EXPECT_ARGUMENTS will be fed to expect in addition to the standard
# patterns. Pattern elements will be evaluated in the caller's
@@ -1123,6 +1127,7 @@ proc gdb_test_multiple { command message args } {
set line_by_line 0
set prompt_regexp ""
+ set prompt_anchor 1
for {set i 0} {$i < [llength $args]} {incr i} {
set arg [lindex $args $i]
if { $arg == "-prompt" } {
@@ -1130,6 +1135,8 @@ proc gdb_test_multiple { command message args } {
set prompt_regexp [lindex $args $i]
} elseif { $arg == "-lbl" } {
set line_by_line 1
+ } elseif { $arg == "-no-prompt-anchor" } {
+ set prompt_anchor 0
} else {
set user_code $arg
break
@@ -1141,7 +1148,7 @@ proc gdb_test_multiple { command message args } {
error "Too few arguments to gdb_test_multiple"
}
- set prompt_regexp [fill_in_default_prompt $prompt_regexp true]
+ set prompt_regexp [fill_in_default_prompt $prompt_regexp $prompt_anchor]
if { $message == "" } {
set message [command_to_message $command]
base-commit: cd4f4a663f82e2f8bee58f3ef000964a2dd82769
--
2.43.0