Running tclint on the test-cases in gdb.ada shows a few problems.
Fix these.
Tested on x86_64-linux.
set bp_location [gdb_get_line_number "START" ${testdir}/bar.adb]
if {![runto "bar.adb:$bp_location"]} {
return
-}
+}
gdb_test "print itable'first" \
"= 2"
proc gdb_test_with_xfail { cmd re re_xfail msg } {
global scenario old_gcc
- set have_xfail [expr $old_gcc && [string equal "$scenario" "minimal"]]
+ set have_xfail [expr {$old_gcc && [string equal "$scenario" "minimal"]}]
gdb_test_multiple $cmd $msg {
-re -wrap $re {
gdb_test_no_output "set print array-indexes off"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print one_two_three" \
"= \\(false, true, true\\)" \
"print p_one_two_three, indexes off"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print few_reps" \
"= \\(1, 2, 3, 3, 3, 3, 3, 4, 5\\)" \
"print few_reps, indexes off"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print many_reps" \
"= \\(1, 2, 3 <repeats 12 times>, 4, 5\\)" \
"print many_reps, indexes off"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print empty" \
gdb_test_no_output "set print array-indexes on"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print one_two_three" \
gdb_test "print p_one_two_three" \
"= \\(one => false, two => true, three => true\\)"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print few_reps" \
"= \\(1 => 1, 2 => 2, 3 => 3, 4 => 3, 5 => 3, 6 => 3, 7 => 3, 8 => 4, 9 => 5\\)"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print many_reps" \
"= \\(1 => 1, 2 => 2, 3 => 3 <repeats 12 times>, 15 => 4, 16 => 5\\)"
-if $old_gcc {
+if {$old_gcc} {
setup_xfail "*-*-*"
}
gdb_test "print empty" \
gdb_test_no_output {maint expand-symtabs "\(pck\|foo\)\.adb"}
set gcc_major_version [gcc_major_version]
-set have_xfail [expr $gcc_major_version >= 8 && $gcc_major_version <= 9]
+set have_xfail [expr {$gcc_major_version >= 8 && $gcc_major_version <= 9}]
# The xfail is for PR gcc/94469, which occurs with target board
# unix/-flto/-O0/-flto-partition=none/-ffat-lto-objects and gcc-8 and later.
[multi_line "p external_identical_one" \
"p external_identical_two" ]
-# Complete on the name of package.
+# Complete on the name of package.
test_gdb_complete "pck" \
[multi_line_with_optional \
"(p pck)?" \
# Author: P. N. Hilfinger, AdaCore Inc.
# Note: This test is essentially a transcription of gdb.cp/formatted-ref.exp,
-# and is thus much more wordy than it needs to be. There are fewer
-# tests because only a few parameter types in Ada are required to be
+# and is thus much more wordy than it needs to be. There are fewer
+# tests because only a few parameter types in Ada are required to be
# passed by reference, and there is no equivalent of &(&x) for reference
# values.
# This also tests that some other arithmetic operations on references
gdb_test_multiple "$test" $test {
-re "\\$\[0-9\]+ = [string_to_regexp $val].*$gdb_prompt $" {
pass $test
- }
+ }
-re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
fail "$test (prints just address)"
}
if {![runto break_me]} {
return
-}
+}
# First, print all the arrays without indexes
if {![runto_main]} {
return
-}
+}
# Some variables used to simplify the maintenance of some of
# the regular expressions below.
lappend opts debug
set compilation_succeeded 0
-for { set size $max } { $size >= $min } { set size [expr $size / 2] } {
+for { set size $max } { $size >= $min } { set size [expr {$size / 2}] } {
set try_opts [concat $opts [list additional_flags=-gnateDCRASHGDB=$size]]
# Use gdb_compile_ada_1 to prevent failed compilations from producing a
# FAIL.
# Set the max-value-size so we can only print 33 elements.
set elements 33
set elem_size [get_valueof "/d" "(Large_1d_Array(1)'Size + 7) / 8" "*unknown*"]
-gdb_test_no_output "set max-value-size [expr $elem_size * $elements]"
+gdb_test_no_output "set max-value-size [expr {$elem_size * $elements}]"
with_test_prefix "with reduced max-value size" {
# GNAT historically named this type, but as the array type is
set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
return
- }
+ }
# GNAT 9 and 10 are known to fail.
if {$scenario == "minimal"
if {[gnat_version_compare <= {4 4}]} {
# Ada array bounds are missing in older GCCs.
- setup_xfail *-*-*
+ setup_xfail *-*-*
}
gdb_test "print my_table" \
"= \\(\\)"
if {![runto pck.adb:20]} {
return
-}
+}
gdb_test_no_output "set print frame-arguments all"
set re "value => 126, another_value => 12, color => green"
# This requires a compiler fix that is in GCC 14.
-set have_xfail [expr ![gnat_version_compare >= 14]]
+set have_xfail [expr {![gnat_version_compare >= 14]}]
set re_color "(red|green|blue|$decimal)"
set re_xfail \
"value => $decimal, another_value => $decimal, color => $re_color"
set bp_location [gdb_get_line_number "START" ${testdir}/p.adb]
if {![runto "p.adb:$bp_location"]} {
return
-}
+}
gdb_test "print w.e.all" \
"= \\(month => 8, year => 1974\\)"
require {expr $lll_int_size == 8 || $lll_int_size == 16}
gdb_test "print x" " = $max"
-gdb_test "print x / 2" " = [expr $max / 2]"
-gdb_test "print (x / 4) * 2" " = [expr ($max / 4) * 2]"
+gdb_test "print x / 2" " = [expr {$max / 2}]"
+gdb_test "print (x / 4) * 2" " = [expr {($max / 4) * 2}]"
gdb_test "print x - x" " = 0"
-gdb_test "print x - 99 + 1" " = [expr $max - 99 + 1]"
+gdb_test "print x - 99 + 1" " = [expr {$max - 99 + 1}]"
gdb_test "print -x" " = -$max"
gdb_test "print +x" " = $max"
set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
return
-}
+}
# Accept "foo." prefix for older versions of GNAT.
gdb_test "whatis full" \