diff --git a/src/debug.cpp b/src/debug.cpp index dbfadf0..3f04e3c 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -203,15 +203,18 @@ bool GDBStub::parse_memory_request(const std::string &packet, size_t &addr, std::string GDBStub::read_registers() { std::ostringstream out; for (int i = 0; i < 32; ++i) { - out << std::string(8, '0'); // TODO: stub + out << std::hex << std::setfill('0') << std::setw(8) << vm.read_register(i); } return out.str(); } std::string GDBStub::read_memory(size_t addr, size_t length) { std::ostringstream out; + std::vector mem = vm.read_memory(addr, length); for (size_t i = 0; i < length; ++i) { - out << "00"; // TODO: stub + out << std::hex << std::setfill('0') << std::setw(2) + << (unsigned int)mem[i]; + out.flush(); } return out.str(); }