Skip to content

Commit

Permalink
Tidying GDB packet class
Browse files Browse the repository at this point in the history
  • Loading branch information
navnavnav committed Jan 21, 2023
1 parent 6b4d3ec commit b5dfa4a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/DebugServer/Gdb/Packet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,15 @@ namespace Bloom::DebugServer::Gdb
Packet& operator = (const Packet& other) = default;
Packet& operator = (Packet&& other) = default;

[[nodiscard]] virtual std::vector<unsigned char> getData() const {
return this->data;
}

void setData(const std::vector<unsigned char>& data) {
this->data = data;
}

/**
* Generates a raw packet.
*
* @return
*/
[[nodiscard]] RawPacket toRawPacket() const {
std::vector<unsigned char> packet = {'$'};
auto data = this->getData();

for (const auto& byte : data) {
for (const auto& byte : this->data) {
// Escape $ and # characters
switch (byte) {
case '$':
Expand Down

0 comments on commit b5dfa4a

Please sign in to comment.