MCPcopy Create free account
hub / github.com/Vector35/debugger / GetFramesOfThread

Method GetFramesOfThread

core/adapters/lldbadapter.cpp:533–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531
532
533std::vector<DebugFrame> LldbAdapter::GetFramesOfThread(uint32_t tid)
534{
535 size_t threadCount = m_process.GetNumThreads();
536 std::vector<DebugFrame> result;
537 result.reserve(threadCount);
538 for (size_t i = 0; i < threadCount; i++)
539 {
540 SBThread thread = m_process.GetThreadAtIndex(i);
541 if (!thread.IsValid())
542 continue;
543 if (tid == thread.GetThreadID())
544 {
545 size_t frameCount = thread.GetNumFrames();
546 for (size_t j = 0; j < frameCount; j++)
547 {
548 SBFrame frame = thread.GetFrameAtIndex(j);
549 if (!frame.IsValid())
550 continue;
551 SBModule module = frame.GetModule();
552 SBFileSpec fileSpec = module.GetFileSpec();
553 std::string modulePath;
554 if (fileSpec.GetFilename())
555 modulePath = fileSpec.GetFilename();
556
557 uint64_t startAddress = 0;
558 SBFunction function = frame.GetFunction();
559 if (function.IsValid())
560 {
561 startAddress = function.GetStartAddress().GetLoadAddress(m_target);
562 }
563 else
564 {
565 SBSymbol symbol = frame.GetSymbol();
566 if (symbol.IsValid())
567 startAddress = symbol.GetStartAddress().GetLoadAddress(m_target);
568 }
569
570 std::string frameFunctionName;
571 if (frame.GetFunctionName())
572 frameFunctionName = std::string(frame.GetFunctionName());
573 DebugFrame f(
574 j, frame.GetPC(), frame.GetSP(), frame.GetFP(), frameFunctionName, startAddress, modulePath);
575 result.push_back(f);
576 }
577 return result;
578 }
579 }
580 return result;
581}
582
583
584DebugBreakpoint LldbAdapter::AddBreakpoint(const std::uintptr_t address, unsigned long breakpoint_type)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected