Skip to content

Commit

Permalink
Address rest of feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
CelestialAmber committed Nov 2, 2024
1 parent 225481a commit 5ac2ac7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/Boot/Boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
19 changes: 5 additions & 14 deletions Source/Core/Core/PowerPC/PPCSymbolDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,20 +407,11 @@ bool PPCSymbolDB::LoadMap(const Core::CPUThreadGuard& guard, const std::string&
std::vector<std::string> 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<std::string> 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)
Expand Down
11 changes: 11 additions & 0 deletions Source/Core/DolphinQt/Debugger/CodeWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 5ac2ac7

Please sign in to comment.