Skip to content

Commit

Permalink
Remove parenthesis check
Browse files Browse the repository at this point in the history
  • Loading branch information
CelestialAmber committed Nov 2, 2024
1 parent 316e65f commit 71421e8
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions Source/Core/Core/PowerPC/PPCSymbolDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,39 +405,10 @@ bool PPCSymbolDB::LoadMap(const Core::CPUThreadGuard& guard, const std::string&
// Split the current name string into separate parts, and get the object name
// if it exists.
std::vector<std::string> parts = SplitString(name, '\t');
std::string processed_name = std::string(StripWhitespace(parts[0]));
size_t num_parts = parts.size();

std::string object_filename_string = "";
std::string name_string = name; // Default to the full line

// If the first part does not contain a left parenthesis (not a demangled symbol), use the first
// part
size_t parenthesis_offset = processed_name.find('(');
if (parenthesis_offset == std::string::npos)
{
name_string = processed_name;
}
else
{
// If it does, the symbol is likely demangled, so look for the end of the name
size_t name_end_offset = processed_name.rfind(')');

// If the name has no right parenthesis, the name is invalid
if (name_end_offset == std::string::npos)
continue;

// Skip the parenthesis
name_end_offset++;

// If the name ends with const, advance past it
if (processed_name.find(") const") != std::string::npos)
{
name_end_offset += 6;
}

name_string = processed_name.substr(0, name_end_offset);
}
std::string name_string = std::string(StripWhitespace(parts[0]));

if (num_parts > 1)
{
Expand Down

0 comments on commit 71421e8

Please sign in to comment.