diff options
author | Pedro Alves <palves@redhat.com> | 2013-06-07 17:31:09 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-06-07 17:31:09 +0000 |
commit | 4ec7020176a1aaae1adeeb1e1695975ebdc172ea (patch) | |
tree | 45b9789c9f3b5f7f6fb1cd87bc1be0744cd5730c /gdb/testsuite/lib | |
parent | c5da8c7d174e38282889094b86153721fe3f5aca (diff) | |
download | gdb-4ec7020176a1aaae1adeeb1e1695975ebdc172ea.zip gdb-4ec7020176a1aaae1adeeb1e1695975ebdc172ea.tar.gz gdb-4ec7020176a1aaae1adeeb1e1695975ebdc172ea.tar.bz2 |
Remove superfluous semicolons from testsuite throughout.
A few months ago semicolons after "return" were removed throughout the
testsuite. However, as I pointed out in review, they're unnecessary
not just after "return", but pretty much after any tcl command. ';'
is the command separator, and you only need it if there's another
command on the same line afterwards.
This patch was written by running:
$ find . -name "*.exp" | xargs grep -l ";\s*$" | xargs sed -i 's/\([^#][^\s*;]*\)\s*;\s*$/\1/'
and then undoing changes to comments, and lib/future.exp.
Tested on x86_64 Fedora 17.
gdb/testsuite/
2013-06-07 Pedro Alves <palves@redhat.com>
* boards/native-extended-gdbserver.exp: Remove semicolon.
* config/arm-ice.exp: Likewise.
* config/bfin.exp: Likewise.
* config/cygmon.exp: Likewise.
* config/h8300.exp: Likewise.
* config/monitor.exp: Likewise.
* config/sid.exp: Likewise.
* config/sim.exp: Likewise.
* config/slite.exp: Likewise.
* config/vx.exp: Likewise.
* gdb.arch/i386-bp_permanent.exp: Likewise.
* gdb.asm/asm-source.exp: Likewise.
* gdb.base/args.exp: Likewise.
* gdb.base/attach-pie-misread.exp: Likewise.
* gdb.base/auxv.exp: Likewise.
* gdb.base/bigcore.exp: Likewise.
* gdb.base/bitfields2.exp: Likewise.
* gdb.base/bitfields.exp: Likewise.
* gdb.base/break.exp: Likewise.
* gdb.base/break-interp.exp: Likewise.
* gdb.base/callfuncs.exp: Likewise.
* gdb.base/call-sc.exp: Likewise.
* gdb.base/commands.exp: Likewise.
* gdb.base/corefile.exp: Likewise.
* gdb.base/dbx.exp: Likewise.
* gdb.base/ending-run.exp: Likewise.
* gdb.base/exprs.exp: Likewise.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/hbreak2.exp: Likewise.
* gdb.base/huge.exp: Likewise.
* gdb.base/list.exp: Likewise.
* gdb.base/memattr.exp: Likewise.
* gdb.base/overlays.exp: Likewise.
* gdb.base/printcmds.exp: Likewise.
* gdb.base/recurse.exp: Likewise.
* gdb.base/remotetimeout.exp: Likewise.
* gdb.base/reread.exp: Likewise.
* gdb.base/savedregs.exp: Likewise.
* gdb.base/scope.exp: Likewise.
* gdb.base/sepdebug.exp: Likewise.
* gdb.base/setshow.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
* gdb.base/sigaltstack.exp: Likewise.
* gdb.base/siginfo-addr.exp: Likewise.
* gdb.base/siginfo.exp: Likewise.
* gdb.base/siginfo-obj.exp: Likewise.
* gdb.base/sigrepeat.exp: Likewise.
* gdb.base/sigstep.exp: Likewise.
* gdb.base/structs.exp: Likewise.
* gdb.base/testenv.exp: Likewise.
* gdb.base/twice.exp: Likewise.
* gdb.base/valgrind-db-attach.exp: Likewise.
* gdb.base/valgrind-infcall.exp: Likewise.
* gdb.base/varargs.exp: Likewise.
* gdb.base/watchpoint.exp: Likewise.
* gdb.cp/gdb1355.exp: Likewise.
* gdb.cp/misc.exp: Likewise.
* gdb.disasm/hppa.exp: Likewise.
* gdb.disasm/t01_mov.exp: Likewise.
* gdb.disasm/t02_mova.exp: Likewise.
* gdb.disasm/t03_add.exp: Likewise.
* gdb.disasm/t04_sub.exp: Likewise.
* gdb.disasm/t05_cmp.exp: Likewise.
* gdb.disasm/t06_ari2.exp: Likewise.
* gdb.disasm/t07_ari3.exp: Likewise.
* gdb.disasm/t08_or.exp: Likewise.
* gdb.disasm/t09_xor.exp: Likewise.
* gdb.disasm/t10_and.exp: Likewise.
* gdb.disasm/t11_logs.exp: Likewise.
* gdb.disasm/t12_bit.exp: Likewise.
* gdb.disasm/t13_otr.exp: Likewise.
* gdb.gdb/selftest.exp: Likewise.
* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
* gdb.mi/mi-reverse.exp: Likewise.
* gdb.pascal/floats.exp: Likewise.
* gdb.python/py-inferior.exp: Likewise.
* gdb.threads/attach-into-signal.exp: Likewise.
* gdb.threads/pthreads.exp: Likewise.
* gdb.threads/thread_events.exp: Likewise.
* gdb.threads/watchthreads.exp: Likewise.
* gdb.trace/actions-changed.exp: Likewise.
* gdb.trace/actions.exp: Likewise.
* gdb.trace/ax.exp: Likewise.
* gdb.trace/backtrace.exp: Likewise.
* gdb.trace/change-loc.exp: Likewise.
* gdb.trace/deltrace.exp: Likewise.
* gdb.trace/disconnected-tracing.exp: Likewise.
* gdb.trace/ftrace.exp: Likewise.
* gdb.trace/infotrace.exp: Likewise.
* gdb.trace/passc-dyn.exp: Likewise.
* gdb.trace/passcount.exp: Likewise.
* gdb.trace/pending.exp: Likewise.
* gdb.trace/qtro.exp: Likewise.
* gdb.trace/range-stepping.exp: Likewise.
* gdb.trace/report.exp: Likewise.
* gdb.trace/save-trace.exp: Likewise.
* gdb.trace/status-stop.exp: Likewise.
* gdb.trace/strace.exp: Likewise.
* gdb.trace/tfile.exp: Likewise.
* gdb.trace/tfind.exp: Likewise.
* gdb.trace/trace-break.exp: Likewise.
* gdb.trace/tracecmd.exp: Likewise.
* gdb.trace/trace-mt.exp: Likewise.
* gdb.trace/tspeed.exp: Likewise.
* gdb.trace/tsv.exp: Likewise.
* gdb.trace/while-stepping.exp: Likewise.
* lib/gdb.exp: Likewise.
* lib/gdbserver-support.exp: Likewise.
* lib/java.exp: Likewise.
* lib/mi-support.exp: Likewise.
* lib/pascal.exp: Likewise.
* lib/prompt.exp: Likewise.
* lib/trace-support.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 240 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdbserver-support.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/lib/java.exp | 24 | ||||
-rw-r--r-- | gdb/testsuite/lib/mi-support.exp | 112 | ||||
-rw-r--r-- | gdb/testsuite/lib/pascal.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/lib/prompt.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/lib/trace-support.exp | 92 |
7 files changed, 242 insertions, 242 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 76ee870..376aacc 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -30,13 +30,13 @@ load_lib libgloss.exp global GDB if [info exists TOOL_EXECUTABLE] { - set GDB $TOOL_EXECUTABLE; + set GDB $TOOL_EXECUTABLE } if ![info exists GDB] { if ![is_remote host] { set GDB [findfile $base_dir/../../gdb/gdb "$base_dir/../../gdb/gdb" [transform gdb]] } else { - set GDB [transform gdb]; + set GDB [transform gdb] } } verbose "using GDB = $GDB" 2 @@ -112,7 +112,7 @@ proc default_gdb_version {} { global INTERNAL_GDBFLAGS GDBFLAGS global gdb_prompt set output [remote_exec host "$GDB $INTERNAL_GDBFLAGS --version"] - set tmp [lindex $output 1]; + set tmp [lindex $output 1] set version "" regexp " \[0-9\]\[^ \t\n\r\]+" "$tmp" version if ![is_remote host] { @@ -171,7 +171,7 @@ proc delete_breakpoints {} { send_gdb "delete breakpoints\n" gdb_expect 100 { -re "Delete all breakpoints.*y or n.*$" { - send_gdb "y\n"; + send_gdb "y\n" exp_continue } -re "$gdb_prompt $" { # This happens if there were no breakpoints @@ -183,7 +183,7 @@ proc delete_breakpoints {} { -re "No breakpoints or watchpoints..*$gdb_prompt $" {} -re "$gdb_prompt $" { perror "breakpoints not deleted" ; return } -re "Delete all breakpoints.*or n.*$" { - send_gdb "y\n"; + send_gdb "y\n" exp_continue } timeout { perror "info breakpoints (timeout)" ; return } @@ -203,12 +203,12 @@ proc gdb_run_cmd {args} { global gdb_prompt use_gdb_stub if [target_info exists gdb_init_command] { - send_gdb "[target_info gdb_init_command]\n"; + send_gdb "[target_info gdb_init_command]\n" gdb_expect 30 { -re "$gdb_prompt $" { } default { - perror "gdb_init_command for target failed"; - return; + perror "gdb_init_command for target failed" + return } } } @@ -216,57 +216,57 @@ proc gdb_run_cmd {args} { if $use_gdb_stub { if [target_info exists gdb,do_reload_on_run] { if { [gdb_reload] != 0 } { - return; + return } - send_gdb "continue\n"; + send_gdb "continue\n" gdb_expect 60 { -re "Continu\[^\r\n\]*\[\r\n\]" {} default {} } - return; + return } if [target_info exists gdb,start_symbol] { - set start [target_info gdb,start_symbol]; + set start [target_info gdb,start_symbol] } else { - set start "start"; + set start "start" } send_gdb "jump *$start\n" - set start_attempt 1; + set start_attempt 1 while { $start_attempt } { # Cap (re)start attempts at three to ensure that this loop # always eventually fails. Don't worry about trying to be # clever and not send a command when it has failed. if [expr $start_attempt > 3] { - perror "Jump to start() failed (retry count exceeded)"; - return; + perror "Jump to start() failed (retry count exceeded)" + return } - set start_attempt [expr $start_attempt + 1]; + set start_attempt [expr $start_attempt + 1] gdb_expect 30 { -re "Continuing at \[^\r\n\]*\[\r\n\]" { - set start_attempt 0; + set start_attempt 0 } -re "No symbol \"_start\" in current.*$gdb_prompt $" { - perror "Can't find start symbol to run in gdb_run"; - return; + perror "Can't find start symbol to run in gdb_run" + return } -re "No symbol \"start\" in current.*$gdb_prompt $" { - send_gdb "jump *_start\n"; + send_gdb "jump *_start\n" } -re "No symbol.*context.*$gdb_prompt $" { - set start_attempt 0; + set start_attempt 0 } -re "Line.* Jump anyway.*y or n. $" { send_gdb "y\n" } -re "The program is not being run.*$gdb_prompt $" { if { [gdb_reload] != 0 } { - return; + return } - send_gdb "jump *$start\n"; + send_gdb "jump *$start\n" } timeout { - perror "Jump to start() failed (timeout)"; + perror "Jump to start() failed (timeout)" return } } @@ -276,7 +276,7 @@ proc gdb_run_cmd {args} { if [target_info exists gdb,do_reload_on_run] { if { [gdb_reload] != 0 } { - return; + return } } send_gdb "run $args\n" @@ -305,11 +305,11 @@ proc gdb_start_cmd {args} { global gdb_prompt use_gdb_stub if [target_info exists gdb_init_command] { - send_gdb "[target_info gdb_init_command]\n"; + send_gdb "[target_info gdb_init_command]\n" gdb_expect 30 { -re "$gdb_prompt $" { } default { - perror "gdb_init_command for target failed"; + perror "gdb_init_command for target failed" return -1 } } @@ -743,21 +743,21 @@ proc gdb_test_multiple { command message user_code } { } set result -1 - set string "${command}\n"; + set string "${command}\n" if { $command != "" } { set multi_line_re "\[\r\n\] *>" while { "$string" != "" } { - set foo [string first "\n" "$string"]; - set len [string length "$string"]; + set foo [string first "\n" "$string"] + set len [string length "$string"] if { $foo < [expr $len - 1] } { - set str [string range "$string" 0 $foo]; + set str [string range "$string" 0 $foo] if { [send_gdb "$str"] != "" } { - global suppress_flag; + global suppress_flag if { ! $suppress_flag } { - perror "Couldn't send $command to GDB."; + perror "Couldn't send $command to GDB." } - fail "$message"; + fail "$message" return $result } # since we're checking if each line of the multi-line @@ -769,36 +769,36 @@ proc gdb_test_multiple { command message user_code } { -notransfer -re "$multi_line_re$" { verbose "partial: match" 3 } timeout { verbose "partial: timeout" 3 } } - set string [string range "$string" [expr $foo + 1] end]; + set string [string range "$string" [expr $foo + 1] end] set multi_line_re "$multi_line_re.*\[\r\n\] *>" } else { - break; + break } } if { "$string" != "" } { if { [send_gdb "$string"] != "" } { - global suppress_flag; + global suppress_flag if { ! $suppress_flag } { - perror "Couldn't send $command to GDB."; + perror "Couldn't send $command to GDB." } - fail "$message"; + fail "$message" return $result } } } if [target_info exists gdb,timeout] { - set tmt [target_info gdb,timeout]; + set tmt [target_info gdb,timeout] } else { if [info exists timeout] { - set tmt $timeout; + set tmt $timeout } else { - global timeout; + global timeout if [info exists timeout] { - set tmt $timeout; + set tmt $timeout } else { - set tmt 60; + set tmt 60 } } } @@ -810,10 +810,10 @@ proc gdb_test_multiple { command message user_code } { } -re "\\*\\*\\* DOSEXIT code.*" { if { $message != "" } { - fail "$message"; + fail "$message" } - gdb_suppress_entire_file "GDB died"; - set result -1; + gdb_suppress_entire_file "GDB died" + set result -1 } } append code $processed_code @@ -910,7 +910,7 @@ proc gdb_test_multiple { command message user_code } { set result 0 set code [catch {gdb_expect $tmt $code} string] if {$code == 1} { - global errorInfo errorCode; + global errorInfo errorCode return -code error -errorinfo $errorInfo -errorcode $errorCode $string } elseif {$code > 1} { return -code $code $string @@ -953,8 +953,8 @@ proc gdb_test { args } { set pattern [lindex $args 1] if [llength $args]==5 { - set question_string [lindex $args 3]; - set response_string [lindex $args 4]; + set question_string [lindex $args 3] + set response_string [lindex $args 4] } else { set question_string "^FOOBAR$" } @@ -966,8 +966,8 @@ proc gdb_test { args } { } } -re "(${question_string})$" { - send_gdb "$response_string\n"; - exp_continue; + send_gdb "$response_string\n" + exp_continue } }] } @@ -1244,22 +1244,22 @@ proc default_gdb_exit {} { global GDB global INTERNAL_GDBFLAGS GDBFLAGS global verbose - global gdb_spawn_id; + global gdb_spawn_id - gdb_stop_suppressing_tests; + gdb_stop_suppressing_tests if ![info exists gdb_spawn_id] { - return; + return } verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS" if { [is_remote host] && [board_info host exists fileid] } { - send_gdb "quit\n"; + send_gdb "quit\n" gdb_expect 10 { -re "y or n" { - send_gdb "y\n"; - exp_continue; + send_gdb "y\n" + exp_continue } -re "DOSEXIT code" { } default { } @@ -1267,7 +1267,7 @@ proc default_gdb_exit {} { } if ![is_remote host] { - remote_close host; + remote_close host } unset gdb_spawn_id } @@ -1402,9 +1402,9 @@ proc default_gdb_start { } { global INTERNAL_GDBFLAGS GDBFLAGS global gdb_prompt global timeout - global gdb_spawn_id; + global gdb_spawn_id - gdb_stop_suppressing_tests; + gdb_stop_suppressing_tests # Set the default value, it may be overriden later by specific testfile. # @@ -1427,7 +1427,7 @@ proc default_gdb_start { } { exit 1 } } - set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"]; + set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"] if { $res < 0 || $res == "" } { perror "Spawning $GDB failed." return 1 @@ -1442,11 +1442,11 @@ proc default_gdb_start { } { } timeout { perror "(timeout) GDB never initialized after 10 seconds." - remote_close host; + remote_close host return -1 } } - set gdb_spawn_id -1; + set gdb_spawn_id -1 # force the height to "unlimited", so no pagers get used send_gdb "set height 0\n" @@ -2505,19 +2505,19 @@ set gdb_wrapper_initialized 0 set gdb_wrapper_target "" proc gdb_wrapper_init { args } { - global gdb_wrapper_initialized; - global gdb_wrapper_file; - global gdb_wrapper_flags; + global gdb_wrapper_initialized + global gdb_wrapper_file + global gdb_wrapper_flags global gdb_wrapper_target if { $gdb_wrapper_initialized == 1 } { return; } if {[target_info exists needs_status_wrapper] && \ [target_info needs_status_wrapper] != "0"} { - set result [build_wrapper "testglue.o"]; + set result [build_wrapper "testglue.o"] if { $result != "" } { - set gdb_wrapper_file [lindex $result 0]; - set gdb_wrapper_flags [lindex $result 1]; + set gdb_wrapper_file [lindex $result 0] + set gdb_wrapper_flags [lindex $result 1] } else { warning "Status wrapper failed to build." } @@ -2531,10 +2531,10 @@ global gdb_saved_set_unbuffered_mode_obj set gdb_saved_set_unbuffered_mode_obj "" proc gdb_compile {source dest type options} { - global GDB_TESTCASE_OPTIONS; - global gdb_wrapper_file; - global gdb_wrapper_flags; - global gdb_wrapper_initialized; + global GDB_TESTCASE_OPTIONS + global gdb_wrapper_file + global gdb_wrapper_flags + global gdb_wrapper_initialized global srcdir global objdir global gdb_saved_set_unbuffered_mode_obj @@ -2604,7 +2604,7 @@ proc gdb_compile {source dest type options} { set options [concat $options2 $options] } if [info exists GDB_TESTCASE_OPTIONS] { - lappend options "additional_flags=$GDB_TESTCASE_OPTIONS"; + lappend options "additional_flags=$GDB_TESTCASE_OPTIONS" } verbose "options are $options" verbose "source is $source $dest $type $options" @@ -2673,13 +2673,13 @@ proc gdb_compile {source dest type options} { } } - set result [target_compile $source $dest $type $options]; + set result [target_compile $source $dest $type $options] # Prune uninteresting compiler (and linker) output. regsub "Creating library file: \[^\r\n\]*\[\r\n\]+" $result "" result - regsub "\[\r\n\]*$" "$result" "" result; - regsub "^\[\r\n\]*" "$result" "" result; + regsub "\[\r\n\]*$" "$result" "" result + regsub "^\[\r\n\]*" "$result" "" result if {[lsearch $options quiet] < 0} { # We shall update this on a per language basis, to avoid @@ -2881,7 +2881,7 @@ proc gdb_compile_objc {source dest type options} { } proc send_gdb { string } { - global suppress_flag; + global suppress_flag if { $suppress_flag } { return "suppressed" } @@ -2893,66 +2893,66 @@ proc send_gdb { string } { proc gdb_expect { args } { if { [llength $args] == 2 && [lindex $args 0] != "-re" } { - set atimeout [lindex $args 0]; - set expcode [list [lindex $args 1]]; + set atimeout [lindex $args 0] + set expcode [list [lindex $args 1]] } else { - set expcode $args; + set expcode $args } - upvar timeout timeout; + upvar timeout timeout if [target_info exists gdb,timeout] { if [info exists timeout] { if { $timeout < [target_info gdb,timeout] } { - set gtimeout [target_info gdb,timeout]; + set gtimeout [target_info gdb,timeout] } else { - set gtimeout $timeout; + set gtimeout $timeout } } else { - set gtimeout [target_info gdb,timeout]; + set gtimeout [target_info gdb,timeout] } } if ![info exists gtimeout] { - global timeout; + global timeout if [info exists timeout] { - set gtimeout $timeout; + set gtimeout $timeout } } if [info exists atimeout] { if { ![info exists gtimeout] || $gtimeout < $atimeout } { - set gtimeout $atimeout; + set gtimeout $atimeout } } else { if ![info exists gtimeout] { # Eeeeew. - set gtimeout 60; + set gtimeout 60 } } - global suppress_flag; - global remote_suppress_flag; + global suppress_flag + global remote_suppress_flag if [info exists remote_suppress_flag] { - set old_val $remote_suppress_flag; + set old_val $remote_suppress_flag } if [info exists suppress_flag] { if { $suppress_flag } { - set remote_suppress_flag 1; + set remote_suppress_flag 1 } } set code [catch \ - {uplevel remote_expect host $gtimeout $expcode} string]; + {uplevel remote_expect host $gtimeout $expcode} string] if [info exists old_val] { - set remote_suppress_flag $old_val; + set remote_suppress_flag $old_val } else { if [info exists remote_suppress_flag] { - unset remote_suppress_flag; + unset remote_suppress_flag } } if {$code == 1} { - global errorInfo errorCode; + global errorInfo errorCode return -code error -errorinfo $errorInfo -errorcode $errorCode $string } else { @@ -3045,10 +3045,10 @@ proc gdb_expect_list {test sentinel list} { # # proc gdb_suppress_entire_file { reason } { - global suppress_flag; + global suppress_flag - warning "$reason\n"; - set suppress_flag -1; + warning "$reason\n" + set suppress_flag -1 } # @@ -3057,17 +3057,17 @@ proc gdb_suppress_entire_file { reason } { # gdb_stop_suppressing_tests). # proc gdb_suppress_tests { args } { - global suppress_flag; + global suppress_flag return; # fnf - disable pending review of results where # testsuite ran better without this - incr suppress_flag; + incr suppress_flag if { $suppress_flag == 1 } { if { [llength $args] > 0 } { - warning "[lindex $args 0]\n"; + warning "[lindex $args 0]\n" } else { - warning "Because of previous failure, all subsequent tests in this group will automatically fail.\n"; + warning "Because of previous failure, all subsequent tests in this group will automatically fail.\n" } } } @@ -3076,22 +3076,22 @@ proc gdb_suppress_tests { args } { # Clear suppress_flag. # proc gdb_stop_suppressing_tests { } { - global suppress_flag; + global suppress_flag if [info exists suppress_flag] { if { $suppress_flag > 0 } { - set suppress_flag 0; - clone_output "Tests restarted.\n"; + set suppress_flag 0 + clone_output "Tests restarted.\n" } } else { - set suppress_flag 0; + set suppress_flag 0 } } proc gdb_clear_suppressed { } { - global suppress_flag; + global suppress_flag - set suppress_flag 0; + set suppress_flag 0 } proc gdb_start { } { @@ -3337,7 +3337,7 @@ proc default_gdb_init { args } { set cleanfiles {} - gdb_clear_suppressed; + gdb_clear_suppressed set gdb_test_file_name [file rootname [file tail [lindex $args 0]]] @@ -3358,13 +3358,13 @@ proc default_gdb_init { args } { if { [llength $args] > 0 } { global pf_prefix - set file [lindex $args 0]; + set file [lindex $args 0] - set pf_prefix "[file tail [file dirname $file]]/[file tail $file]:"; + set pf_prefix "[file tail [file dirname $file]]/[file tail $file]:" } - global gdb_prompt; + global gdb_prompt if [target_info exists gdb_prompt] { - set gdb_prompt [target_info gdb_prompt]; + set gdb_prompt [target_info gdb_prompt] } else { set gdb_prompt "\\(gdb\\)" } @@ -3619,7 +3619,7 @@ proc test_debug_format {format} { # expected to fail, 0 otherwise (or if it is unknown). Must have # previously called get_debug_format. proc setup_xfail_format { format } { - set ret [test_debug_format $format]; + set ret [test_debug_format $format] if {$ret} then { setup_xfail "*-*-*" @@ -3807,7 +3807,7 @@ proc rerun_to_main {} { proc gdb_skip_float_test { msg } { if [target_info exists gdb,skip_float_tests] { - verbose "Skipping test '$msg': no float tests."; + verbose "Skipping test '$msg': no float tests." return 1 } return 0 @@ -3818,7 +3818,7 @@ proc gdb_skip_float_test { msg } { proc gdb_skip_stdio_test { msg } { if [target_info exists gdb,noinferiorio] { - verbose "Skipping test '$msg': no inferior i/o."; + verbose "Skipping test '$msg': no inferior i/o." return 1 } return 0 diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 79ecc5a..93884a6 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -346,7 +346,7 @@ proc gdbserver_reconnect { } { global gdbserver_protocol global gdbserver_gdbport - global gdbserver_reconnect_p; + global gdbserver_reconnect_p if {![info exists gdbserver_reconnect_p] || !$gdbserver_reconnect_p} { error "gdbserver_reconnect_p is not set before gdbserver_reconnect" return 0 diff --git a/gdb/testsuite/lib/java.exp b/gdb/testsuite/lib/java.exp index ced37a4..19b1eee 100644 --- a/gdb/testsuite/lib/java.exp +++ b/gdb/testsuite/lib/java.exp @@ -31,8 +31,8 @@ set java_initialized 0 # Build the status wrapper library as needed. # proc java_init { args } { - global wrapper_file; - global wrap_compile_flags; + global wrapper_file + global wrap_compile_flags global java_initialized global GCJ_UNDER_TEST global TOOL_EXECUTABLE @@ -42,7 +42,7 @@ proc java_init { args } { if ![info exists GCJ_UNDER_TEST] { if [info exists TOOL_EXECUTABLE] { - set GCJ_UNDER_TEST $TOOL_EXECUTABLE; + set GCJ_UNDER_TEST $TOOL_EXECUTABLE } else { if { [info exists env(GCJ)] && $env(GCJ) != "" } { set GCJ_UNDER_TEST $env(GCJ) @@ -51,14 +51,14 @@ proc java_init { args } { global target_alias if ![is_remote host] { - set file [lookfor_file $tool_root_dir gcj]; + set file [lookfor_file $tool_root_dir gcj] if { $file == "" } { - set file [lookfor_file $tool_root_dir gcc/gcj]; + set file [lookfor_file $tool_root_dir gcc/gcj] } if { $file != "" } { - set CC "$file -B[file dirname $file]/ --specs=$tool_root_dir/$target_alias/libjava/libgcj-test.spec"; + set CC "$file -B[file dirname $file]/ --specs=$tool_root_dir/$target_alias/libjava/libgcj-test.spec" } else { - set CC [transform gcj]; + set CC [transform gcj] } } else { set CC [transform gcj] @@ -68,13 +68,13 @@ proc java_init { args } { } } - set wrapper_file ""; - set wrap_compile_flags ""; + set wrapper_file "" + set wrap_compile_flags "" if [target_info exists needs_status_wrapper] { - set result [build_wrapper "testglue.o"]; + set result [build_wrapper "testglue.o"] if { $result != "" } { - set wrapper_file [lindex $result 0]; - set wrap_compile_flags [lindex $result 1]; + set wrapper_file [lindex $result 0] + set wrap_compile_flags [lindex $result 1] } else { warning "Status wrapper failed to build." } diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 50b926f..86a0fd6 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -45,33 +45,33 @@ proc mi_uncatched_gdb_exit {} { global GDB global INTERNAL_GDBFLAGS GDBFLAGS global verbose - global gdb_spawn_id; + global gdb_spawn_id global gdb_prompt global mi_gdb_prompt global MIFLAGS - gdb_stop_suppressing_tests; + gdb_stop_suppressing_tests if { [info procs sid_exit] != "" } { sid_exit } if ![info exists gdb_spawn_id] { - return; + return } verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS" if { [is_remote host] && [board_info host exists fileid] } { - send_gdb "999-gdb-exit\n"; + send_gdb "999-gdb-exit\n" gdb_expect 10 { -re "y or n" { - send_gdb "y\n"; - exp_continue; + send_gdb "y\n" + exp_continue } -re "Undefined command.*$gdb_prompt $" { send_gdb "quit\n" - exp_continue; + exp_continue } -re "DOSEXIT code" { } default { } @@ -79,7 +79,7 @@ proc mi_uncatched_gdb_exit {} { } if ![is_remote host] { - remote_close host; + remote_close host } unset gdb_spawn_id } @@ -102,10 +102,10 @@ proc default_mi_gdb_start { args } { global gdb_prompt global mi_gdb_prompt global timeout - global gdb_spawn_id; + global gdb_spawn_id global MIFLAGS - gdb_stop_suppressing_tests; + gdb_stop_suppressing_tests set inferior_pty no-tty # Set the default value, it may be overriden later by specific testfile. @@ -145,7 +145,7 @@ proc default_mi_gdb_start { args } { set mi_inferior_tty_name $spawn_out(slave,name) } - set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"]; + set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"] if { $res < 0 || $res == "" } { perror "Spawning $GDB failed." return 1 @@ -157,7 +157,7 @@ proc default_mi_gdb_start { args } { # using the old-style prompt. if { $MIFLAGS == "-i=mi1" } { perror "(mi startup) Got unexpected new mi prompt." - remote_close host; + remote_close host return -1 } verbose "GDB initialized." @@ -168,28 +168,28 @@ proc default_mi_gdb_start { args } { # using the new-style prompt. if { $MIFLAGS != "-i=mi1" } { perror "(mi startup) Got unexpected old mi prompt." - remote_close host; + remote_close host return -1 } verbose "GDB initialized." } -re ".*unrecognized option.*for a complete list of options." { untested "Skip mi tests (not compiled with mi support)." - remote_close host; + remote_close host return -1 } -re ".*Interpreter `mi' unrecognized." { untested "Skip mi tests (not compiled with mi support)." - remote_close host; + remote_close host return -1 } timeout { perror "(timeout) GDB never initialized after 10 seconds." - remote_close host; + remote_close host return -1 } } - set gdb_spawn_id -1; + set gdb_spawn_id -1 # FIXME: mi output does not go through pagers, so these can be removed. # force the height to "unlimited", so no pagers get used @@ -252,7 +252,7 @@ proc mi_delete_breakpoints {} { send_gdb "102-break-delete\n" gdb_expect 30 { -re "Delete all breakpoints.*y or n.*$" { - send_gdb "y\n"; + send_gdb "y\n" exp_continue } -re "102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" { @@ -270,8 +270,8 @@ proc mi_delete_breakpoints {} { -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"} -re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return } -re "Delete all breakpoints.*or n.*$" { - warning "Unexpected prompt for breakpoints deletion"; - send_gdb "y\n"; + warning "Unexpected prompt for breakpoints deletion" + send_gdb "y\n" exp_continue } timeout { perror "-break-list (timeout)" ; return } @@ -338,29 +338,29 @@ proc mi_gdb_target_cmd { targetname serialport } { send_gdb "47-target-select $targetname $serialport\n" gdb_expect 60 { -re "47\\^connected.*$mi_gdb_prompt" { - verbose "Set target to $targetname"; + verbose "Set target to $targetname" return 0 } -re "unknown host.*$mi_gdb_prompt" { verbose "Couldn't look up $serialport" } -re "Couldn't establish connection to remote.*$mi_gdb_prompt$" { - verbose "Connection failed"; + verbose "Connection failed" } -re "Remote MIPS debugging.*$mi_gdb_prompt$" { - verbose "Set target to $targetname"; + verbose "Set target to $targetname" return 0 } -re "Remote debugging using .*$serialport_re.*$mi_gdb_prompt$" { - verbose "Set target to $targetname"; + verbose "Set target to $targetname" return 0 } -re "Remote target $targetname connected to.*$mi_gdb_prompt$" { - verbose "Set target to $targetname"; + verbose "Set target to $targetname" return 0 } -re "Connected to.*$mi_gdb_prompt$" { - verbose "Set target to $targetname"; + verbose "Set target to $targetname" return 0 } -re "Ending remote.*$mi_gdb_prompt$" { } @@ -374,10 +374,10 @@ proc mi_gdb_target_cmd { targetname serialport } { return 1 } -re "Timeout reading from remote system.*$mi_gdb_prompt$" { - verbose "Got timeout error from gdb."; + verbose "Got timeout error from gdb." } timeout { - send_gdb ""; + send_gdb "" break } } @@ -401,7 +401,7 @@ proc mi_gdb_file_cmd { arg } { set last_loaded_file $arg if [is_remote host] { - set arg [remote_download host $arg]; + set arg [remote_download host $arg] if { $arg == "" } { error "download failed" return -1 @@ -591,8 +591,8 @@ proc mi_gdb_test { args } { } if [llength $args]==5 { - set question_string [lindex $args 3]; - set response_string [lindex $args 4]; + set question_string [lindex $args 3] + set response_string [lindex $args 4] } else { set question_string "^FOOBAR$" } @@ -604,54 +604,54 @@ proc mi_gdb_test { args } { } set result -1 - set string "${command}\n"; + set string "${command}\n" set string_regex [string_to_regexp $command] if { $command != "" } { while { "$string" != "" } { - set foo [string first "\n" "$string"]; - set len [string length "$string"]; + set foo [string first "\n" "$string"] + set len [string length "$string"] if { $foo < [expr $len - 1] } { - set str [string range "$string" 0 $foo]; + set str [string range "$string" 0 $foo] if { [send_gdb "$str"] != "" } { - global suppress_flag; + global suppress_flag if { ! $suppress_flag } { - perror "Couldn't send $command to GDB."; + perror "Couldn't send $command to GDB." } - fail "$message"; + fail "$message" return $result } gdb_expect 2 { -re "\[\r\n\]" { } timeout { } } - set string [string range "$string" [expr $foo + 1] end]; + set string [string range "$string" [expr $foo + 1] end] } else { - break; + break } } if { "$string" != "" } { if { [send_gdb "$string"] != "" } { - global suppress_flag; + global suppress_flag if { ! $suppress_flag } { - perror "Couldn't send $command to GDB."; + perror "Couldn't send $command to GDB." } - fail "$message"; + fail "$message" return $result } } } if [info exists timeout] { - set tmt $timeout; + set tmt $timeout } else { - global timeout; + global timeout if [info exists timeout] { - set tmt $timeout; + set tmt $timeout } else { - set tmt 60; + set tmt 60 } } if {$async} { @@ -663,9 +663,9 @@ proc mi_gdb_test { args } { gdb_expect $tmt { -re "\\*\\*\\* DOSEXIT code.*" { if { $message != "" } { - fail "$message"; + fail "$message" } - gdb_suppress_entire_file "GDB died"; + gdb_suppress_entire_file "GDB died" return -1 } -re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" { @@ -695,8 +695,8 @@ proc mi_gdb_test { args } { set result 0 } -re "(${question_string})$" { - send_gdb "$response_string\n"; - exp_continue; + send_gdb "$response_string\n" + exp_continue } -re "Undefined.* command:.*$mi_gdb_prompt\[ \]*$" { perror "Undefined command \"$command\"." @@ -809,11 +809,11 @@ proc mi_run_cmd_full {use_mi_command args} { } if [target_info exists gdb_init_command] { - send_gdb "[target_info gdb_init_command]\n"; + send_gdb "[target_info gdb_init_command]\n" gdb_expect 30 { -re "$mi_gdb_prompt$" { } default { - perror "gdb_init_command for target failed"; + perror "gdb_init_command for target failed" return -1 } } @@ -825,7 +825,7 @@ proc mi_run_cmd_full {use_mi_command args} { if $use_gdb_stub { if [target_info exists gdb,do_reload_on_run] { - send_gdb "${run_prefix}continue\n"; + send_gdb "${run_prefix}continue\n" gdb_expect 60 { -re "${run_match}\\^running\[\r\n\]+\\*running,thread-id=\"\[^\"\]+\"\r\n$mi_gdb_prompt" {} default {} @@ -834,9 +834,9 @@ proc mi_run_cmd_full {use_mi_command args} { } if [target_info exists gdb,start_symbol] { - set start [target_info gdb,start_symbol]; + set start [target_info gdb,start_symbol] } else { - set start "start"; + set start "start" } # HACK: Should either use 000-jump or fix the target code diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp index 7e52233..784ab6c 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -86,7 +86,7 @@ proc gpc_compile {source dest type options} { foreach i $options { if { $i == "debug" } { if [board_info $dest exists debug_flags] { - append add_flags " [board_info $dest debug_flags]"; + append add_flags " [board_info $dest debug_flags]" } else { append add_flags " -g" } @@ -115,7 +115,7 @@ proc fpc_compile {source dest type options} { foreach i $options { if { $i == "debug" } { if [board_info $dest exists debug_flags] { - append add_flags " [board_info $dest debug_flags]"; + append add_flags " [board_info $dest debug_flags]" } else { append add_flags " -g" } diff --git a/gdb/testsuite/lib/prompt.exp b/gdb/testsuite/lib/prompt.exp index 87d889c..63b05fa 100644 --- a/gdb/testsuite/lib/prompt.exp +++ b/gdb/testsuite/lib/prompt.exp @@ -30,9 +30,9 @@ proc default_prompt_gdb_start { } { global gdb_prompt global gdb_prompt_fail global timeout - global gdb_spawn_id; + global gdb_spawn_id - gdb_stop_suppressing_tests; + gdb_stop_suppressing_tests verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS" @@ -46,7 +46,7 @@ proc default_prompt_gdb_start { } { exit 1 } } - set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"]; + set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"] if { $res < 0 || $res == "" } { perror "Spawning $GDB failed." return 1 @@ -74,11 +74,11 @@ proc default_prompt_gdb_start { } { } timeout { perror "(timeout) GDB never initialized after 10 seconds." - remote_close host; + remote_close host return -1 } } - set gdb_spawn_id -1; + set gdb_spawn_id -1 return 0 } diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp index 2601ad8..4ffd01c 100644 --- a/gdb/testsuite/lib/trace-support.exp +++ b/gdb/testsuite/lib/trace-support.exp @@ -69,7 +69,7 @@ proc gdb_delete_tracepoints {} { send_gdb "delete tracepoints\n" gdb_expect 30 { -re "Delete all tracepoints.*y or n.*$" { - send_gdb "y\n"; + send_gdb "y\n" exp_continue } -re ".*$gdb_prompt $" { # This happens if there were no tracepoints } @@ -98,12 +98,12 @@ proc gdb_delete_tracepoints {} { # non-zero -- failure proc gdb_trace_setactions_command { actions_command testname tracepoint args } { - global gdb_prompt; + global gdb_prompt - set state 0; - set passfail "pass"; - send_gdb "$actions_command $tracepoint\n"; - set expected_result ""; + set state 0 + set passfail "pass" + send_gdb "$actions_command $tracepoint\n" + set expected_result "" gdb_expect 5 { -re "No tracepoint number .*$gdb_prompt $" { fail $testname @@ -111,52 +111,52 @@ proc gdb_trace_setactions_command { actions_command testname tracepoint args } { } -re "Enter actions for tracepoint $tracepoint.*>" { if { [llength $args] > 0 } { - set lastcommand "[lindex $args $state]"; - send_gdb "[lindex $args $state]\n"; - incr state; - set expected_result [lindex $args $state]; - incr state; + set lastcommand "[lindex $args $state]" + send_gdb "[lindex $args $state]\n" + incr state + set expected_result [lindex $args $state] + incr state } else { - send_gdb "end\n"; + send_gdb "end\n" } - exp_continue; + exp_continue } -re "\(.*\)\[\r\n\]+\[ \t]*>$" { if { $expected_result != "" } { - regsub "^\[^\r\n\]+\[\r\n\]+" "$expect_out(1,string)" "" out; + regsub "^\[^\r\n\]+\[\r\n\]+" "$expect_out(1,string)" "" out if ![regexp $expected_result $out] { - set passfail "fail"; + set passfail "fail" } - set expected_result ""; + set expected_result "" } if { $state < [llength $args] } { - send_gdb "[lindex $args $state]\n"; - incr state; - set expected_result [lindex $args $state]; - incr state; + send_gdb "[lindex $args $state]\n" + incr state + set expected_result [lindex $args $state] + incr state } else { - send_gdb "end\n"; - set expected_result ""; + send_gdb "end\n" + set expected_result "" } - exp_continue; + exp_continue } -re "\(.*\)$gdb_prompt $" { if { $expected_result != "" } { if ![regexp $expected_result $expect_out(1,string)] { - set passfail "fail"; + set passfail "fail" } - set expected_result ""; + set expected_result "" } if { [llength $args] < $state } { - set passfail "fail"; + set passfail "fail" } } default { - set passfail "fail"; + set passfail "fail" } } if { $testname != "" } { - $passfail $testname; + $passfail $testname } if { $passfail == "pass" } then { return 0 @@ -193,28 +193,28 @@ proc gdb_trace_setcommands { testname tracepoint args } { # proc gdb_tfind_test { testname tfind_arg exp_res args } { - global gdb_prompt; + global gdb_prompt if { "$args" != "" } { - set expr "$exp_res"; - set exp_res "$args"; + set expr "$exp_res" + set exp_res "$args" } else { - set expr "(int) \$trace_frame"; + set expr "(int) \$trace_frame" } - set passfail "fail"; + set passfail "fail" gdb_test "tfind $tfind_arg" "" "" - send_gdb "printf \"x \%d x\\n\", $expr\n"; + send_gdb "printf \"x \%d x\\n\", $expr\n" gdb_expect 10 { -re "x (-*\[0-9\]+) x" { if { $expect_out(1,string) == $exp_res } { - set passfail "pass"; + set passfail "pass" } - exp_continue; + exp_continue } -re "$gdb_prompt $" { } } - $passfail "$testname"; + $passfail "$testname" if { $passfail == "pass" } then { return 0 } else { @@ -232,13 +232,13 @@ proc gdb_tfind_test { testname tfind_arg exp_res args } { # proc gdb_readexpr { gdb_expr } { - global gdb_prompt; + global gdb_prompt - set result -1; + set result -1 send_gdb "print $gdb_expr\n" gdb_expect 5 { -re "\[$\].*= (\[0-9\]+).*$gdb_prompt $" { - set result $expect_out(1,string); + set result $expect_out(1,string) } -re "$gdb_prompt $" { } default { } @@ -255,7 +255,7 @@ proc gdb_readexpr { gdb_expr } { # proc gdb_gettpnum { tracepoint } { - global gdb_prompt; + global gdb_prompt if { $tracepoint != "" } { gdb_test "trace $tracepoint" "" "" @@ -276,9 +276,9 @@ proc gdb_gettpnum { tracepoint } { # proc gdb_find_function_baseline { func_name } { - global gdb_prompt; + global gdb_prompt - set baseline -1; + set baseline -1 send_gdb "list $func_name\n" # gdb_expect { @@ -300,15 +300,15 @@ proc gdb_find_function_baseline { func_name } { # proc gdb_find_recursion_test_baseline { filename } { - global gdb_prompt; + global gdb_prompt - set baseline -1; + set baseline -1 gdb_test "list $filename:1" "" "" send_gdb "search gdb_recursion_test line 0\n" gdb_expect { -re "(\[0-9\]+)\[\t \]+\{.*line 0.*$gdb_prompt $" { - set baseline $expect_out(1,string); + set baseline $expect_out(1,string) } -re "$gdb_prompt $" { } default { } |