MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / parseThreadLine

Function parseThreadLine

src/mcp/tools/debugging/debug_stack.ts:58–76  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

56}
57
58function parseThreadLine(line: string): { threadId: number; name: string } | null {
59 const trimmed = line.trim();
60
61 const simpleMatch = trimmed.match(/^Thread\s+(\d+)(?:\s+\((.+)\))?$/);
62 if (simpleMatch) {
63 const threadId = Number(simpleMatch[1]);
64 const name = simpleMatch[2]?.trim() || `Thread ${threadId}`;
65 return { threadId, name };
66 }
67
68 const lldbMatch = trimmed.match(/^\*?\s*thread #(\d+).*?(?:name = ['"]([^'"]+)['"])?/i);
69 if (lldbMatch) {
70 const threadId = Number(lldbMatch[1]);
71 const name = lldbMatch[2]?.trim() || `Thread ${threadId}`;
72 return { threadId, name };
73 }
74
75 return null;
76}
77
78function parseFrameLine(line: string): DebugStackFrame | null {
79 const trimmed = line.trim();

Callers 1

parseStackOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected