From 5ac2ac7cb08bd29454b92fc6094c2afeae15ca64 Mon Sep 17 00:00:00 2001 From: Amber Brault Date: Sat, 2 Nov 2024 15:47:58 -0400 Subject: [PATCH] Address rest of feedback --- Source/Core/Core/Boot/Boot.cpp | 2 +- Source/Core/Core/PowerPC/PPCSymbolDB.cpp | 19 +++++-------------- Source/Core/DolphinQt/Debugger/CodeWidget.cpp | 11 +++++++++++ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 5fbef37d428d..208c4d34bd5e 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -605,7 +605,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard, ppc_state.pc = executable.reader->GetEntryPoint(); - std::string filename = PathToFileName(executable.path); + const std::string filename = PathToFileName(executable.path); if (executable.reader->LoadSymbols(guard, system.GetPPCSymbolDB(), filename)) { diff --git a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp index 6cd192ab0e2c..2641a3369779 100644 --- a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp +++ b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp @@ -407,20 +407,11 @@ bool PPCSymbolDB::LoadMap(const Core::CPUThreadGuard& guard, const std::string& std::vector parts = SplitString(name, '\t'); size_t num_parts = parts.size(); - std::string object_filename_string = ""; - std::string name_string = std::string(StripWhitespace(parts[0])); - - if (num_parts > 1) - { - std::vector info_parts = SplitString(parts[1], ' '); - size_t num_info_parts = info_parts.size(); - - // If the last part contains a ., it has to be the object name - if (info_parts[num_info_parts - 1].find('.') != std::string::npos) - { - object_filename_string = info_parts[num_info_parts - 1]; - } - } + const std::string name_string = std::string(StripWhitespace(parts[0])); + const std::string object_filename_string = + num_parts > 1 && !parts[1].starts_with("Linker Generated Symbol File") ? + std::string(StripWhitespace(parts[1])) : + ""; // Check if this is a valid entry. if (strlen(name) > 0) diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp index 0baa6aa8b4fc..2f7aa9854196 100644 --- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp @@ -412,10 +412,17 @@ void CodeWidget::UpdateFunctionCalls(const Common::Symbol* symbol) QString name; if (!call_symbol->object_name.empty()) + { name = QString::fromStdString( fmt::format("< {} ({}, {:08x})", call_symbol->name, call_symbol->object_name, addr)); + } else + { name = QString::fromStdString(fmt::format("< {} ({:08x})", call_symbol->name, addr)); + } + + if (!name.contains(filter, Qt::CaseInsensitive)) + continue; auto* item = new QListWidgetItem(name); item->setData(Qt::UserRole, addr); @@ -439,10 +446,14 @@ void CodeWidget::UpdateFunctionCallers(const Common::Symbol* symbol) QString name; if (!caller_symbol->object_name.empty()) + { name = QString::fromStdString(fmt::format("< {} ({}, {:08x})", caller_symbol->name, caller_symbol->object_name, addr)); + } else + { name = QString::fromStdString(fmt::format("< {} ({:08x})", caller_symbol->name, addr)); + } if (!name.contains(filter, Qt::CaseInsensitive)) continue;