/* 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 "defs.h"
#include "inferior.h"
+#include "infrun.h"
#include "bfd.h"
#include "symfile.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "serial.h"
#include "target.h"
-#include "exceptions.h"
-#include <string.h>
#include <sys/stat.h>
#include "gdb_usleep.h"
#include "regcache.h"
static void mips_initialize (void);
-static void mips_open (char *name, int from_tty);
-
-static void pmon_open (char *name, int from_tty);
-
-static void ddb_open (char *name, int from_tty);
-
-static void lsi_open (char *name, int from_tty);
-
static void mips_close (struct target_ops *self);
static int mips_map_regno (struct gdbarch *, int);
static void pmon_download (char *buffer, int length);
-static void pmon_load_fast (char *file);
-
-static void mips_load (struct target_ops *self, char *file, int from_tty);
+static void mips_load (struct target_ops *self, const char *file, int from_tty);
static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr,
unsigned char *myaddr, int len);
/* 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;
/* Open a connection to the remote board. */
static void
-common_open (struct target_ops *ops, char *name, int from_tty,
+common_open (struct target_ops *ops, const char *name, int from_tty,
enum mips_monitor_type new_monitor,
const char *new_monitor_prompt)
{
/* Open a connection to an IDT board. */
static void
-mips_open (char *name, int from_tty)
+mips_open (const char *name, int from_tty)
{
const char *monitor_prompt = NULL;
if (gdbarch_bfd_arch_info (target_gdbarch ()) != NULL
/* Open a connection to a PMON board. */
static void
-pmon_open (char *name, int from_tty)
+pmon_open (const char *name, int from_tty)
{
common_open (&pmon_ops, name, from_tty, MON_PMON, "PMON> ");
}
/* Open a connection to a DDB board. */
static void
-ddb_open (char *name, int from_tty)
+ddb_open (const char *name, int from_tty)
{
common_open (&ddb_ops, name, from_tty, MON_DDB, "NEC010>");
}
/* Open a connection to a rockhopper board. */
static void
-rockhopper_open (char *name, int from_tty)
+rockhopper_open (const char *name, int from_tty)
{
common_open (&rockhopper_ops, name, from_tty, MON_ROCKHOPPER, "NEC01>");
}
/* Open a connection to an LSI board. */
static void
-lsi_open (char *name, int from_tty)
+lsi_open (const char *name, int from_tty)
{
int i;
/* 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);
}
/* Download a binary file by converting it to S records. */
static void
-mips_load_srec (char *args)
+mips_load_srec (const char *args)
{
bfd *abfd;
asection *s;
using the FastLoad format. */
static void
-pmon_load_fast (char *file)
+pmon_load_fast (const char *file)
{
bfd *abfd;
asection *s;
/* mips_load -- download a file. */
static void
-mips_load (struct target_ops *self, char *file, int from_tty)
+mips_load (struct target_ops *self, const char *file, int from_tty)
{
struct regcache *regcache;