Removed init() member function from AVR GDB command packet classes
This commit is contained in:
@@ -13,7 +13,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
|||||||
|
|
||||||
using Exceptions::Exception;
|
using Exceptions::Exception;
|
||||||
|
|
||||||
void ReadMemory::init() {
|
ReadMemory::ReadMemory(const std::vector<unsigned char>& rawPacket)
|
||||||
|
: AbstractMemoryAccessPacket(rawPacket)
|
||||||
|
{
|
||||||
if (this->data.size() < 4) {
|
if (this->data.size() < 4) {
|
||||||
throw Exception("Invalid packet length");
|
throw Exception("Invalid packet length");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* The startAddress sent from the GDB client may include additional bits used to indicate the memory type.
|
* The startAddress sent from the GDB client will include additional bits used to indicate the memory type.
|
||||||
* These bits have to be removed from the address before it can be used as a start address. This is not done
|
* These bits have to be removed from the address before it can be used as a start address.
|
||||||
* here, as it's target specific.
|
|
||||||
*
|
|
||||||
* For an example of where GDB does this, see the AvrGdbRsp class.
|
|
||||||
*/
|
*/
|
||||||
std::uint32_t startAddress = 0;
|
std::uint32_t startAddress = 0;
|
||||||
|
|
||||||
@@ -28,13 +25,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
|||||||
*/
|
*/
|
||||||
std::uint32_t bytes = 0;
|
std::uint32_t bytes = 0;
|
||||||
|
|
||||||
explicit ReadMemory(const std::vector<unsigned char>& rawPacket): AbstractMemoryAccessPacket(rawPacket) {
|
explicit ReadMemory(const std::vector<unsigned char>& rawPacket);
|
||||||
init();
|
|
||||||
};
|
|
||||||
|
|
||||||
void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override;
|
void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override;
|
||||||
|
|
||||||
protected:
|
|
||||||
void init();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
|||||||
|
|
||||||
using namespace Bloom::Exceptions;
|
using namespace Bloom::Exceptions;
|
||||||
|
|
||||||
void WriteMemory::init() {
|
WriteMemory::WriteMemory(const std::vector<unsigned char>& rawPacket)
|
||||||
|
: AbstractMemoryAccessPacket(rawPacket)
|
||||||
|
{
|
||||||
if (this->data.size() < 4) {
|
if (this->data.size() < 4) {
|
||||||
throw Exception("Invalid packet length");
|
throw Exception("Invalid packet length");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
|||||||
|
|
||||||
Targets::TargetMemoryBuffer buffer;
|
Targets::TargetMemoryBuffer buffer;
|
||||||
|
|
||||||
explicit WriteMemory(const std::vector<unsigned char>& rawPacket): AbstractMemoryAccessPacket(rawPacket) {
|
explicit WriteMemory(const std::vector<unsigned char>& rawPacket);
|
||||||
init();
|
|
||||||
};
|
|
||||||
|
|
||||||
void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override;
|
void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override;
|
||||||
|
|
||||||
private:
|
|
||||||
void init();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user