Present register width as opposed to register byte size in new register access GDB monitor commands
This commit is contained in:
@@ -122,7 +122,7 @@ namespace DebugServer::Gdb::CommandPackets
|
||||
"0x" + StringService::asciiToUpper(StringService::toHex(registerDescriptor.startAddress)),
|
||||
StringService::TerminalColor::BLUE
|
||||
) + ", ";
|
||||
output += std::to_string(registerDescriptor.size) + " byte(s)";
|
||||
output += std::to_string(registerDescriptor.size * 8) + "-bit";
|
||||
|
||||
if (registerDescriptor.description.has_value()) {
|
||||
output += ", \"" + *(registerDescriptor.description) + "\"";
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace DebugServer::Gdb::CommandPackets
|
||||
"0x" + StringService::asciiToUpper(StringService::toHex(registerDescriptor.startAddress)),
|
||||
StringService::TerminalColor::BLUE
|
||||
) + "\n";
|
||||
output += "Size: " + std::to_string(registerDescriptor.size) + " byte(s)\n\n";
|
||||
output += "Width: " + std::to_string(registerDescriptor.size * 8) + "-bit\n\n";
|
||||
|
||||
output += "----------- Value -----------\n";
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace DebugServer::Gdb::CommandPackets
|
||||
"0x" + StringService::asciiToUpper(StringService::toHex(registerDescriptor.startAddress)),
|
||||
StringService::TerminalColor::BLUE
|
||||
) + ", ";
|
||||
output += std::to_string(registerDescriptor.size) + " byte(s) | ";
|
||||
output += std::to_string(registerDescriptor.size * 8) + "-bit | ";
|
||||
|
||||
if (registerDescriptor.access.readable) {
|
||||
const auto value = IntegerService::toUint64(
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace DebugServer::Gdb::CommandPackets
|
||||
if (value > static_cast<std::uint64_t>(std::pow(2, (registerDescriptor.size * 8)))) {
|
||||
throw Exception{
|
||||
"The given value (0x" + StringService::toHex(value) + ") exceeds the size of the register ("
|
||||
+ std::to_string(registerDescriptor.size) + " byte(s))"
|
||||
+ std::to_string(registerDescriptor.size * 8) + "-bit)"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace DebugServer::Gdb::CommandPackets
|
||||
"Writing value " + StringService::applyTerminalColor(
|
||||
"0x" + StringService::toHex(value).substr(16 - (registerDescriptor.size * 2)),
|
||||
StringService::TerminalColor::DARK_YELLOW
|
||||
) + " (" + std::to_string(buffer.size()) + " byte(s)" + ") to " + registerDescriptor.name
|
||||
) + " (" + std::to_string(buffer.size() * 8) + "-bit" + ") to " + registerDescriptor.name
|
||||
+ " register, at address " + StringService::applyTerminalColor(
|
||||
"0x" + StringService::toHex(registerDescriptor.startAddress),
|
||||
StringService::TerminalColor::BLUE
|
||||
|
||||
Reference in New Issue
Block a user