diff --git a/gdb.c b/gdb.c index b53b10e..f17c2e2 100644 --- a/gdb.c +++ b/gdb.c @@ -28,7 +28,6 @@ #include #include #include "device.h" -#include "prog.h" #include "util.h" #include "opdb.h" #include "gdb.h" @@ -322,7 +321,7 @@ static int read_memory(struct gdb_data *data, char *text) if (length > sizeof(buf)) length = sizeof(buf); - printc("Reading %d bytes from 0x%04x\n", length, addr); + printc("Reading %3d bytes from 0x%04x\n", length, addr); if (device_default->readmem(device_default, addr, buf, length) < 0) return gdb_send(data, "E00"); @@ -342,7 +341,6 @@ static int write_memory(struct gdb_data *data, char *text) address_t length, addr; uint8_t buf[MAX_MEM_XFER]; int buflen = 0; - struct prog_data prog; if (!(data_text && length_text)) { printc_err("gdb: malformed memory write request\n"); @@ -366,9 +364,9 @@ static int write_memory(struct gdb_data *data, char *text) return gdb_send(data, "E00"); } - prog_init(&prog, 0); - if (prog_feed(&prog, addr, buf, buflen) < 0 || - prog_flush(&prog) < 0) + printc("Writing %3d bytes to 0x%04x\n", length, addr); + + if (device_default->writemem(device_default, addr, buf, buflen) < 0) return gdb_send(data, "E00"); return gdb_send(data, "OK");