gdb/gdb-testsuite-fix-regexps-in-gdb.base-step-over-sysc.patch
Tom de Vries 7cb3ecbb8b - Patches added (manual import from fedora rawhide @ 52a4dab):
* gdb-rhbz1773651-gdb-index-internal-error.patch
- Patches added (backport from master):
  * gdb-support-rseq-auxvs.patch
  * gdb-symtab-fix-line-number-of-static-const-class-mem.patch
  * gdb-symtab-fix-too-many-symbols-in-gdbpy_lookup_stat.patch
  * gdb-symtab-handle-pu-in-iterate_over_some_symtabs.patch
  * gdb-symtab-work-around-pr-gas-29517.patch
  * gdb-testsuite-add-kfail-for-pr-ada-30908.patch
  * gdb-testsuite-add-xfail-for-gdb-29965-in-gdb.threads.patch
  * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-with-newer.patch
  * gdb-testsuite-fix-gdb.arch-i386-signal.exp-on-x86_64.patch
  * gdb-testsuite-fix-gdb.cp-m-static.exp-regression-on-.patch
  * gdb-testsuite-fix-gdb.dwarf2-nullptr_t.exp-with-cc-w.patch
  * gdb-testsuite-fix-regexps-in-gdb.base-step-over-sysc.patch
  * gdb-symtab-find-main-language-without-symtab-expansi.patch
  * gdb-testsuite-add-wait-for-index-cache-in-gdb.dwarf2.patch
- Patches moved (from "Backport from gdb-patches" to
  "Backports from master, available in next release"):
  * gdb-cli-handle-pending-c-after-rl_callback_read_char.patch
  * gdb-testsuite-add-have_host_locale.patch
- Maintenance script qa.sh:
  * Remove PR28463, PR28108, PR29247 and PR29160 kfails.
  * Remove PR30540, PR30908, PR29965 kfails.
  * Remove gdb.ada/mi_task_arg.exp kfail.
- Limit "Suggests: %{python}-Pygments" to SLE-15 and later.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=365
2023-10-26 08:58:08 +00:00

86 lines
3.2 KiB
Diff

From e492116f04d3b4d704c4f6f3259143d7fb16a03e Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevries@suse.de>
Date: Wed, 26 Jul 2023 11:53:31 +0200
Subject: [PATCH 03/12] [gdb/testsuite] Fix regexps in
gdb.base/step-over-syscall.exp
When running test-case gdb.base/step-over-syscall.exp without glibc debuginfo
installed, I get:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, 0x00007ffff7d4405e in vfork () from /lib64/libc.so.6^M
(gdb) PASS: gdb.base/step-over-syscall.exp: vfork: displaced=off: \
continue to vfork (1st time)
...
but with glibc debuginfo installed I get instead:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, 0x00007ffff7d4405e in __libc_vfork () at \
../sysdeps/unix/sysv/linux/x86_64/vfork.S:44^M
44 ENTRY (__vfork)^M
(gdb) FAIL: gdb.base/step-over-syscall.exp: vfork: displaced=off: \
continue to vfork (1st time)
...
The FAIL is due to a mismatch with regexp:
...
"Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*"
...
because it cannot match both ".* in " and the __libc_ prefix.
Fix this by using instead the regexp:
...
"Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*"
...
Tested on x86_64-linux.
---
gdb/testsuite/gdb.base/step-over-syscall.exp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp
index 424eee142fd..87ff2606d30 100644
--- a/gdb/testsuite/gdb.base/step-over-syscall.exp
+++ b/gdb/testsuite/gdb.base/step-over-syscall.exp
@@ -127,13 +127,13 @@ proc setup { syscall } {
gdb_test "break \*$syscall" "Breakpoint \[0-9\]* at .*"
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
"continue to $syscall (1st time)"
# Hit the breakpoint on $syscall for the first time. In this time,
# we will let PLT resolution done, and the number single steps we will
# do later will be reduced.
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
"continue to $syscall (2nd time)"
# Hit the breakpoint on $syscall for the second time. In this time,
# the address of syscall insn and next insn of syscall are recorded.
@@ -265,7 +265,7 @@ proc step_over_syscall { syscall } {
return -1
}
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
"continue to $syscall (3rd time)"
# Hit the breakpoint on $syscall for the third time. In this time, we'll set
@@ -333,7 +333,7 @@ proc break_cond_on_syscall { syscall follow_fork detach_on_fork } {
return -1
}
- gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
"continue to $syscall"
# Delete breakpoint syscall insns to avoid interference with other syscalls.
delete_breakpoints
--
2.35.3