Corrected bad rebase

This commit is contained in:
Nav
2023-01-21 14:27:45 +00:00
parent 80035cadae
commit f37f8f301a
13 changed files with 37 additions and 67 deletions

View File

@@ -3,7 +3,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -148,7 +148,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
memoryBuffer.insert(memoryBuffer.end(), (this->bytes - bytesToRead), 0x00);
}
debugSession.connection.writePacket(ResponsePacket(String::toHex(memoryBuffer)));
debugSession.connection.writePacket(ResponsePacket(Services::StringService::toHex(memoryBuffer)));
} catch (const Exception& exception) {
Logger::error("Failed to read memory from target - " + exception.getMessage());

View File

@@ -8,7 +8,7 @@
#include "src/Application.hpp"
#include "src/Services/PathService.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -29,7 +29,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void BloomVersion::handle(DebugSession& debugSession, TargetControllerService&) {
Logger::debug("Handling BloomVersion packet");
debugSession.connection.writePacket(ResponsePacket(String::toHex(
debugSession.connection.writePacket(ResponsePacket(Services::StringService::toHex(
std::string(
"Bloom v" + Application::VERSION.toString() + "\n"
+ Services::PathService::homeDomainName() + "\n"

View File

@@ -8,7 +8,7 @@
#include "src/Application.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -28,7 +28,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void BloomVersionMachine::handle(DebugSession& debugSession, TargetControllerService&) {
Logger::debug("Handling BloomVersionMachine packet");
debugSession.connection.writePacket(ResponsePacket(String::toHex(
debugSession.connection.writePacket(ResponsePacket(Services::StringService::toHex(
QJsonDocument(QJsonObject({
{"version", QString::fromStdString(Application::VERSION.toString())},
{"components", QJsonObject({

View File

@@ -6,7 +6,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/DebugServer/Gdb/Exceptions/InvalidCommandOption.hpp"
@@ -87,7 +87,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
);
}
const auto hexValues = String::toHex(data);
const auto hexValues = Services::StringService::toHex(data);
Logger::debug("Filling EEPROM with values: " + hexValues);
targetControllerService.writeMemory(
@@ -96,13 +96,15 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
std::move(data)
);
debugSession.connection.writePacket(ResponsePacket(String::toHex(
debugSession.connection.writePacket(ResponsePacket(Services::StringService::toHex(
"Filled " + std::to_string(eepromSize) + " bytes of EEPROM, with values: " + hexValues + "\n"
)));
} catch (const InvalidCommandOption& exception) {
Logger::error(exception.getMessage());
debugSession.connection.writePacket(ResponsePacket(String::toHex(exception.getMessage() + "\n")));
debugSession.connection.writePacket(
ResponsePacket(Services::StringService::toHex(exception.getMessage() + "\n"))
);
} catch (const Exception& exception) {
Logger::error("Failed to fill EEPROM - " + exception.getMessage());

View File

@@ -10,7 +10,7 @@
#include "src/Application.hpp"
#include "src/Services/PathService.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -42,7 +42,9 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
);
if (this->sendOutput) {
debugSession.connection.writePacket(ResponsePacket(String::toHex(svdXml.toString().toStdString())));
debugSession.connection.writePacket(
ResponsePacket(Services::StringService::toHex(svdXml.toString().toStdString()))
);
return;
}
@@ -58,7 +60,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
outputFile.write(svdXml.toByteArray());
outputFile.close();
debugSession.connection.writePacket(ResponsePacket(String::toHex(
debugSession.connection.writePacket(ResponsePacket(Services::StringService::toHex(
"SVD output saved to " + svdOutputFilePath + "\n"
)));

View File

@@ -7,7 +7,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "src/Services/PathService.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -41,13 +41,15 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
if (!helpFile.open(QIODevice::ReadOnly)) {
throw Exception(
"Failed to open GDB monitor info help file - please report this issue at " + Services::PathService::homeDomainName()
+ "/report-issue"
"Failed to open GDB monitor info help file - please report this issue at "
+ Services::PathService::homeDomainName() + "/report-issue"
);
}
debugSession.connection.writePacket(
ResponsePacket(String::toHex("\n" + QTextStream(&helpFile).readAll().toUtf8().toStdString() + "\n"))
ResponsePacket(Services::StringService::toHex(
"\n" + QTextStream(&helpFile).readAll().toUtf8().toStdString() + "\n"
))
);
} catch (const Exception& exception) {

View File

@@ -4,7 +4,7 @@
#include "src/Targets/TargetRegister.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -89,7 +89,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
}
debugSession.connection.writePacket(
ResponsePacket(String::toHex(registers))
ResponsePacket(Services::StringService::toHex(registers))
);
} catch (const Exception& exception) {

View File

@@ -3,7 +3,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -29,7 +29,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
targetControllerService.resetTarget();
Logger::info("Target reset complete");
debugSession.connection.writePacket(ResponsePacket(String::toHex(
debugSession.connection.writePacket(ResponsePacket(Services::StringService::toHex(
"Target reset complete - use the 'continue' command to begin execution.\n"
)));

View File

@@ -7,7 +7,7 @@
#include "src/DebugServer/Gdb/Signal.hpp"
#include "src/DebugServer/Gdb/StopReason.hpp"
#include "src/Helpers/String.hpp"
#include "src/Services/StringService.hpp"
namespace Bloom::DebugServer::Gdb::ResponsePackets
{
@@ -25,7 +25,7 @@ namespace Bloom::DebugServer::Gdb::ResponsePackets
: signal(signal)
, stopReason(stopReason)
{
std::string packetData = "T" + String::toHex(std::vector({static_cast<unsigned char>(this->signal)}));
std::string packetData = "T" + Services::StringService::toHex(static_cast<unsigned char>(this->signal));
if (this->stopReason.has_value()) {
static const auto stopReasonMapping = getStopReasonToNameMapping();