From 2dc03118e5d253b96901c2c1e5e859b023cf9c3c Mon Sep 17 00:00:00 2001 From: Chao Du Date: Thu, 15 Jun 2023 07:28:32 +0000 Subject: debug: optimize the FreeRtosTest case. To make sure the rtos module of OpenOCD works well. Signed-off-by: Chao Du --- debug/gdbserver.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'debug/gdbserver.py') diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 0faebd9..764d1d0 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -1905,19 +1905,31 @@ class FreeRtosTest(GdbTest): # thread. self.gdb.threads() - bp = self.gdb.b("prvQueueReceiveTask") + # fake 'Current Execution' thread is created. + threads = self.gdb.threads() + assertEqual(len(threads), 1) + assertIn("Current Execution", threads[0]) + bp = self.gdb.b("vTaskStartScheduler") self.gdb.c() self.gdb.command(f"delete {bp}") + # 'Current Execution' is still there before the scheduler has been started. + # Now there are 3 threads: Current Execution, Rx, Tx. + threads = self.gdb.threads() + assertEqual(len(threads), 3) - bp = self.gdb.b("prvQueueSendTask") + bp = self.gdb.b("prvQueueReceiveTask") self.gdb.c() self.gdb.command(f"delete {bp}") - # Now we know for sure at least 2 threads have executed. + bp = self.gdb.b("prvQueueSendTask") + self.gdb.c() + self.gdb.command(f"delete {bp}") + # no more fake 'Current Execution' thread. + # Now there are 4 threads: Rx, Tx, IDLE, Tmr Svc. threads = self.gdb.threads() - assertGreater(len(threads), 1) + assertEqual(len(threads), 4) values = {} for thread in threads: -- cgit v1.1