New GDB "monitor reset" command packet class

This commit is contained in:
Nav
2022-04-08 22:23:30 +01:00
parent 583b01fa34
commit f7feef9ea1
5 changed files with 82 additions and 0 deletions

View File

@@ -101,6 +101,24 @@ namespace Bloom::DebugServer::Gdb
return stream.str();
}
/**
* Converts a string to hexadecimal form, the form in which responses are expected to be delivered from the
* server.
*
* @param data
* @return
*/
static std::string toHex(const std::string& data) {
std::stringstream stream;
stream << std::hex << std::setfill('0');
for (const auto& byte : data) {
stream << std::setw(2) << static_cast<unsigned int>(byte);
}
return stream.str();
}
/**
* Converts data in hexadecimal form to raw data.
*