Debugger: Fix symbol search speed

Having Qt query a setting for every symbol isn't efficient.
Fixes regression introduced by #13216.
This commit is contained in:
Martino Fontana
2026-08-19 10:10:49 +02:00
parent a795eaf01d
commit e407f178ba
2 changed files with 5 additions and 3 deletions

View File

@@ -41,7 +41,8 @@ static const QString BOX_SPLITTER_STYLESHEET = QStringLiteral(
CodeWidget::CodeWidget(QWidget* parent)
: QDockWidget(parent), m_system(Core::System::GetInstance()),
m_ppc_symbol_db(m_system.GetPPCSymbolDB())
m_ppc_symbol_db(m_system.GetPPCSymbolDB()),
m_show_demangled_names(Settings::Instance().IsShowDemangledNames())
{
setWindowTitle(tr("Code"));
setObjectName(QStringLiteral("code"));
@@ -253,6 +254,7 @@ void CodeWidget::OnSetCodeAddress(u32 address)
void CodeWidget::OnShowDemangledNamesChanged()
{
m_show_demangled_names = Settings::Instance().IsShowDemangledNames();
UpdateSymbols();
if (const Common::Symbol* symbol = m_ppc_symbol_db.GetSymbolFromAddr(m_code_view->GetAddress()))
{
@@ -565,8 +567,7 @@ void CodeWidget::UpdateFunctionCallers(const Common::Symbol* symbol)
// demangled names.
const std::string& CodeWidget::GetSymbolDisplayName(const Common::Symbol* symbol) const
{
const bool show_demangled_names = Settings::Instance().IsShowDemangledNames();
return symbol->GetDisplayName(show_demangled_names);
return symbol->GetDisplayName(m_show_demangled_names);
}
void CodeWidget::Step()

View File

@@ -81,6 +81,7 @@ private:
Core::System& m_system;
PPCSymbolDB& m_ppc_symbol_db;
bool m_show_demangled_names;
BranchWatchDialog* m_branch_watch_dialog = nullptr;
QLineEdit* m_search_address;