File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515#include " util/sockets.h"
1616
17- #include < functional>
1817#include < iomanip>
19- #include < map>
2018#include < optional>
2119#include < sstream>
2220#include < string>
@@ -94,7 +92,7 @@ static const std::array<u32*, 38> REGISTERS{
9492};
9593
9694// / List of all GDB remote protocol packets supported by us.
97- static const std::map< const char *, std::function< std::optional<std::string>( std::string_view)>> COMMANDS {
95+ static constexpr std::pair< std::string_view, std::optional<std::string> (*)( std::string_view)> COMMANDS [] = {
9896 {" ?" , Cmd$_questionMark},
9997 {" g" , Cmd$g},
10098 {" G" , Cmd$G},
@@ -379,7 +377,7 @@ std::string GDBServer::ProcessPacket(std::string_view data)
379377 DEV_LOG (" Processing command '{}'" , command.first );
380378
381379 // Invoke command, remove command name from payload.
382- reply = command.second (packet->substr (strlen ( command.first )));
380+ reply = command.second (packet->substr (command.first . size ( )));
383381 processed = true ;
384382 break ;
385383 }
You can’t perform that action at this time.
0 commit comments