gdb_test "print good" \
"= \\(false <repeats 196 times>\\)" \
- set have_xfail [expr $old_gcc && [string equal "$scenario" "minimal"]]
+ set have_xfail [expr {$old_gcc && [string equal "$scenario" "minimal"]}]
set re "= \\(false <repeats 196 times>\\)"
set re_xfail "= \\(0 => 0 <repeats 25 times>\\)"
require allow_ada_tests
# GCC 12 has the needed fix.
-require {expr [gcc_major_version] >= 12}
+require {expr {[gcc_major_version] >= 12}}
standard_ada_testfile p
set compilation_succeeded 1
break
}
-require {expr $compilation_succeeded}
+require {expr {$compilation_succeeded}}
foreach_with_prefix varname {Arr Packed_Arr} {
clean_restart ${testfile}
# declarations only") is required. The commit makes sure that file-scope
# function and variable declarations are emitted in dwarf. This allows the
# description of imported entries, making them available to the debugger.
-require {expr [gcc_major_version] >= 8}
+require {expr {[gcc_major_version] >= 8}}
standard_ada_testfile prog
continue
}
- if { [expr $size > $offset_d] } {
+ if {$size > $offset_d} {
# Field d fits in the size.
continue
}
}
}
-require {expr $interesting_discriminator != -1}
+require {expr {$interesting_discriminator != -1}}
foreach lang [gdb_supported_languages] {
with_test_prefix $lang {
}
}
-require {expr $lll_int_size == 8 || $lll_int_size == 16}
+require {expr {$lll_int_size == 8 || $lll_int_size == 16}}
gdb_test "print x" " = $max"
gdb_test "print x / 2" " = [expr {$max / 2}]"
# This test requires starting new inferior processes, skip it if the target
# board is a stub.
require !use_gdb_stub
-require {expr [have_startup_shell] != -1}
+require {expr {[have_startup_shell] != -1}}
standard_testfile
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
# Gcc 14 is the first release containing the fix for PR debug/111409.
-require {expr [gcc_major_version] >= 14}
+require {expr {[gcc_major_version] >= 14}}
standard_testfile .c -2.c
set compilation_succeeded 1
break
}
-require {expr $compilation_succeeded}
+require {expr {$compilation_succeeded}}
# Start with a fresh gdb.
clean_restart
# This does not work on boards that don't support inferior arguments.
require {!target_info exists noargs}
-require {expr [have_startup_shell] != -1}
+require {expr {[have_startup_shell] != -1}}
standard_testfile .c
# (via dejagnu) yet.
require {!is_remote target}
-require {expr [have_startup_shell] != -1}
+require {expr {[have_startup_shell] != -1}}
standard_testfile
if { [is_c_compiler_gcc] } {
# Gcc fully supports fextended-identifiers starting GCC 5.
- require {expr [gcc_major_version] >= 5}
+ require {expr {[gcc_major_version] >= 5}}
}
require {have_host_locale C.UTF-8}
set replay_gettimeofday [capture_command_output "disassemble gettimeofday" ""]
# the two disassemblies must be identical
- if ![string compare $live_gettimeofday $replay_gettimeofday] {
+ if {![string compare $live_gettimeofday $replay_gettimeofday]} {
pass "disassemble gettimeofday"
} else {
fail "disassemble gettimeofday"
return -1
}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
return -1
}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# gnu_ifunc (10): error: too many arguments to function 'gnu_ifunc'
# Generate a core file and test that GDB cannot find the
# executable.
clean_restart ${::testfile}2
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
set prepare_for_testing_done 0
source $srcdir/$subdir/dw-form-strx.exp.tcl
-require {expr $prepare_for_testing_done == 1}
+require {expr {$prepare_for_testing_done == 1}}
set re_dwarf_error \
[string_list_to_regexp \
set prepare_for_testing_done 0
source $srcdir/$subdir/dw-form-strx.exp.tcl
-require {expr $prepare_for_testing_done == 1}
+require {expr {$prepare_for_testing_done == 1}}
gdb_test "ptype global_var" "type = int"
}
}
-require {expr $cu1_expanded == 1}
+require {expr {$cu1_expanded == 1}}
# Now check that cu2 has an address range starting at main.
set cu2_blockvector_re \
}
}
- if ($found_final_breakpoint) {
+ if {$found_final_breakpoint} {
break
}
}
}
- if ($found_final_breakpoint) {
+ if {$found_final_breakpoint} {
break
}
continue
}
- if ($found_final_breakpoint) {
+ if {$found_final_breakpoint} {
break
}
set compilation_succeeded 1
break
}
-require {expr $compilation_succeeded}
+require {expr {$compilation_succeeded}}
# Start with a fresh gdb.
clean_restart ${::testfile}
}
}
- if ($found_dealloc_breakpoint) {
+ if {$found_dealloc_breakpoint} {
break
}
}
}
- if ($found_final_breakpoint) {
+ if {$found_final_breakpoint} {
break
}
}
}
- if ($found_final_breakpoint) {
+ if {$found_final_breakpoint} {
break
}
}
}
- if ($found_dealloc_breakpoint) {
+ if {$found_dealloc_breakpoint} {
break
}
}
}
- if ($found_final_breakpoint) {
+ if {$found_final_breakpoint} {
break
}
# initialization order of GDB.
with_test_prefix "reversed initialization" {
save_vars { env(GDB_REVERSE_INIT_FUNCTIONS) } {
- if [info exists env(GDB_REVERSE_INIT_FUNCTIONS)] {
+ if {[info exists env(GDB_REVERSE_INIT_FUNCTIONS)]} {
unset env(GDB_REVERSE_INIT_FUNCTIONS)
} else {
set env(GDB_REVERSE_INIT_FUNCTIONS) 1
"${explicit_source} -function ${fqc}$prototype${fqc}"] {
set complete_line "b $location"
set start [string first $range_ss $complete_line]
- set end [expr ($start + [string length $range_ss])]
+ set end [expr {($start + [string length $range_ss])}]
test_complete_prefix_range $complete_line $start $end
if {!$skip_check_bp} {
check_bp_locations_match_list "b $location" [list "$prototype"]
"-function $function -label label1"] {
set cmd "b $location"
- set input_line [string range $cmd 0 [expr [string length $cmd] - 3]]
+ set input_line [string range $cmd 0 [expr {[string length $cmd] - 3}]]
test_gdb_complete_unique $input_line $cmd
test_gdb_complete_unique $cmd $cmd
# cpls-abi-tag.cc:71:26: error:
# ‘abi_tag’ attribute applied to non-function ‘s’
# See gcc PR65046.
- require {expr [gcc_major_version] >= 5}
+ require {expr {[gcc_major_version] >= 5}}
}
if {[prepare_for_testing "failed to prepare" $testfile \
}
if { $march1 != "" } {
- require "have_compile_and_link_flag $march1"
+ require {have_compile_and_link_flag $march1}
}
if { $march2 != "" } {
- require "have_compile_and_link_flag $march2"
+ require {have_compile_and_link_flag $march2}
}
if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
foreach_with_prefix iter {1 2} {
delete_breakpoints
- if ![runto all_started] {
+ if {![runto all_started]} {
return 0
}
# command run while the top interpreter is MI results in the expected
# CLI output sent to MI's console.
with_test_prefix "mi" {
- if [mi_gdb_start] {
+ if {[mi_gdb_start]} {
return
}
mi_gdb_load ${binfile}
# case where DW_AT_entry_pc is not the first instruction of an inlined
# function, as can be the case in gcc 8.x with the
# -gstatement-frontiers work in place.
-require {expr ![is_c_compiler_gcc] || [supports_statement_frontiers]}
+require {expr {![is_c_compiler_gcc] || [supports_statement_frontiers]}}
standard_testfile
for { set i 0 } { $i < 5 } { incr i } {
with_test_prefix "iter $i" {
- set nr_skips [expr $i * $SKIP_DIRECTIVE_COUNT]
+ set nr_skips [expr {$i * $SKIP_DIRECTIVE_COUNT}]
install_skips $kind $text $nr_skips
gdb_test_python_run \
"SkipCommand\(\"skip-$kind-$nr_skips\", ${SKIP_STEP_COUNT}\)"
set v [linux_kernel_version]
if { $v != {} } {
set have_xfail \
- [expr [version_compare [list 5 5 0] <= $v] \
- && [version_compare $v < [list 6 1 0]]]
+ [expr {[version_compare [list 5 5 0] <= $v] \
+ && [version_compare $v < [list 6 1 0]]}]
}
set nonl_re \[^\r\n\]
set xfail_re \
with_test_prefix "sepdebug" {
gdb_exit
- set result [catch "exec eu-strip -g -f ${binfile}.debug ${binfile}" output]
+ set result [catch {exec eu-strip -g -f ${binfile}.debug ${binfile}} output]
verbose "result is $result"
verbose "output is $output"
if {$result != 0 || $output != ""} {
gdb_load $::binfile
with_rocm_gpu_lock {
- if ![runto_main] {
+ if {![runto_main]} {
return
}
gdb_load $::binfile
with_rocm_gpu_lock {
- if ![runto_main] {
+ if {![runto_main]} {
return
}
}
with_rocm_gpu_lock {
- if ![runto_main] {
+ if {![runto_main]} {
return
}
gdb_load $::binfile
with_rocm_gpu_lock {
- if ![runto_main] {
+ if {![runto_main]} {
return
}
gdb_load $::binfile
with_rocm_gpu_lock {
- if ![runto_main] {
+ if {![runto_main]} {
return
}
gdb_load $::binfile
with_rocm_gpu_lock {
- if ![runto_main] {
+ if {![runto_main]} {
return
}
set func "run_${test}_test"
set executable "$binfile-${test}"
- if [build_executable "failed to prepare" $executable $srcfile \
- [list debug pthreads additional_flags=-D${def}]] {
+ if {[build_executable "failed to prepare" $executable $srcfile \
+ [list debug pthreads additional_flags=-D${def}]]} {
return -1
}
set GDBFLAGS "$GDBFLAGS -ex \"set sysroot\""
}
- if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
}
# Test issuing "tstatus" right after the connection is dropped.
proc_with_prefix test_tstatus {} {
- if ![prepare] {
+ if {![prepare]} {
return
}
# is dropped.
proc_with_prefix test_unwind_nosyms {} {
- if ![prepare] {
+ if {![prepare]} {
return
}
# dropped.
proc_with_prefix test_unwind_syms {} {
- if ![prepare] {
+ if {![prepare]} {
return
}
# Test performing a stepi right after the connection is dropped.
proc_with_prefix test_stepi {} {
- if ![prepare] {
+ if {![prepare]} {
return
}
# The test then switches to the 'split' layout, and calculates the
# expected window sizes.
foreach_with_prefix cmd_size {20 12 5} {
- set src_size_before [expr 24 - ${cmd_size} - 1]
- set split_size [expr (24 - ${cmd_size}) / 2]
+ set src_size_before [expr {24 - ${cmd_size} - 1}]
+ set split_size [expr {(24 - ${cmd_size}) / 2}]
if { $split_size < 3 } {
# The minimum window size is 3, so force that.
set src_size_after 3
set asm_size_after 3
- } elseif { [expr $split_size % 2] == 0 } {
+ } elseif { $split_size % 2 == 0 } {
# The remaining space can be divided evenly between the two
# windows.
set src_size_after ${split_size}
# The space can't be divided evenly, the asm window will get
# the extra line.
set src_size_after ${split_size}
- set asm_size_after [expr ${split_size} + 1]
+ set asm_size_after [expr {${split_size} + 1}]
}
Term::command "layout src"
# Both windows should be of equal size, which will be their minimum.
Term::command "layout split"
Term::check_box "check for src window in split" 0 0 80 ${src_size_after}
- Term::check_box "check for asm window in split" 0 [expr ${src_size_after} - 1] 80 ${asm_size_after}
+ Term::check_box "check for asm window in split" \
+ 0 [expr {${src_size_after} - 1}] 80 ${asm_size_after}
}
}
with_test_prefix width-auto-detected {
- Term::with_tuiterm {*}$dims {
+ Term::with_tuiterm $lines $cols {
save_vars { ::INTERNAL_GDBFLAGS } {
# Avoid "set width 0" argument.
set INTERNAL_GDBFLAGS \