This commit is contained in:
Nav
2022-08-30 02:05:43 +01:00
parent 2ae3786130
commit 590c6ecb33
3 changed files with 9 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
);
this->command = std::string(decodedCommand.begin(), decodedCommand.end());
this->command.erase(this->command.find_last_not_of(" ") + 1);
}
}

View File

@@ -264,7 +264,7 @@ namespace Bloom::DebugServer::Gdb
if (rawPacketString.size() >= 2) {
/*
* First byte of the raw packet will be 0x24 ('$'), so find() should return 1, not 0, when
* First byte of the raw packet will be 0x24 ('$'), so std::string::find() should return 1, not 0, when
* looking for a command identifier string.
*/
if (rawPacketString.find("qSupported") == 1) {
@@ -300,23 +300,24 @@ namespace Bloom::DebugServer::Gdb
auto monitorCommand = std::make_unique<CommandPackets::Monitor>(rawPacket);
if (monitorCommand->command == "help") {
return std::make_unique<CommandPackets::HelpMonitorInfo>(std::move(*(monitorCommand.get())));
return std::make_unique<CommandPackets::HelpMonitorInfo>(std::move(*(monitorCommand.release())));
}
if (monitorCommand->command == "version") {
return std::make_unique<CommandPackets::BloomVersion>(std::move(*(monitorCommand.get())));
return std::make_unique<CommandPackets::BloomVersion>(std::move(*(monitorCommand.release())));
}
if (monitorCommand->command == "version machine") {
return std::make_unique<CommandPackets::BloomVersionMachine>(std::move(*(monitorCommand.get())));
return std::make_unique<CommandPackets::BloomVersionMachine>(std::move(*(monitorCommand.release())));
}
if (monitorCommand->command == "reset") {
return std::make_unique<CommandPackets::ResetTarget>(std::move(*(monitorCommand.get())));
return std::make_unique<CommandPackets::ResetTarget>(std::move(*(monitorCommand.release())));
}
if (monitorCommand->command == "target-info machine") {
return std::make_unique<CommandPackets::TargetInfoMachine>(std::move(*(monitorCommand.get())));
return std::make_unique<CommandPackets::TargetInfoMachine>(std::move(*(monitorCommand.release())));
}
}
return monitorCommand;