Skip to content

Commit

Permalink
fix: enums are treated as int32_t by the parser
Browse files Browse the repository at this point in the history
  • Loading branch information
klonyyy committed Dec 4, 2024
1 parent 8379a32 commit b803831
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GdbParser/GdbParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,17 @@ Variable::Type GdbParser::checkType(const std::string& name, std::string* output

auto line = out.substr(start + 2, end - start - 2);

logger->debug("CHECKING TYPE FOR LINE: {}", line);

/* remove const and volatile */
if (line.find("volatile ", 0) != std::string::npos)
line.erase(0, 9);
if (line.find("const ", 0) != std::string::npos)
line.erase(0, 6);
if (line.find("static const ", 0) != std::string::npos)
line.erase(0, 13);
if (line.find("enum {", 0) != std::string::npos)
return Variable::Type::I32;

if (!isTrivial.contains(line))
return Variable::Type::UNKNOWN;
Expand Down

0 comments on commit b803831

Please sign in to comment.