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
114 lines
3.4 KiB
Plaintext
114 lines
3.4 KiB
Plaintext
# Copyright 2023-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/>.
|
|
|
|
# Check that sending GDB a SIGINT while handling execution control
|
|
# does not interrupt the execution control.
|
|
|
|
# The way we get the pid of gdb doesn't work with remote host. We get the
|
|
# pid of the ssh session on build instead.
|
|
require {!is_remote host}
|
|
|
|
standard_testfile
|
|
|
|
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
|
|
return -1
|
|
}
|
|
|
|
# Run the test. Sets a breakpoint with a condition that sends a
|
|
# SIGINT to GDB, and ensures that that doesn't make the breakpoint hit
|
|
# cause a premature stop. This emulates pressing Ctrl-C just while
|
|
# GDB is evaluating the breakpoint condition.
|
|
#
|
|
# AFTER_KILL_COND is appended to the breakpoint condition, after "kill
|
|
# -SIGINT $gdb_pid".
|
|
proc test { {after_kill_cond ""} } {
|
|
clean_restart $::binfile
|
|
|
|
if {![runto_main]} {
|
|
return
|
|
}
|
|
|
|
delete_breakpoints
|
|
|
|
set gdb_pid [exp_pid -i [board_info host fileid]]
|
|
|
|
# Set a breakpoint with a condition that sends a SIGINT to GDB. This
|
|
# emulates pressing Ctrl-C just while GDB is evaluating the breakpoint
|
|
# condition.
|
|
gdb_test \
|
|
"break foo if \$hit_count\+\+ == 1 || \$_shell(\"kill -INT $gdb_pid\") != 0 $after_kill_cond" \
|
|
"Breakpoint .*" \
|
|
"break foo if <condition>"
|
|
|
|
for { set i 0 } { $i < 10 } { incr i } {
|
|
set done 0
|
|
with_test_prefix $i {
|
|
|
|
# A counter used in the breakpoint's condition to ensure that it
|
|
# causes a stop after one hit.
|
|
gdb_test "p \$hit_count = 0" " = 0" "reset hit counter"
|
|
|
|
# Number of times we've seen GDB print "Quit" followed by the
|
|
# prompt. We should see that exactly one time.
|
|
set quit_count 0
|
|
|
|
gdb_test_multiple "c&" "SIGINT does not interrupt background execution" {
|
|
-re "^c&\r\nContinuing\\.\r\n$::gdb_prompt " {
|
|
exp_continue
|
|
}
|
|
-re "^Quit\r\n$::gdb_prompt " {
|
|
incr quit_count
|
|
verbose -log "quit_count=$quit_count"
|
|
exp_continue
|
|
}
|
|
-re "^\r\nBreakpoint .*return 0;" {
|
|
gdb_assert {$quit_count == 1} $gdb_test_name
|
|
}
|
|
-re ".*Asynchronous execution not supported on this target\..*" {
|
|
unsupported "$gdb_test_name (asynchronous execution not supported)"
|
|
}
|
|
timeout {
|
|
set done 1
|
|
fail "$gdb_test_name (timeout)"
|
|
}
|
|
}
|
|
|
|
if { $done } {
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
# Test without writing to memory after killing GDB. This does not
|
|
# take any Python path at the time of writing.
|
|
with_test_prefix "no force memory write" {
|
|
test
|
|
}
|
|
|
|
# Writing to memory from the condition makes GDB enter Python for
|
|
# reporting a memory changed event. Thus this tests that GDB doesn't
|
|
# forward the SIGINT to Python, interrupting Python, causing the
|
|
# breakpoint to prematurely stop like:
|
|
#
|
|
# c&
|
|
# Continuing.
|
|
# (gdb) Error in testing breakpoint condition:
|
|
# Quit
|
|
#
|
|
with_test_prefix "force memory write" {
|
|
test " || (global = 0)"
|
|
}
|