/* Remote debugging interface for MIPS remote debugging protocol.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2004, 2006-2012 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Ian Lance Taylor
<ian@cygnus.com>.
enum mips_monitor_type new_monitor,
const char *new_monitor_prompt)
{
- char *ptype;
char *serial_port_name;
char *remote_name = 0;
char *local_name = 0;
static void
mips_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, enum gdb_signal siggnal)
{
int err;
/* Return the signal corresponding to SIG, where SIG is the number which
the MIPS protocol uses for the signal. */
-static enum target_signal
+static enum gdb_signal
mips_signal_from_protocol (int sig)
{
/* We allow a few more signals than the IDT board actually returns, on
for these signals is widely agreed upon. */
if (sig <= 0
|| sig > 31)
- return TARGET_SIGNAL_UNKNOWN;
+ return GDB_SIGNAL_UNKNOWN;
- /* Don't want to use target_signal_from_host because we are converting
+ /* Don't want to use gdb_signal_from_host because we are converting
from MIPS signal numbers, not host ones. Our internal numbers
match the MIPS numbers for the signals the board can return, which
are: SIGINT, SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP. */
- return (enum target_signal) sig;
+ return (enum gdb_signal) sig;
}
/* Set the register designated by REGNO to the value designated by VALUE. */
ULONGEST rpc, rfp, rsp;
char pc_string[17], fp_string[17], sp_string[17], flags[20];
int nfields;
- int i;
interrupt_count = 0;
hit_watchpoint = 0;
if (!mips_need_reply)
{
status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = TARGET_SIGNAL_TRAP;
+ status->value.sig = GDB_SIGNAL_TRAP;
return inferior_ptid;
}
is not a normal breakpoint. */
if (strcmp (target_shortname, "lsi") == 0)
{
- char *func_name;
+ const char *func_name;
CORE_ADDR func_start;
CORE_ADDR pc = regcache_read_pc (get_current_regcache ());
is the number of hardware breakpoints already installed. This
implements the target_can_use_hardware_watchpoint macro. */
-int
+static int
mips_can_use_watchpoint (int type, int cnt, int othertype)
{
return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
for a write watchpoint, 1 for a read watchpoint, or 2 for a read/write
watchpoint. */
-int
+static int
mips_insert_watchpoint (CORE_ADDR addr, int len, int type,
struct expression *cond)
{
/* Remove a watchpoint. */
-int
+static int
mips_remove_watchpoint (CORE_ADDR addr, int len, int type,
struct expression *cond)
{
/* Test to see if a watchpoint has been hit. Return 1 if so; return 0,
if not. */
-int
+static int
mips_stopped_by_watchpoint (void)
{
return hit_watchpoint;
pmon_download (char *buffer, int length)
{
if (tftp_in_use)
- fwrite (buffer, 1, length, tftp_file);
+ {
+ size_t written;
+
+ written = fwrite (buffer, 1, length, tftp_file);
+ if (written < length)
+ perror_with_name (tftp_localname);
+ }
else
serial_write (udp_in_use ? udp_desc : mips_desc, buffer, length);
}