Running tclint on the test-cases in gdb.guile shows a few problems.
Fix these.
Tested on x86_64-linux.
"gdb/testsuite/gdb.cp",
"gdb/testsuite/gdb.dwarf2",
"gdb/testsuite/gdb.fortran",
-"gdb/testsuite/gdb.guile",
"gdb/testsuite/gdb.mi",
"gdb/testsuite/gdb.python",
"gdb/testsuite/gdb.reverse",
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return -1
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
"scm-breakpoint\.c:${mult_line}*" \
"check multiply breakpoint location"
- # Check hit and ignore counts.
+ # Check hit and ignore counts.
gdb_test "guile (print (breakpoint-hit-count mult-bkpt))" \
"= 1" "check multiply breakpoint hit count"
gdb_scm_test_silent_cmd "guile (set-breakpoint-ignore-count! mult-bkpt 4)" \
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
clean_restart ${testfile}
# Disable hardware watchpoints if necessary.
- if [target_info exists gdb,no_hardware_watchpoints] {
+ if {[target_info exists gdb,no_hardware_watchpoints]} {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
clean_restart ${testfile}
# Disable hardware watchpoints if necessary.
- if [target_info exists gdb,no_hardware_watchpoints] {
+ if {[target_info exists gdb,no_hardware_watchpoints]} {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
clean_restart ${testfile}
# Disable hardware watchpoints if necessary.
- if [target_info exists gdb,no_hardware_watchpoints] {
+ if {[target_info exists gdb,no_hardware_watchpoints]} {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return 0
}
delete_breakpoints
# Start with a fresh gdb.
clean_restart ${testfile}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![runto_main] {
+if {![runto_main]} {
return
}
# The following tests require execution.
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return -1
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# The following tests require execution.
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# TCL 8.5 required here. Use lookup table instead?
proc get_max_int { size } {
- return [expr "(1 << ($size - 1)) - 1"]
+ return [expr {(1 << ($size - 1)) - 1}]
}
# Return the min signed int of size SIZE.
# TCL 8.5 required here. Use lookup table instead?
proc get_min_int { size } {
- return [expr "-(1 << ($size - 1))"]
+ return [expr {-(1 << ($size - 1))}]
}
# Return the max unsigned int of size SIZE.
# TCL 8.5 required here. Use lookup table instead?
proc get_max_uint { size } {
- return [expr "(1 << $size) - 1"]
+ return [expr {(1 << $size) - 1}]
}
# Helper routine for test_value_numeric_ranges.
proc test_make_pointer_value { size } {
set max [get_max_uint $size]
- set max_hex [string repeat "f" [expr "$size / 4"]]
+ set max_hex [string repeat "f" [expr {$size / 4}]]
gdb_test "gu (print (make-value $max #:type void-pointer-type))" \
"= 0x$max_hex" "test make-value void* max"
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# Verify gdb loaded the script.
gdb_test "info auto-load guile-scripts" "Yes.*/${testfile}-gdb.scm.*"
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
gdb_install_guile_module
proc scm_param_test_maybe_no_output { command pattern args } {
- if [string length $pattern] {
+ if {[string length $pattern]} {
gdb_test $command $pattern $args
} else {
gdb_test_no_output $command $args
gdb_test_no_output "set print test-enum-param two"
gdb_test "show print test-enum-param" "The state of the enum is two." "show new value"
gdb_test "guile (print (parameter-value test-enum-param))" "two" "enum parameter value, two"
- gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter"
+ gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter"
}
# Test integer parameters.
gdb_test_no_output "set test-file-param bar.txt"
gdb_test "show test-file-param" "The name of the file is bar.txt." "show new value"
gdb_test "guile (print (parameter-value test-file-param))" "bar.txt" " new parameter value"
- gdb_test "set test-file-param" "Argument required.*"
+ gdb_test "set test-file-param" "Argument required.*"
}
# Test a parameter that is not documented.
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# Test read/write of memory ports.
proc test_mem_port_rw { buffered } {
- if $buffered {
+ if {$buffered} {
set mode "r+"
} else {
set mode "r+0"
"define new-value"
gdb_test "guile (print (put-bytevector rw-mem-port (make-bytevector 1 new-value)))" \
"= #<unspecified>"
- if $buffered {
+ if {$buffered} {
# Value shouldn't be in memory yet.
gdb_test "guile (print (value=? (parse-and-eval \"*(char*) \$sp\") byte-at-sp))" \
"= #t" \
clean_restart
gdb_load $exefile
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return
}
clean_restart $::testfile
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
gdb_test "info auto-load guile-scripts no-script-matches-this" \
"No auto-load scripts matching no-script-matches-this."
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
gdb_test "guile (print (symbol-needs-frame? qq-var))" \
"= #f" "print whether qq needs a frame"
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
clean_restart ${::testfile}-cxx
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# test as it unloads the object file in GDB.
# Start with a fresh gdb.
clean_restart ${testfile}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
# Test find-pc-line.
# The following tests require execution.
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
return 0
}
- if ![gdb_guile_runto_main] {
+ if {![gdb_guile_runto_main]} {
return 0
}
gdb_scm_test_silent_cmd "guile (use-modules (gdb iterator))" \
if { [build_inferior "${binfile}" "c"] < 0 } {
return
}
-if ![restart_gdb "${binfile}"] {
+if {![restart_gdb "${binfile}"]} {
return
}
if { [build_inferior "${binfile}-cxx" "c++"] < 0 } {
return
}
-if ![restart_gdb "${binfile}-cxx"] {
+if {![restart_gdb "${binfile}-cxx"]} {
return
}
return
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
clean_restart
gdb_load ${exefile}
- if ![gdb_guile_runto_main ] {
+ if {![gdb_guile_runto_main ]} {
return
}
# The following tests require execution.
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}
test_strings
test_value_after_death
-# Test either C or C++ values.
+# Test either C or C++ values.
test_subscript_regression "${binfile}" "c"
return -1
}
-if ![gdb_guile_runto_main] {
+if {![gdb_guile_runto_main]} {
return
}