aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-06-29 10:06:06 -0700
committerGitHub <noreply@github.com>2023-06-29 10:06:06 -0700
commit784c89ee1c4e7124a0973fda744522ebe532174b (patch)
tree01270d9ad6673be059713134e53b86f94f446389
parent271655ffb6f93fbcf4fbd9ad995aabf206a31777 (diff)
parent2dc03118e5d253b96901c2c1e5e859b023cf9c3c (diff)
downloadriscv-tests-784c89ee1c4e7124a0973fda744522ebe532174b.zip
riscv-tests-784c89ee1c4e7124a0973fda744522ebe532174b.tar.gz
riscv-tests-784c89ee1c4e7124a0973fda744522ebe532174b.tar.bz2
Merge pull request #478 from Du-Chao/master
debug: optimize the FreeRtosTest case.
-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: