diff --git a/src/core/gdb_server.cpp b/src/core/gdb_server.cpp index d732f9f3a..f79268d2b 100644 --- a/src/core/gdb_server.cpp +++ b/src/core/gdb_server.cpp @@ -14,9 +14,7 @@ #include "util/sockets.h" -#include #include -#include #include #include #include @@ -94,7 +92,7 @@ static const std::array REGISTERS{ }; /// List of all GDB remote protocol packets supported by us. -static const std::map(std::string_view)>> COMMANDS{ +static constexpr std::pair (*)(std::string_view)> COMMANDS[] = { {"?", Cmd$_questionMark}, {"g", Cmd$g}, {"G", Cmd$G}, @@ -379,7 +377,7 @@ std::string GDBServer::ProcessPacket(std::string_view data) DEV_LOG("Processing command '{}'", command.first); // Invoke command, remove command name from payload. - reply = command.second(packet->substr(strlen(command.first))); + reply = command.second(packet->substr(command.first.size())); processed = true; break; }