Running tclint on the test-cases in gdb.btrace shows a few problems.
Fix these.
Tested on x86_64-linux.
"gdb/testsuite/lib",
"gdb/testsuite/gdb.arch",
"gdb/testsuite/gdb.base",
-"gdb/testsuite/gdb.btrace",
"gdb/testsuite/gdb.cp",
"gdb/testsuite/gdb.dwarf2",
"gdb/testsuite/gdb.mi",
require allow_btrace_tests
standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
clean_restart $testfile
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
gdb_test "info record" "No recording is currently active\\." "info record without target"
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
load_lib gdbserver-support.exp
require allow_gdbserver_tests
clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# make sure record-btrace can be enabled after re-run
clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
gdb_test_no_output "record btrace" "enable after restart"
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
gdb_test_no_output "record btrace" "enable after re-run"
# We expect a specific function call history. This gets messed up with
# PIE on 32-bit.
standard_testfile exception.cc
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
- {nopie c++ debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ {nopie c++ debug}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# We expect a specific function call history. This gets messed up with
# PIE on 32-bit.
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile {} {nopie debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {nopie debug}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
] "indented"
# make sure we can handle incomplete trace with respect to indentation
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# navigate to the fib in line 24 above
require allow_btrace_tests
standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile .c .S
-if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require !use_gdb_stub
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
return -1
}
set host_binfile [gdb_remote_download host $binfile]
with_test_prefix "inferior 1" {
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
}
"add second inferior"
gdb_test "inferior 2" "Switching to inferior 2.*"
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
"add third inferior"
gdb_test "inferior 3" "Switching to inferior 3.*"
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
}
clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
clean_restart $testfile
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.btrace/ptwrite.exp COMPILE=1"
standard_testfile ptwrite.c
lappend opts debug additional_flags=-mptwrite
return -1
}
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
require allow_gdbserver_tests
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
require allow_btrace_tests
standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# Luckily, they are similar enough that a single test script can handle
# both.
set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.btrace/record_goto.exp COMPILE=1"
standard_testfile record_goto.c
lappend opts debug
return -1
}
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
- {debug ldflags=-Wl,-z,lazy}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ {debug ldflags=-Wl,-z,lazy}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_tests
standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
#
# Luckily, they are similar enough that a single test script can handle
# both.
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.btrace/stepi.exp COMPILE=1"
standard_testfile record_goto.c
lappend opts debug
return -1
}
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# Luckily, they are similar enough that a single test script can handle
# both.
set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.btrace/tailcall-only.exp COMPILE=1"
standard_testfile tailcall-only.c
lappend opts debug optimize=-O2
return -1
}
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# Luckily, they are similar enough that a single test script can handle
# both.
set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
# make check RUNTESTFLAGS="gdb.btrace/tailcall.exp COMPILE=1"
standard_testfile tailcall.c
lappend opts debug optimize=-O2
return -1
}
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require allow_btrace_pt_tests allow_tsx_tests
standard_testfile .c x86-tsx.S
-if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# PIE on 32-bit.
#
# Also discard local symbols.
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
- {ldflags=-Wl,-x nopie}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ {ldflags=-Wl,-x nopie}]} {
return -1
}
-if ![runto test] {
+if {![runto test]} {
return -1
}
require allow_btrace_tests
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}