Running tclint on the test-cases in gdb.trace shows a few problems.
Fix these.
"gdb/testsuite/gdb.cp",
"gdb/testsuite/gdb.dwarf2",
"gdb/testsuite/gdb.mi",
-"gdb/testsuite/gdb.trace",
# IGNORE (document reason in trailing comment):
"gdb/testsuite/gdb.stabs", # To be removed.
]
clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
return
}
-set testline1 [expr $baseline + 7]
+set testline1 [expr {$baseline + 7}]
#
# test actions command
# 5.6 actions for invalid tracepoint number
-gdb_test "actions [expr $trcpt2 + $trcpt3]" \
- "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+gdb_test "actions [expr {$trcpt2 + $trcpt3}]" \
+ "No tracepoint number [expr {$trcpt2 + $trcpt3}]." \
"5.6: actions for invalid tracepoint number"
# 5.7 invalid action (other than 'collect', 'while-stepping' or 'end')
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
require gdb_trace_common_supports_arch
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- [list debug nowarnings nopie]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ [list debug nowarnings nopie]]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
proc gdb_backtrace_tdp_1 { msg } {
global gdb_prompt
-
+
# We are in a trace frame at which we didn't collect anything
# except $PC. Therefore we expect to be able to identify stack
# frame #0, but that's about all. In particular we do not expect
# to be able to display the function's arguments or locals, and we
# do not expect to be able to identify the caller of this function.
-
+
gdb_test "backtrace" \
"#0\[\t \]+gdb_recursion_test.*depth=.*" \
"$msg"
gdb_load_shlib $lib_sl1
gdb_load_shlib $lib_sl2
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
global gdb_prompt
clean_restart ${testfile}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
gdb_test_no_output "delete break 1"
set test "set tracepoint on set_tracepoint"
gdb_test_multiple "${trace_type} set_tracepoint" $test {
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# The target was unable to install the fast tracepoint
# (e.g., jump pad too far from tracepoint).
pass "$test (too far)"
set test "continue to marker 2"
gdb_test_multiple "continue" $test {
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# Expected if the target was unable to install the
# fast tracepoint (e.g., jump pad too far from
# tracepoint).
pass "tstart"
}
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# The target was unable to install the fast tracepoint
# (e.g., jump pad too far from tracepoint).
pass "$test (too far)"
global gdb_prompt
# This test only makes sense with remote targets.
- if ![gdb_protocol_is_remote] {
+ if {![gdb_protocol_is_remote]} {
return
}
clean_restart ${testfile}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
#
# Set a tracepoint on given func. The tracepoint is set at entry
-# address and not 'after prologue' address because we use
+# address and not 'after prologue' address because we use
# 'tfind pc func' to find the corresponding trace frame afterwards,
# and that looks for entry address.
proc set_a_tracepoint { func } {
return -1
}
-# Tests:
+# Tests:
# 1) $args
# 2) function args by name
# 3) $locs
gdb_collect_registers_test "\$$fpreg, \$$spreg, \$$pcreg"
gdb_collect_globals_test
gdb_collect_global_in_pieces_test
-
+
#
# Expression tests:
#
# x[(y, z)] (tests comma expression) (ditto)
# cast expr
# stack data
-
+
gdb_collect_expression_test globals_test_func \
"globalstruct.memberi" "82" "a.b"
gdb_collect_expression_test globals_test_func \
fail "could not find gdb_recursion_test function"
return
}
-set testline1 [expr $baseline + 4]
+set testline1 [expr {$baseline + 4}]
#
# test "delete tracepoints" command
gdb_test "info tracepoints" \
"No tracepoints." \
- "3.3c: verify delete three tracepoints"
+ "3.3c: verify delete three tracepoints"
# 3.4 delete invalid tracepoint number
-gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \
- "No breakpoint number [expr $trcpt2 + $trcpt3]." \
+gdb_test "delete tracepoint [expr {$trcpt2 + $trcpt3}]" \
+ "No breakpoint number [expr {$trcpt2 + $trcpt3}]." \
"3.4: delete invalid tracepoint number"
# 3.5 delete tracepoint number zero
return -1
}
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ {debug nowarnings}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
clean_restart ${testfile}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
load_lib "trace-support.exp"
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
standard_testfile
# make check RUNTESTFLAGS='gdb.trace/ftrace-lock.exp NUM_THREADS=2'
-if ![info exists NUM_THREADS] {
+if {![info exists NUM_THREADS]} {
set NUM_THREADS 2
}
return
}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
- if ![gdb_target_supports_trace] {
+ if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
return
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
require gdb_trace_common_supports_arch
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- [list debug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ [list debug $additional_flags]]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
}
clean_restart ${executable}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
set minaddr [exec sh -c "cat /proc/sys/vm/mmap_min_addr"]
- if { [expr $minaddr > 64512] } {
+ if {$minaddr > 64512} {
warning "mmap_min_addr > 64512, fast tracepoint will fail"
warning "do \"sudo sysctl -w vm.mmap_min_addr=32768\" to adjust"
}
# fast tracepoints RSP feature, and confirm fast tracepoints
# can no longer be downloaded.
set test "fast tracepoint could not be downloaded with the feature disabled"
- if [gdb_protocol_is_remote] {
+ if {[gdb_protocol_is_remote]} {
gdb_test "set remote fast-tracepoints-packet off"
gdb_test_multiple "tstart" $test {
"2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
# 2.3 info tracepoint (invalid tracepoint number)
-gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
- "No tracepoint matching '[expr $c_test_num + $asm_test_num]'." \
+gdb_test "info tracepoint [expr {$c_test_num + $asm_test_num}]" \
+ "No tracepoint matching '[expr {$c_test_num + $asm_test_num}]'." \
"2.3: info tracepoint (invalid tracepoint number)"
# 2.4 info tracepoints (list of numbers)
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
set pcnum -1
set gpr0num -1
- if [is_amd64_regs_target] {
+ if {[is_amd64_regs_target]} {
set pcnum 16
set gpr0num 0
- } elseif [is_x86_like_target] {
+ } elseif {[is_x86_like_target]} {
set pcnum 8
set gpr0num 0
- } elseif [is_aarch64_target] {
+ } elseif {[is_aarch64_target]} {
set pcnum 32
set gpr0num 0
- } elseif [istarget "powerpc*-*-*"] {
+ } elseif {[istarget "powerpc*-*-*"]} {
set pcnum 64
set gpr0num 0
} elseif { [istarget "s390*-*-*"] } {
# If tracefile is generated successfully, copy tracefile to host and
# run tests.
-if [generate_tracefile $binfile] {
+if {[generate_tracefile $binfile]} {
if {!$purely_local} {
# Copy tracefile from target to host.
remote_download host [remote_upload target tfile-basic.tf] \
clean_restart $executable
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
gdb_load_shlib $lib_sl1
gdb_load_shlib $lib_sl2
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
global srcdir subdir
global mi_gdb_prompt
- if [mi_gdb_start] {
+ if {[mi_gdb_start]} {
return
}
mi_gdb_load ${binfile}
# Test target supports tracepoints or not.
clean_restart $testfile
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
- if ![gdb_target_supports_trace] {
+ if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
}
}
- if $tsv1_created {
+ if {$tsv1_created} {
pass "tsv1 created"
} else {
fail "tsv1 created"
}
- if $tsv2_created {
+ if {$tsv2_created} {
pass "tsv2 created"
} else {
fail "tsv2 created"
clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
gdb_test "tstart" "Target returns error code.*\."
with_test_prefix "after tstart" {
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
}
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set testline2 [expr $baseline + 4]
-set testline3 [expr $baseline + 5]
-set testline4 [expr $baseline + 6]
+set testline2 [expr {$baseline + 4}]
+set testline3 [expr {$baseline + 5}]
+set testline4 [expr {$baseline + 6}]
#
# test passcount command semantics (live test)
#
## Set three tracepoints with three different passcounts.
-## Verify that the experiment stops after the one with the
+## Verify that the experiment stops after the one with the
## lowest passcount is hit.
gdb_delete_tracepoints
}
## We should now be at the last frame, because this frame's passcount
-## should have caused collection to stop. If we do a tfind now,
+## should have caused collection to stop. If we do a tfind now,
## it should fail.
gdb_test "tfind" "failed to find.*" "4.5: dynamic passcount test"
return
}
-set testline1 [expr $baseline + 3]
+set testline1 [expr {$baseline + 3}]
#
# test "passcount" command
# 4.8 set passcount for invalid tracepoint
-gdb_test "passcount 1 [expr $trcpt2 + $trcpt3]" \
- "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+gdb_test "passcount 1 [expr {$trcpt2 + $trcpt3}]" \
+ "No tracepoint number [expr {$trcpt2 + $trcpt3}]." \
"4.8: invalid tracepoint number in passcount"
# 4.9 help passcount
gdb_load_shlib $lib_sl1
gdb_load_shlib $lib_sl2
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
pass $test
}
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# The target was unable to install the fast tracepoint
# (e.g., jump pad too far from tracepoint).
pass "$test (too far)"
# Start with a fresh gdb.
clean_restart $executable
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
set test "continue to marker 2"
gdb_test_multiple "continue" $test {
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# Expected if the target was unable to install the
# fast tracepoint (e.g., jump pad too far from
# tracepoint).
# Start with a fresh gdb.
clean_restart $executable
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
set test "continue to marker 2"
gdb_test_multiple "continue" $test {
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# Expected if the target was unable to install the
# fast tracepoint (e.g., jump pad too far from
# tracepoint).
# Start with a fresh gdb.
clean_restart $executable
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart $executable
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart $executable
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
set test "continue to marker 2"
gdb_test_multiple "continue" $test {
-re "Target returns error code .* too far .*$gdb_prompt $" {
- if [string equal $trace_type "ftrace"] {
+ if {[string equal $trace_type "ftrace"]} {
# Expected if the target was unable to install the
# fast tracepoint (e.g., jump pad too far from
# tracepoint).
standard_testfile read-memory.c
set executable $testfile
-if [prepare_for_testing "failed to prepare for trace tests" \
- $executable $srcfile [list debug]] {
+if {[prepare_for_testing "failed to prepare for trace tests" \
+ $executable $srcfile [list debug]]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# Check whether the target supports tracepoints.
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
return -1
}
standard_testfile
set executable $testfile
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ {debug nowarnings}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
-if ![gdb_range_stepping_enabled] {
+if {![gdb_range_stepping_enabled]} {
unsupported "range stepping not supported by the target"
return -1
}
clean_restart ${executable}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
gdb_breakpoint "end" qualified
untested "couldn't match pattern"
set return_me 1
all tests in this module will fail."
- }
+ }
}
if {$return_me == 1} {
exp_continue
}
-re "^\[^\r\n\]* line $testline1 .tracepoint .$tdp1\\)\r\n" {
- set linecount1 [expr $linecount1 + 1]
+ set linecount1 [expr {$linecount1 + 1}]
exp_continue
}
-re "^\[^\r\n\]* line $testline2 .tracepoint .$tdp2\\)\r\n" {
- set linecount2 [expr $linecount2 + 1]
+ set linecount2 [expr {$linecount2 + 1}]
exp_continue
}
-re "^\[^\r\n\]* line $testline3 .tracepoint .$tdp3\\)\r\n" {
- set linecount3 [expr $linecount3 + 1]
+ set linecount3 [expr {$linecount3 + 1}]
exp_continue
}
-re "^\[^\r\n\]* line $testline4 .tracepoint .$tdp4\\)\r\n" {
- set linecount4 [expr $linecount4 + 1]
+ set linecount4 [expr {$linecount4 + 1}]
exp_continue
}
-re "^\[^\r\n\]* line $testline5 .tracepoint .$tdp5\\)\r\n" {
- set linecount5 [expr $linecount5 + 1]
+ set linecount5 [expr {$linecount5 + 1}]
exp_continue
}
-re "^\[^\r\n\]* line $testline6 .tracepoint .$tdp6\\)\r\n" {
- set linecount6 [expr $linecount6 + 1]
+ set linecount6 [expr {$linecount6 + 1}]
exp_continue
}
-re "^No trace frame found\r\n$gdb_prompt $" {
gdb_test_multiple "while \$trace_frame != -1\n printf \"tracepoint #\%d, FP 0x\%08x, SP 0x\%08x, PC 0x%08x\\n\", \$tracepoint, \$fp, \$sp, \$pc\n tfind tracepoint\n end" "12.2: trace report #2" {
-re "tracepoint #$tdp2, FP $hex, SP $hex, PC $hex" {
- set linecount2 [expr $linecount2 + 1]
+ set linecount2 [expr {$linecount2 + 1}]
exp_continue
}
-re ".*$gdb_prompt $" {
gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame \%d: depth = \%d, q1 = \%d\\n\", \$tracepoint, \$trace_frame, depth, q1\n tfind tracepoint\n end" "12.3: trace report #3" {
-re "TDP #$tdp3, frame $decimal: depth = $decimal, q1 = $decimal" {
- set linecount3 [expr $linecount3 + 1]
+ set linecount3 [expr {$linecount3 + 1}]
exp_continue
}
-re ".*$gdb_prompt $" {
gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame %d: char_test = \%d, long_test = \%d\\n\", \$tracepoint, \$trace_frame, gdb_char_test, gdb_long_test\n tfind tracepoint\n end" "12.4: trace report #4" {
-re "TDP #$tdp6, frame $decimal: char_test = $arg1, long_test = $arg3" {
- set linecount6 [expr $linecount6 + 1]
+ set linecount6 [expr {$linecount6 + 1}]
exp_continue
}
-re ".*$gdb_prompt $" {
return
}
-set testline1 [expr $baseline + 4]
-set testline2 [expr $baseline + 5]
-set testline3 [expr $baseline + 6]
-set testline4 [expr $baseline + 7]
-set testline5 [expr $baseline + 8]
-set testline6 [expr $baseline + 9]
+set testline1 [expr {$baseline + 4}]
+set testline2 [expr {$baseline + 5}]
+set testline3 [expr {$baseline + 6}]
+set testline4 [expr {$baseline + 7}]
+set testline5 [expr {$baseline + 8}]
+set testline6 [expr {$baseline + 9}]
#
# test save-trace command
gdb_delete_tracepoints
foreach x { 1 2 3 4 5 6 } {
- set testline [expr \$testline$x]
+ set testline [subst \$testline$x]
set trcpt [gdb_gettpnum $testline]
set trcpt$x $trcpt
gdb_test "passcount $x" \
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Start with a fresh gdb.
clean_restart ${testfile}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
# Record the hit times of each tracepoint in this array.
array set tracepoint_hits { }
-for { set i $tpnum } { $i < [expr $tpnum + 2] } { incr i } {
+for { set i $tpnum } { $i < $tpnum + 2 } { incr i } {
set tracepoint_hits($i) 0
}
set idx 0
gdb_test_multiple $test $test {
-re "Found trace frame $decimal, tracepoint ($decimal).*\r\n$gdb_prompt $" {
- set idx [expr $expect_out(1,string)]
+ set idx [expr {$expect_out(1,string)}]
incr tracepoint_hits($idx)
}
-re "Target failed to find requested trace frame\..*\r\n$gdb_prompt $" {
# Step 3, check the number of collections on each tracepoint.
-for { set i $tpnum } { $i < [expr $tpnum + 2] } { incr i } {
+for { set i $tpnum } { $i < $tpnum + 2 } { incr i } {
if { $tracepoint_hits($i) == $iterations } {
pass "tracepoint $i hit $iterations times"
set expfile $testfile.exp
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ {debug nowarnings}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Restart with a fresh gdb.
clean_restart $executable
gdb_load_shlib $libipa
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Restart with a fresh gdb.
clean_restart $executable
gdb_load_shlib $libipa
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Restart with a fresh gdb.
clean_restart $executable
gdb_load_shlib $libipa
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Restart with a fresh gdb.
clean_restart $executable
gdb_load_shlib $libipa
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
pass $test
}
-re ".*\r\n$gdb_prompt $" {
- if [string equal $type "ftrace"] {
+ if {[string equal $type "ftrace"]} {
# The instruction may be not long enough to set a fast
# tracepoint. Skip the rest of this test.
return -1
pass $test
}
-re ".*\r\n$gdb_prompt $" {
- if [string equal $type "ftrace"] {
+ if {[string equal $type "ftrace"]} {
# The instruction may be not long enough to set a fast
# tracepoint. Skip the rest of this test.
return -1
gdb_breakpoint "end" qualified
- if [string equal $type "break"] {
+ if {[string equal $type "break"]} {
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
"continue to bar"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
# Restart with a fresh gdb.
clean_restart $executable
gdb_load_shlib $libipa
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
clean_restart $executable
gdb_load_shlib $libipa
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
if {![gdb_target_supports_trace]} {
return
}
-set testline1 [expr $baseline + 1]
-set testline2 [expr $baseline + 5]
-set testline3 [expr $baseline + 6]
-set testline4 [expr $baseline + 7]
-set testline5 [expr $baseline + 8]
+set testline1 [expr {$baseline + 1}]
+set testline2 [expr {$baseline + 5}]
+set testline3 [expr {$baseline + 6}]
+set testline4 [expr {$baseline + 7}]
+set testline5 [expr {$baseline + 8}]
#
# test tfind command
"No source file named.*" \
"8.27: tfind line in bad source file"
-# 8.32 tfind invalid subcommand (tfind foo)
+# 8.32 tfind invalid subcommand (tfind foo)
## check error
gdb_test "tfind NoSuChOpTiOn 21" \
"No symbol.*|\[Ww\]arning.*|\[Ee\]rror.*" \
require gdb_trace_common_supports_arch
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- [list debug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ [list debug $additional_flags]]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
gdb_test "continue" "Continuing\\.\[ \r\n\]+(Thread .* hit )?Breakpoint.*" \
"continue to marker"
- if [string equal $trace3_at_first_loc "1"] {
+ if {[string equal $trace3_at_first_loc "1"]} {
gdb_test "${trace3} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
"${trace3} set_point 2"
} else {
# Start with a fresh gdb.
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
gdb_test_no_output "tstop"
- if [string equal $enable1 "enable"] {
+ if {[string equal $enable1 "enable"]} {
gdb_test "tfind tracepoint 4" "Found trace frame \[0-9\], tracepoint .*" \
"tfind test frame of tracepoint 4"
gdb_test "tdump" \
"tfind test frame of tracepoint 4"
}
- if [string equal $enable2 "enable"] {
+ if {[string equal $enable2 "enable"]} {
gdb_test "tfind tracepoint 5" "Found trace frame \[0-9\], tracepoint .*" \
"tfind test frame of tracepoint 5"
gdb_test "tdump" \
}
clean_restart ${executable}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
- {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ {debug nowarnings}]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
require gdb_trace_common_supports_arch
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- [list debug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ [list debug $additional_flags]]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
clean_restart ${executable}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
clean_restart ${executable}
- if ![runto_main] {
+ if {![runto_main]} {
return 0
}
clean_restart ${testfile}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
set expected 0
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
return
}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
- if ![gdb_target_supports_trace] {
+ if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Make sure inferior is running in all-stop mode.
gdb_test_no_output "set non-stop 0"
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
# Start with a fresh gdb.
clean_restart $testfile
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
return
}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
return
}
-set testline1 [expr $baseline + 1]
-set testline2 [expr $baseline + 3]
+set testline1 [expr {$baseline + 1}]
+set testline2 [expr {$baseline + 3}]
#
# test "help tracepoints"
set helpcnt 0
test_class_help "tracepoints" {
- "Tracing of program execution without stopping the program\.[\r\n\]+"
+ "Tracing of program execution without stopping the program\.[\r\n\]+"
} {} "1.0: help tracepoints"
#
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
require allow_shlib_tests
# Do not run if gdbserver debug is enabled - the output file is many Gb.
-if [gdbserver_debug_enabled] {
+if {[gdbserver_debug_enabled]} {
return 0
}
clean_restart ${testfile}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
require gdb_trace_common_supports_arch
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
- [list debug]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+ [list debug]]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# If there are predefined TSVs, test these predefined TSVs are correctly
# uploaded.
-if [target_info exists gdb,predefined_tsv] {
+if {[target_info exists gdb,predefined_tsv]} {
set tsv [target_info gdb,predefined_tsv]
# Test predefined TSVs are uploaded.
clean_restart ${testfile}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}
# Test reading uncollected pseudo-registers. The set of which
# depends on target.
- if [is_amd64_regs_target] {
+ if {[is_amd64_regs_target]} {
# Check the raw register first.
test_register_unavailable "\$rax"
test_register_unavailable "\$eax"
test_register_unavailable "\$ax"
- } elseif [is_x86_like_target] {
+ } elseif {[is_x86_like_target]} {
# Check the raw register first.
test_register_unavailable "\$eax"
test_register_unavailable "\$ax"
return -1
}
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
return -1
}