gdb: remove prog buffering.

This commit is contained in:
Daniel Beer 2010-09-13 10:43:21 +12:00
parent 93087e534d
commit 4a9b89a1ee
1 changed files with 4 additions and 6 deletions

10
gdb.c
View File

@ -28,7 +28,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#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");