aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebug/gdbserver.py20
-rw-r--r--debug/testlib.py8
2 files changed, 23 insertions, 5 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:
diff --git a/debug/testlib.py b/debug/testlib.py
index fc7e9af..2155e05 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -1000,6 +1000,8 @@ def run_all_tests(module, target, parsed):
gdb_cmd = parsed.gdb
global gcc_cmd # pylint: disable=global-statement
gcc_cmd = parsed.gcc
+ global target_timeout # pylint: disable=global-statement
+ target_timeout = parsed.target_timeout
examine_added = False
for hart in target.harts:
@@ -1103,6 +1105,8 @@ def add_test_run_options(parser):
"specified.")
parser.add_argument("--exclude-tests",
help="Specify yaml file listing tests to exclude")
+ parser.add_argument("--target-timeout",
+ help="Override the base target timeout.", default=None, type=int)
def header(title, dash='-', length=78):
if title:
@@ -1245,6 +1249,7 @@ class BaseTest:
return result
gdb_cmd = None
+target_timeout = None
class GdbTest(BaseTest):
def __init__(self, target, hart=None):
BaseTest.__init__(self, target, hart=hart)
@@ -1260,7 +1265,8 @@ class GdbTest(BaseTest):
BaseTest.classSetup(self)
self.gdb = Gdb(self.target, self.server.gdb_ports, cmd=gdb_cmd,
- timeout=self.target.timeout_sec, binaries=self.binaries)
+ timeout=target_timeout or self.target.timeout_sec,
+ binaries=self.binaries)
self.logs += self.gdb.lognames()
self.gdb.connect()