Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

110 lines
3.9 KiB
Plaintext

# Copyright 2012-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/>.
# Tests for explicit linespecs
require allow_cplus_tests
standard_testfile .cc
set exefile $testfile
if {[prepare_for_testing "failed to prepare" $exefile $srcfile \
{c++ debug nowarnings}]} {
return -1
}
# Wrap this whole test in a namespace to avoid contaminating other tests.
namespace eval $testfile {
# Test the given (explicit) LINESPEC which should cause gdb to break
# at LOCATION.
proc test_breakpoint {linespec location} {
# Delete all breakpoints, watchpoints, tracepoints, and catchpoints,
# set a new breakpoint at LINESPEC, and attempt to run to it.
delete_breakpoints
gdb_breakpoint $linespec
gdb_continue_to_breakpoint $linespec $location
}
# Add the given LINESPEC to the array named in THEARRAY. GDB is expected
# to stop at LOCATION.
proc add {thearray linespec location} {
upvar $thearray ar
lappend ar(linespecs) $linespec
lappend ar(locations) $location
}
# Some locations used in this test
variable lineno
variable location
set lineno(normal) [gdb_get_line_number "myfunction location" $srcfile]
set lineno(entry) [gdb_get_line_number "entry location" $srcfile]
set lineno(top) [gdb_get_line_number "top location" $srcfile]
set lineno(operator) [gdb_get_line_number "operator location" $srcfile]
foreach v [array names lineno] {
set location($v) ".*[string_to_regexp "$srcfile:$lineno($v)"].*"
}
# A list of explicit linespecs and the corresponding location
variable linespecs
set linespecs(linespecs) {}
set linespecs(location) {}
add linespecs "-source $srcfile -function myclass::myfunction" \
$location(normal)
add linespecs "-source $srcfile -function myclass::myfunction -label top" \
$location(top)
# This isn't implemented yet; -line is silently ignored.
add linespecs \
"-source $srcfile -function myclass::myfunction -label top -line 3" \
$location(top)
add linespecs "-source $srcfile -line $lineno(top)" $location(top)
add linespecs "-function myclass::myfunction" $location(normal)
add linespecs "-function myclass::myfunction -label top" $location(top)
# These are also not yet supported; -line is silently ignored.
add linespecs "-function myclass::myfunction -line 3" $location(normal)
add linespecs "-function myclass::myfunction -label top -line 3" \
$location(top)
add linespecs "-line 25" $location(normal)
add linespecs "-function myclass::operator," $location(operator)
add linespecs "-function 'myclass::operator,'" $location(operator)
add linespecs "-function \"myclass::operator,\"" $location(operator)
# Fire up gdb.
if {![runto_main]} {
namespace delete $testfile
return -1
}
# Test explicit linespecs, with and without conditions.
foreach linespec $linespecs(linespecs) loc_pattern $linespecs(locations) {
# Test the linespec
test_breakpoint $linespec $loc_pattern
}
# Special (orphaned) dprintf cases.
gdb_test "dprintf -function myclass::operator,,\"hello\"" \
"Dprintf .*$srcfile, line $lineno(operator)\\."
gdb_test "dprintf -function 'myclass::operator,',\"hello\"" \
"Dprintf .*$srcfile, line $lineno(operator)\\."
gdb_test "dprintf -function \"myclass::operator,\",\"hello\"" \
"Dprintf .*$srcfile, line $lineno(operator)\\."
}
namespace delete $testfile