Fix GDB bug (ooops)

master
vhaudiquet 1 year ago
parent c286beb1e1
commit 43d22052e5
  1. 4
      src/gdbstub/gdbstub.c

@ -261,7 +261,7 @@ void gdbstub_thread_gdb()
char data[length * 2 + 1]; char data[length * 2 + 1];
for(size_t i = 0; i < length; i++) for(size_t i = 0; i < length; i++)
{ {
uint32_t value = mem_read32(address + i); uint32_t value = mem_read8(address + i);
snprintf(data + i * 2, 3, "%02x", value); snprintf(data + i * 2, 3, "%02x", value);
} }
@ -283,7 +283,7 @@ void gdbstub_thread_gdb()
{ {
uint32_t value; uint32_t value;
sscanf(packet + data_start + i * 2, "%02x", &value); sscanf(packet + data_start + i * 2, "%02x", &value);
mem_write32(address + i, value); mem_write8(address + i, value);
} }
gdbstub_send_packet("OK", 2); gdbstub_send_packet("OK", 2);

Loading…
Cancel
Save