static void monitor_interrupt_query (void);
static void monitor_interrupt_twice (int);
-static void monitor_stop (ptid_t);
+static void monitor_stop (struct target_ops *self, ptid_t);
static void monitor_dump_regs (struct regcache *regcache);
#if 0
if (current_monitor->stop)
{
- monitor_stop (inferior_ptid);
+ monitor_stop (targ_ops, inferior_ptid);
if ((current_monitor->flags & MO_NO_ECHO_ON_OPEN) == 0)
{
monitor_debug ("EXP Open echo\n");
control. */
void
-monitor_close (void)
+monitor_close (struct target_ops *self)
{
if (monitor_desc)
serial_close (monitor_desc);
/* Helper for monitor_xfer_partial that handles memory transfers.
Arguments are like target_xfer_partial. */
-static LONGEST
+static enum target_xfer_status
monitor_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
- ULONGEST memaddr, ULONGEST len)
+ ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
{
int res;
res = monitor_read_memory (memaddr, readbuf, len);
}
- if (res == 0)
+ if (res <= 0)
return TARGET_XFER_E_IO;
- return res;
+ else
+ {
+ *xfered_len = (ULONGEST) res;
+ return TARGET_XFER_OK;
+ }
}
/* Target to_xfer_partial implementation. */
-static LONGEST
+static enum target_xfer_status
monitor_xfer_partial (struct target_ops *ops, enum target_object object,
const char *annex, gdb_byte *readbuf,
- const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
+ const gdb_byte *writebuf, ULONGEST offset, ULONGEST len,
+ ULONGEST *xfered_len)
{
switch (object)
{
case TARGET_OBJECT_MEMORY:
- return monitor_xfer_memory (readbuf, writebuf, offset, len);
+ return monitor_xfer_memory (readbuf, writebuf, offset, len, xfered_len);
default:
return TARGET_XFER_E_IO;
/* monitor_load -- download a file. */
static void
-monitor_load (char *args, int from_tty)
+monitor_load (struct target_ops *self, char *args, int from_tty)
{
CORE_ADDR load_offset = 0;
char **argv;
}
static void
-monitor_stop (ptid_t ptid)
+monitor_stop (struct target_ops *self, ptid_t ptid)
{
monitor_debug ("MON stop\n");
if ((current_monitor->flags & MO_SEND_BREAK_ON_STOP) != 0)
ourseleves here cause of a nasty echo. */
static void
-monitor_rcmd (char *command,
+monitor_rcmd (struct target_ops *self, char *command,
struct ui_file *outbuf)
{
char *p;