From 2f5855a7a4909aa108923a3233caf58bb32d83ee Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 11 Mar 2025 20:37:37 +1000 Subject: [PATCH] GDBServer: Get rid of usage --- src/core/gdb_server.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; }