aboutsummaryrefslogtreecommitdiff
path: root/debug/gdbserver.py
diff options
context:
space:
mode:
authorChao Du <duchao@eswincomputing.com>2023-06-15 07:28:32 +0000
committerChao Du <duchao@eswincomputing.com>2023-06-15 07:28:32 +0000
commit2dc03118e5d253b96901c2c1e5e859b023cf9c3c (patch)
tree891e9828f25a0f19d96cad859a7ab233e69cb9b1 /debug/gdbserver.py
parentd0d1b08f8c49354de0a11a0f3dff44eea5eb8281 (diff)
downloadriscv-tests-2dc03118e5d253b96901c2c1e5e859b023cf9c3c.zip
riscv-tests-2dc03118e5d253b96901c2c1e5e859b023cf9c3c.tar.gz
riscv-tests-2dc03118e5d253b96901c2c1e5e859b023cf9c3c.tar.bz2
debug: optimize the FreeRtosTest case.
To make sure the rtos module of OpenOCD works well. Signed-off-by: Chao Du <duchao@eswincomputing.com>
Diffstat (limited to 'debug/gdbserver.py')
-rwxr-xr-xdebug/gdbserver.py20
1 files changed, 16 insertions, 4 deletions
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: