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

Method FixActiveThread

core/adapters/lldbadapter.cpp:1320–1346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1318
1319
1320void LldbAdapter::FixActiveThread()
1321{
1322 // If there are no more than one thread, we are done
1323 size_t threadCount = m_process.GetNumThreads();
1324 if (threadCount < 2)
1325 return;
1326
1327 // If the active thread has a valid stop reason, we are done
1328 auto activeThread = m_process.GetSelectedThread();
1329 if (ThreadHasValidStopReason(activeThread))
1330 return;
1331
1332 // Find the first thread that has a valid reason, and set it as the active thread
1333 for (size_t i = 0; i < threadCount; i++)
1334 {
1335 SBThread thread = m_process.GetThreadAtIndex(i);
1336 if (ThreadHasValidStopReason(thread))
1337 {
1338 if (m_process.SetSelectedThread(thread))
1339 {
1340 LogDebug("Active thread is overriden from 0x%" PRIx64 " to 0x%" PRIX64, activeThread.GetThreadID(),
1341 thread.GetThreadID());
1342 break;
1343 }
1344 }
1345 }
1346}
1347
1348
1349void LldbAdapter::EventListener()

Callers

nothing calls this directly

Calls 1

ThreadHasValidStopReasonFunction · 0.85

Tested by

no test coverage detected