CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
96 lines
2.6 KiB
Plaintext
96 lines
2.6 KiB
Plaintext
# Copyright 2024 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/>.
|
|
|
|
# Test detaching while the inferior is running. Basically:
|
|
#
|
|
# (gdb) attach PID
|
|
# (gdb) c&
|
|
# (gdb) detach
|
|
|
|
require can_spawn_for_attach
|
|
|
|
standard_testfile
|
|
|
|
if {[build_executable "failed to prepare" $testfile $srcfile {debug}] == -1} {
|
|
return
|
|
}
|
|
|
|
# The test proper. See description above.
|
|
|
|
proc test {} {
|
|
global binfile gdb_prompt
|
|
|
|
# This test requires executing commands while the target is
|
|
# running, which, when testing with the remote target, requires
|
|
# non-stop remote protocol. Until that variant of the RSP is the
|
|
# default, force target non-stop mode on.
|
|
set is_remote \
|
|
[expr {[target_info exists gdb_protocol] \
|
|
&& ([target_info gdb_protocol] == "remote" \
|
|
|| [target_info gdb_protocol] == "extended-remote")}]
|
|
|
|
save_vars { ::GDBFLAGS } {
|
|
if {$is_remote} {
|
|
append ::GDBFLAGS " -ex \"maint set target-non-stop on\""
|
|
}
|
|
clean_restart ${binfile}
|
|
}
|
|
|
|
set test_spawn_id [spawn_wait_for_attach $binfile]
|
|
set testpid [spawn_id_get_pid $test_spawn_id]
|
|
|
|
set any "\[^\r\n\]*"
|
|
|
|
# Iterate more than once so that we test re-attaching after
|
|
# detaching, in case GDB incorrectly detaches and the process
|
|
# crashes after the detach.
|
|
set n_iters 2
|
|
for {set iter 1} {$iter <= $n_iters} {incr iter} {
|
|
with_test_prefix "iter=$iter" {
|
|
set attached 0
|
|
|
|
gdb_test_multiple "attach $testpid" "attach" {
|
|
-re "Attaching to program:${any}process $testpid\r\n.*$gdb_prompt " {
|
|
pass $gdb_test_name
|
|
set attached 1
|
|
}
|
|
}
|
|
|
|
if {!$attached} {
|
|
break
|
|
}
|
|
|
|
gdb_test_multiple "continue &" "" {
|
|
-re "Continuing\.\r\n$::gdb_prompt " {
|
|
pass $gdb_test_name
|
|
}
|
|
}
|
|
|
|
gdb_test "detach" "Detaching from.*"
|
|
|
|
# Sleep a bit before reattaching to let the detached
|
|
# process crash and exit if e.g., GDB managed to leave
|
|
# breakpoint traps behind.
|
|
if {$iter != $n_iters} {
|
|
sleep 1
|
|
}
|
|
}
|
|
}
|
|
|
|
kill_wait_spawned_process $test_spawn_id
|
|
}
|
|
|
|
test
|