1 # Copyright 2021-2022 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 standard_testfile ".S"
18 if { ![istarget "x86_64-*-*"] || ![is_lp64_target] } {
19 verbose "Skipping $testfile.exp"
23 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
27 # Helper procedure to go to probe NAME
29 proc goto_probe { name } {
32 gdb_test "break -pstap $name" "Breakpoint $decimal at $hex"
33 gdb_test "continue" "Breakpoint $decimal, main \\(\\) at .*\r\n.*STAP_PROBE1.*${name},.*\\)"
36 # Helper procedure to test the probe's argument
38 proc test_probe_value { value } {
39 gdb_test "print \$_probe_argc" "= 1"
40 gdb_test "print \$_probe_arg0" "= $value"
43 if { ![runto_main] } {
47 # Name and expected value for each probe.
48 set probe_names_and_values {
61 foreach probe_info $probe_names_and_values {
62 set name [lindex $probe_info 0]
63 set value [lindex $probe_info 1]
64 with_test_prefix $name {
66 test_probe_value $value