/* Remote debugging interface for MIPS remote debugging protocol.
- Copyright (C) 1993-2014 Free Software Foundation, Inc.
+ Copyright (C) 1993-2015 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Ian Lance Taylor
<ian@cygnus.com>.
#include "gdbcore.h"
#include "serial.h"
#include "target.h"
-#include "exceptions.h"
#include <sys/stat.h>
#include "gdb_usleep.h"
#include "regcache.h"
/* unsigned */ int len;
unsigned char *packet;
int cksum;
- int try;
+ int attempt;
len = strlen (s);
if (len > DATA_MAXLEN)
/* We can only have one outstanding data packet, so we just wait for
the acknowledgement here. Keep retransmitting the packet until
we get one, or until we've tried too many times. */
- for (try = 0; try < mips_send_retries; try++)
+ for (attempt = 0; attempt < mips_send_retries; attempt++)
{
int garbage;
int ch;
/* Round ending address up; get number of longwords that makes. */
count = (((memaddr + len) - addr) + 3) / 4;
/* Allocate buffer of that many longwords. */
- buffer = alloca (count * 4);
+ buffer = (gdb_byte *) alloca (count * 4);
if (writebuf != NULL)
{
/* Copy appropriate bytes out of the buffer. */
memcpy (readbuf, buffer + (memaddr & 3), len);
}
- return len;
+ *xfered_len = len;
+ return TARGET_XFER_OK;
}
/* Target to_xfer_partial implementation. */
struct bp_target_info *bp_tgt)
{
if (monitor_supports_breakpoints)
- return mips_set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
- BREAK_FETCH);
+ {
+ bp_tgt->placed_address = bp_tgt->reqstd_address;
+ return mips_set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
+ BREAK_FETCH);
+ }
else
return memory_insert_breakpoint (ops, gdbarch, bp_tgt);
}
static int
mips_can_use_watchpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type, int cnt, int othertype)
{
return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
}
static int
mips_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
- if (mips_set_breakpoint (addr, len, type))
+ /* These enum types are compatible by design. */
+ enum break_type btype = (enum break_type) type;
+
+ if (mips_set_breakpoint (addr, len, btype))
return -1;
return 0;
static int
mips_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
- if (mips_clear_breakpoint (addr, len, type))
+ /* These enum types are compatible by design. */
+ enum break_type btype = (enum break_type) type;
+
+ if (mips_clear_breakpoint (addr, len, btype))
return -1;
return 0;
struct cleanup *cleanup;
static int hashmark = 1;
- buffer = alloca (srec_frame * 2 + 256);
+ buffer = (bfd_byte *) alloca (srec_frame * 2 + 256);
abfd = gdb_bfd_open (args, NULL, -1);
if (!abfd)
mips_send_command ("initEther\r", -1);
/* Send the load command. */
- cmd = xmalloc (strlen (load_cmd_prefix) + strlen (tftp_name) + 2);
+ cmd = (char *) xmalloc (strlen (load_cmd_prefix)
+ + strlen (tftp_name) + 2);
strcpy (cmd, load_cmd_prefix);
strcat (cmd, tftp_name);
strcat (cmd, "\r");