Skip to content

Commit e9ccf54

Browse files
authored
debug: accept GDB's main thread identifier (#657)
Recent GDB versions print 'Thread <main>' for remote targets that expose a single synthetic thread. The thread parser only accepts 'Remote target' or numbered threads with names, so test setup fails before the test body runs. Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
1 parent 447a5fc commit e9ccf54

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

debug/testlib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,8 @@ def threads(self):
10671067
m = re.match(
10681068
r"[\s\*]*(\d+)\s*"
10691069
r'(Remote target'
1070-
r'|Thread (\d+)\s*(?:".*?")?\s*\(Name: ([^\)]+))'
1070+
r'|Thread (?:(\d+)|<main>)'
1071+
r'(?:\s*(?:".*?")?\s*\(Name: ([^)]+)\))?)'
10711072
r"\s*(.*)", line)
10721073
if m:
10731074
threads.append(Thread(*m.groups()))

0 commit comments

Comments
 (0)