Skip to content

Commit

Permalink
Accept [labels] section from WLA symbol files. Fix #76
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jan 7, 2024
1 parent fe9498a commit 057807a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion platforms/desktop-shared/gui_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,27 @@ void gui_debug_load_symbols_file(const char* path)
if (file.is_open())
{
std::string line;
bool valid_section = true;

while (std::getline(file, line))
{
add_symbol(line.c_str());
size_t comment = line.find_first_of(';');
if (comment != std::string::npos)
line = line.substr(0, comment);
line = line.erase(0, line.find_first_not_of(" \t\r\n"));
line = line.erase(line.find_last_not_of(" \t\r\n") + 1);

if (line.empty())
continue;

if (line.find("[") != std::string::npos)
{
valid_section = (line.find("[labels]") != std::string::npos);
continue;
}

if (valid_section)
add_symbol(line.c_str());
}

file.close();
Expand Down

0 comments on commit 057807a

Please sign in to comment.