3b9ea5ed9e
* gdb-disable-commit-resumed-in-target_kill.patch * gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch * gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch * gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch * gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch * gdbserver-switch-to-right-process-in-find_one_thread.patch - Patches removed: * gdb-testsuite-fix-race-in-gdb.threads-detach-step-over.exp.patch - Maintenance script qa.sh: * Disable PR26284 kfails. * Add PR29841 kfails. * Add kfail_powerpc64le_sle12, kfail_s390 and kfail_s390x. * Add -s390 and -s390x. * Add gdb.base/gdb-rhbz1156192-recursive-dlopen.exp kfail. * Add PR26967 kfails. * Move PR27027 kfails from kfail_factory to kfail. * Add -ppc64le alias for -powerpc64le. * Add gdb.threads/interrupt-while-step-over.exp kfail. * Add gdb.tui/tui-layout-asm-short-prog.exp kfail. * Add unix/-fPIE/-fpie overrides -static kfails. * Add gdb.guile/scm-disasm.exp kfail. * Add gdb.base/gnu_vector.exp to existing kfail. * Add gdb.guile/scm-symtab.exp kfail. * Add gdb.base/write_mem.exp kfail. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=344
50 lines
1.3 KiB
Diff
50 lines
1.3 KiB
Diff
gdb: testsuite: add new gdb_attach to check "attach" command
|
|
|
|
This commit adds new gdb_attach to centralize the failure checking of
|
|
"attach" command. Return 0 if attach failed, otherwise return 1.
|
|
|
|
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
|
|
Change-Id: I553cf386cef60c67d38e331904b4aa01e132104a
|
|
|
|
---
|
|
gdb/testsuite/lib/gdb.exp | 26 ++++++++++++++++++++++++++
|
|
1 file changed, 26 insertions(+)
|
|
|
|
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
|
index 25c1572a53a..5104835a2a9 100644
|
|
--- a/gdb/testsuite/lib/gdb.exp
|
|
+++ b/gdb/testsuite/lib/gdb.exp
|
|
@@ -5146,6 +5146,32 @@ proc can_spawn_for_attach { } {
|
|
return 1
|
|
}
|
|
|
|
+# Centralize the failure checking of "attach" command.
|
|
+# Return 0 if attach failed, otherwise return 1.
|
|
+
|
|
+proc gdb_attach { testpid args } {
|
|
+ parse_args {
|
|
+ {pattern ""}
|
|
+ }
|
|
+
|
|
+ if { [llength $args] != 0 } {
|
|
+ error "Unexpected arguments: $args"
|
|
+ }
|
|
+
|
|
+ gdb_test_multiple "attach $testpid" "attach" {
|
|
+ -re -wrap "Attaching to.*ptrace: Operation not permitted\\." {
|
|
+ unsupported "$gdb_test_name (Operation not permitted)"
|
|
+ return 0
|
|
+ }
|
|
+ -re -wrap "$pattern" {
|
|
+ pass $gdb_test_name
|
|
+ return 1
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return 0
|
|
+}
|
|
+
|
|
# Kill a progress previously started with spawn_wait_for_attach, and
|
|
# reap its wait status. PROC_SPAWN_ID is the spawn id associated with
|
|
# the process.
|