diff --git a/src/test/when_threads.py b/src/test/when_threads.py index c2b7d250ce8..c1f0a5df6cc 100644 --- a/src/test/when_threads.py +++ b/src/test/when_threads.py @@ -1,46 +1,42 @@ from util import * import re -send_gdb('break do_thread') -expect_gdb('Breakpoint 1') -send_gdb('continue') -expect_gdb('Breakpoint 1') +bp = breakpoint_at_function('do_thread') +cont() +expect_breakpoint_stop(bp) -send_gdb('when-ticks') -expect_gdb(re.compile(r'Current tick: (\d+)')) +send_custom_command('when-ticks') +expect_debugger(re.compile(r'Current tick: (\d+)')) thread_ticks = int(last_match().group(1)) -send_gdb('when-tid') -expect_gdb(re.compile(r'Current tid: (\d+)')) +send_custom_command('when-tid') +expect_debugger(re.compile(r'Current tid: (\d+)')) thread_tid = int(last_match().group(1)) -send_gdb('info threads') -expect_gdb('do_thread') -send_gdb('when-ticks') -expect_gdb(re.compile(r'Current tick: (\d+)')) +expect_threads(2, 2) +send_custom_command('when-ticks') +expect_debugger(re.compile(r'Current tick: (\d+)')) thread_ticks2 = int(last_match().group(1)) assert thread_ticks == thread_ticks2 -send_gdb('when-tid') -expect_gdb(re.compile(r'Current tid: (\d+)')) +send_custom_command('when-tid') +expect_debugger(re.compile(r'Current tid: (\d+)')) thread_tid2 = int(last_match().group(1)) assert thread_tid == thread_tid2 -send_gdb('thread 1') -expect_gdb('Switching') -send_gdb('when-ticks') -expect_gdb(re.compile(r'Current tick: (\d+)')) +select_thread(1) +send_custom_command('when-ticks') +expect_debugger(re.compile(r'Current tick: (\d+)')) main_ticks = int(last_match().group(1)) -send_gdb('when-tid') -expect_gdb(re.compile(r'Current tid: (\d+)')) +send_custom_command('when-tid') +expect_debugger(re.compile(r'Current tid: (\d+)')) main_tid = int(last_match().group(1)) -send_gdb('info threads') -expect_gdb('do_thread') -send_gdb('when-ticks') -expect_gdb(re.compile(r'Current tick: (\d+)')) +expect_threads(2, 1) +send_custom_command('when-ticks') +expect_debugger(re.compile(r'Current tick: (\d+)')) main_ticks2 = int(last_match().group(1)) assert main_ticks == main_ticks2 -send_gdb('when-tid') -expect_gdb(re.compile(r'Current tid: (\d+)')) +send_custom_command('when-tid') +expect_debugger(re.compile(r'Current tid: (\d+)')) main_tid2 = int(last_match().group(1)) assert main_tid == main_tid2 diff --git a/src/test/when_threads.run b/src/test/when_threads.run index 0e9b81df833..3eadb5a637f 100644 --- a/src/test/when_threads.run +++ b/src/test/when_threads.run @@ -1,2 +1,2 @@ source `dirname $0`/util.sh -debug_test_gdb_only +debug_test