diff options
author | Michael Snyder <msnyder@vmware.com> | 2010-06-02 19:58:21 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2010-06-02 19:58:21 +0000 |
commit | 9db7054520d96d6e4d4c40a54280a2cec73b7adb (patch) | |
tree | 24e7b50f1e92ca99d9092839614139e221c0f477 /gdb/testsuite/gdb.threads/schedlock.exp | |
parent | 0ab48859b9a642d6393ccb0c43bda33360b83750 (diff) | |
download | gdb-9db7054520d96d6e4d4c40a54280a2cec73b7adb.zip gdb-9db7054520d96d6e4d4c40a54280a2cec73b7adb.tar.gz gdb-9db7054520d96d6e4d4c40a54280a2cec73b7adb.tar.bz2 |
2010-06-02 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdb.threads/attach-stopped.exp:
Replace uses of send_gdb / gdb_expect.
* gdb.threads/attachstop-mt.exp:
Replace uses of send_gdb / gdb_expect.
* gdb.threads/gcore-thread.exp:
Replace uses of send_gdb / gdb_expect.
* gdb.threads/hand-call-in-threads.exp:
Replace uses of send_gdb / gdb_expect.
* gdb.threads/linux-dp.exp: Replace uses of send_gdb / gdb_expect.
* gdb.threads/print-threads.exp:
Replace uses of send_gdb / gdb_expect.
* gdb.threads/pthreads.exp: Replace uses of send_gdb / gdb_expect.
* gdb.threads/schedlock.exp: Replace uses of send_gdb / gdb_expect.
* gdb.threads/sigthread.exp: Replace uses of send_gdb / gdb_expect.
Diffstat (limited to 'gdb/testsuite/gdb.threads/schedlock.exp')
-rw-r--r-- | gdb/testsuite/gdb.threads/schedlock.exp | 119 |
1 files changed, 45 insertions, 74 deletions
diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp index 5f966f9..5a3ab5b 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -38,37 +38,27 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab # Now we can proceed with the real testing. proc get_args { } { - global list_count - global gdb_prompt - global NUM + global list_count + global gdb_prompt + global NUM - set pattern "(\[0-9\]+)" - for {set i 1} {[expr $i < $NUM]} {incr i} { - append pattern ", (\[0-9\]+)" - } + set pattern "(\[0-9\]+)" + for {set i 1} {[expr $i < $NUM]} {incr i} { + append pattern ", (\[0-9\]+)" + } - send_gdb "print args\n" - gdb_expect { - -re "\\\$\[0-9\]+ = {$pattern}.*$gdb_prompt" - { - set list_count [expr $list_count + 1] - pass "listed args ($list_count)" + gdb_test_multiple "print args" "listed args ($list_count)" { + -re "\\\$\[0-9\]+ = {$pattern}.*$gdb_prompt $" { + set list_count [expr $list_count + 1] + pass "listed args ($list_count)" - set result "" - for {set i 1} {[expr $i <= $NUM]} {incr i} { - lappend result $expect_out($i,string) + set result "" + for {set i 1} {[expr $i <= $NUM]} {incr i} { + lappend result $expect_out($i,string) + } + return $result } - return $result - } - -re "$gdb_prompt" - { - fail "listed args ($list_count) (unknown output)" - } - timeout - { - fail "listed args ($list_count) (timeout)" - } - } + } } proc stop_process { description } { @@ -90,50 +80,38 @@ proc stop_process { description } { } proc get_current_thread { description } { - global gdb_prompt + global gdb_prompt - send_gdb "bt\n" - gdb_expect { - -re "thread_function \\(arg=0x(\[0-9\])\\).*$gdb_prompt $" - { - pass $description - return $expect_out(1,string) - } - -re "$gdb_prompt $" - { - fail "$description (unknown output)" - } - timeout - { - fail "$description (timeout)" - } - } + gdb_test_multiple "bt" "$description" { + -re "thread_function \\(arg=0x(\[0-9\])\\).*$gdb_prompt $" { + pass $description + return $expect_out(1,string) + } + } + return "" } proc my_continue { msg } { - send_gdb "continue\n" - gdb_expect { - -re "Continuing" - { pass "continue ($msg)" } - timeout - { fail "continue ($msg) (timeout)" } - } + gdb_test_multiple "continue" "continuing ($msg)" { + -re "Continuing" { + pass "continue ($msg)" + } + } - stop_process "stop all threads ($msg)" + stop_process "stop all threads ($msg)" - # Make sure we're in one of the non-main looping threads. - gdb_breakpoint [concat [gdb_get_line_number "schedlock.exp: main loop"] " if arg != 0"] - gdb_continue_to_breakpoint "return to loop ($msg)" - delete_breakpoints + # Make sure we're in one of the non-main looping threads. + gdb_breakpoint [concat [gdb_get_line_number "schedlock.exp: main loop"] " if arg != 0"] + gdb_continue_to_breakpoint "return to loop ($msg)" + delete_breakpoints } proc step_ten_loops { msg } { global gdb_prompt for {set i 0} {[expr $i < 10]} {set i [expr $i + 1]} { - send_gdb "step\n" set other_step 0 - gdb_expect { + gdb_test_multiple "step" "step to increment ($msg $i)" { -re ".*myp\\) \\+\\+;\[\r\n\]+$gdb_prompt $" { pass "step to increment ($msg $i)" } @@ -147,9 +125,6 @@ proc step_ten_loops { msg } { # FIXME cascade? } } - timeout { - fail "step to increment ($msg $i) (timeout)" - } } } } @@ -176,22 +151,18 @@ gdb_test "set width 0" "" runto_main # See if scheduler locking is available on this target. -send_gdb "set scheduler-locking off\n" global gdb_prompt -gdb_expect { - -re "Target .* cannot support this command" - { - unsupported "target does not support scheduler locking" - return +gdb_test_multiple "set scheduler-locking off" "scheduler locking set to none" { + -re "Target .* cannot support this command" { + unsupported "target does not support scheduler locking" + return } - -re "$gdb_prompt $" - { - pass "scheduler locking set to none" + -re "$gdb_prompt $" { + pass "scheduler locking set to none" } - timeout - { - unsupported "target does not support scheduler locking (timeout)" - return + timeout { + unsupported "target does not support scheduler locking (timeout)" + return } } |