Handle bad conversion in wr GDB monitor command handler

This commit is contained in:
Nav
2024-08-28 19:24:41 +01:00
parent 609400b375
commit 48bd656b6d

View File

@@ -131,6 +131,16 @@ namespace DebugServer::Gdb::CommandPackets
debugSession.connection.writePacket(ResponsePacket{StringService::toHex("Register written\n")}); debugSession.connection.writePacket(ResponsePacket{StringService::toHex("Register written\n")});
} catch (const std::invalid_argument& exception) {
debugSession.connection.writePacket(ResponsePacket{
StringService::toHex(
StringService::applyTerminalColor(
"Error: Invalid register value given\n",
StringService::TerminalColor::DARK_RED
)
)
});
} catch (const Exception& exception) { } catch (const Exception& exception) {
debugSession.connection.writePacket(ResponsePacket{ debugSession.connection.writePacket(ResponsePacket{
StringService::toHex( StringService::toHex(