Running tclint on the test-cases in gdb.reverse shows a few problems.
Fix these.
Tested on x86_64-linux.
"gdb/testsuite/gdb.fortran",
"gdb/testsuite/gdb.mi",
"gdb/testsuite/gdb.python",
-"gdb/testsuite/gdb.reverse",
"gdb/testsuite/gdb.threads",
"gdb/testsuite/gdb.trace",
# IGNORE (document reason in trailing comment):
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
set opts {}
standard_testfile .S
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.reverse/amd64-tailcall-reverse.exp COMPILE=1"
standard_testfile
lappend opts debug optimize=-O2
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if [supports_process_record] {
+if {[supports_process_record]} {
gdb_test_no_output "record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
-# Run until end, then save execution log.
+# Run until end, then save execution log.
set breakloc [gdb_get_line_number "end of main" "$srcfile"]
gdb_test "break $breakloc" \
return 0
}
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
# test only verified the reverse-finish command for a normal call that used
# the LEP.
-if ![supports_reverse] {
+if {![supports_reverse]} {
return
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay.
gdb_test_no_output "record" "turn on process record for test1"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
gdb_breakpoint $end temporary
gdb_continue_to_breakpoint "start ${function}_test"
- if [supports_process_record] {
+ if {[supports_process_record]} {
# Activate process record/replay.
gdb_test_no_output "record" "${function}: turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
gdb_test_no_output "record" "Turn on process record"
# This can take awhile.
set oldtimeout $timeout
-set timeout [expr $oldtimeout + 120]
+set timeout [expr {$oldtimeout + 120}]
gdb_test "until $location" ".*$srcfile:$location.*" \
"record to end of main"
set timeout $oldtimeout
}
# Registers contents after each backward single step.
- for {set i [expr $count - 1]} {$i >= 0} {incr i -1} {
+ for {set i [expr {$count - 1}]} {$i >= 0} {incr i -1} {
gdb_test -nopass "reverse-stepi"
set post_regs($i) [capture_command_output "info all-registers" ""]
}
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# This file is part of the GDB testsuite.
+# This file is part of the GDB testsuite.
# This test tests the restoration of various kinds of machine state
# to their original values with a process record log. We will execute
# the program forward while it changes various types of data, and
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# This file is part of the GDB testsuite.
+# This file is part of the GDB testsuite.
# This test tests the restoration of various kinds of machine state
# to their original values by reverse execution. We will execute
# the program forward while it changes various types of data, and
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
# change is printed, since any instruction must have at least a change
# to the PC.
-if ![supports_reverse] {
+if {![supports_reverse]} {
return
}
#confirm that GDB doesn't go crazy if recording isn't enabled
test_print false "" "print before starting to record"
-if ![supports_process_record] {
+if {![supports_process_record]} {
# No point in testing the rest if we can't record anything
return
}
return 0
}
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
} else {
xfail "$testmsg (handled)"
}
- }
+ }
}
}
runto gen_ABRT
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
-# Run until end, then save execution log.
+# Run until end, then save execution log.
set breakloc [gdb_get_line_number "end of main" "$srcfile"]
gdb_test "break $breakloc" \
"get signal TERM"
gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
-gdb_test "continue" " end of main .*" "continue to sigall exit"
+gdb_test "continue" " end of main .*" "continue to sigall exit"
foreach sig [lreverse $signals] {
test_one_sig_reverse $sig
} else {
xfail "$testmsg (handled)"
}
- }
+ }
}
}
runto gen_ABRT
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
standard_testfile ".S" "${gdb_test_file_name}-nodebug.S"
set executable ${testfile}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.reverse/singlejmp-reverse.exp COMPILE=1"
if { [build_executable_from_specs ${testfile}.exp $executable {} \
${testfile}.c {debug optimize=-O2} \
clean_restart $executable
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if [supports_process_record] {
+if {[supports_process_record]} {
gdb_test_no_output "record"
}
untested "failed to compile"
return -1
}
-
+
# Note: The test previously did "set debug-file-directory" to (try to)
# ensure the debug info for the dynamic loader and libc weren't found.
# This doesn't work if the debug info is in the .debug subdirectory.
untested "failed to compile"
return -1
}
-
+
# Note: The test previously did "set debug-file-directory" to (try to)
# ensure the debug info for the dynamic loader and libc weren't found.
# This doesn't work if the debug info is in the .debug subdirectory.
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
}
}
-re "ENTER CALLEE.*$gdb_prompt $" {
- send_gdb "stepi\n"
+ send_gdb "stepi\n"
exp_continue
}
-re "$pic_thunk_re.*$gdb_prompt $" {
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
}
}
-re "ENTER CALLEE.*$gdb_prompt $" {
- send_gdb "stepi\n"
+ send_gdb "stepi\n"
exp_continue
}
-re "$pic_thunk_re.*$gdb_prompt $" {
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-# This file is part of the GDB testsuite. It tests 'until' and
+# This file is part of the GDB testsuite. It tests 'until' and
# 'advance' in precord logfile.
# This test suitable only for process record-replay
"factorial .value=720.*${srcfile}:$bp_location19.*" \
"reverse-advance to final return of factorial"
-# Now do "until" across the recursive calls,
+# Now do "until" across the recursive calls,
# ending up in the same frame where we are now.
gdb_test "until $bp_location7" \
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-# This file is part of the GDB testsuite. It tests 'until' and
+# This file is part of the GDB testsuite. It tests 'until' and
# 'advance' in reverse debugging.
require supports_reverse
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
"factorial .value=720.*${srcfile}:$bp_location19.*" \
"reverse-advance to final return of factorial"
-# Now do "until" across the recursive calls,
+# Now do "until" across the recursive calls,
# ending up in the same frame where we are now.
gdb_test "until $bp_location7" \
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}
runto_main
-if [supports_process_record] {
+if {[supports_process_record]} {
# Activate process record/replay
gdb_test_no_output "record" "turn on process record"
}