| 428 | |
| 429 | |
| 430 | std::vector<DebugThread> LldbAdapter::GetThreadList() |
| 431 | { |
| 432 | size_t threadCount = m_process.GetNumThreads(); |
| 433 | std::vector<DebugThread> result; |
| 434 | for (size_t i = 0; i < threadCount; i++) |
| 435 | { |
| 436 | SBThread thread = m_process.GetThreadAtIndex(i); |
| 437 | if (!thread.IsValid()) |
| 438 | continue; |
| 439 | auto tid = thread.GetThreadID(); |
| 440 | uint64_t pc = 0; |
| 441 | |
| 442 | size_t frameCount = thread.GetNumFrames(); |
| 443 | if (frameCount > 0) |
| 444 | { |
| 445 | SBFrame frame = thread.GetFrameAtIndex(0); |
| 446 | if (frame.IsValid()) |
| 447 | pc = frame.GetPC(); |
| 448 | } |
| 449 | result.emplace_back(tid, pc); |
| 450 | } |
| 451 | return result; |
| 452 | } |
| 453 | |
| 454 | |
| 455 | DebugThread LldbAdapter::GetActiveThread() const |