Debugger: Backtrace current context if no thread

Backtrace the current context if no running thread is found in the threadlist.
This commit is contained in:
Ziemas authored and Ty committed 2026-10-30 13:55:56 -04:00
1 parent 1f67c53b67
commit 2d252d4d01
3 files changed
+35 -18

No files matched your search

+9 -2
View File
@@ -107,14 +107,21 @@ void StackModel::refreshData()
// Hopefully in the near future we can get a stack frame for
// each thread
beginResetModel();
for (const auto& thread : m_cpu.GetThreadList())
std::unique_ptr<BiosThread> found_thread = nullptr;
for (auto& thread : m_cpu.GetThreadList())
{
if (thread->Status() == ThreadStatus::THS_RUN)
{
m_stackFrames = m_cpu.StackTrace(*thread);
found_thread = std::move(thread);
break;
}
}
// Will do best effort with current context if found_thread is nullptr.
m_stackFrames = m_cpu.StackTrace(found_thread.get());
endResetModel();
}