CodeWidget: Clear calls and callers box if there is no symbol, otherwise outdated data will persist.

This commit is contained in:
TryTwo
2025-06-19 11:13:40 -07:00
parent 2fb66e9708
commit 10c3b0b4e4

View File

@ -235,11 +235,10 @@ void CodeWidget::OnPPCSymbolsChanged()
{ {
UpdateSymbols(); UpdateSymbols();
UpdateCallstack(); UpdateCallstack();
if (const Common::Symbol* symbol = m_ppc_symbol_db.GetSymbolFromAddr(m_code_view->GetAddress()))
{ const Common::Symbol* symbol = m_ppc_symbol_db.GetSymbolFromAddr(m_code_view->GetAddress());
UpdateFunctionCalls(symbol); UpdateFunctionCalls(symbol);
UpdateFunctionCallers(symbol); UpdateFunctionCallers(symbol);
}
} }
void CodeWidget::ActivateSearchAddress() void CodeWidget::ActivateSearchAddress()
@ -354,9 +353,6 @@ void CodeWidget::Update()
m_code_view->Update(); m_code_view->Update();
m_code_view->setFocus(); m_code_view->setFocus();
if (!symbol)
return;
UpdateFunctionCalls(symbol); UpdateFunctionCalls(symbol);
UpdateFunctionCallers(symbol); UpdateFunctionCallers(symbol);
} }
@ -427,6 +423,9 @@ void CodeWidget::UpdateSymbols()
void CodeWidget::UpdateFunctionCalls(const Common::Symbol* symbol) void CodeWidget::UpdateFunctionCalls(const Common::Symbol* symbol)
{ {
m_function_calls_list->clear(); m_function_calls_list->clear();
if (symbol == nullptr)
return;
const QString filter = m_search_calls->text(); const QString filter = m_search_calls->text();
for (const auto& call : symbol->calls) for (const auto& call : symbol->calls)
@ -461,6 +460,9 @@ void CodeWidget::UpdateFunctionCalls(const Common::Symbol* symbol)
void CodeWidget::UpdateFunctionCallers(const Common::Symbol* symbol) void CodeWidget::UpdateFunctionCallers(const Common::Symbol* symbol)
{ {
m_function_callers_list->clear(); m_function_callers_list->clear();
if (symbol == nullptr)
return;
const QString filter = m_search_callers->text(); const QString filter = m_search_callers->text();
for (const auto& caller : symbol->callers) for (const auto& caller : symbol->callers)