/* Remote debugging interface for MIPS remote debugging protocol.
- Copyright (C) 1993-2013 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Ian Lance Taylor
<ian@cygnus.com>.
#include "serial.h"
#include "target.h"
#include "exceptions.h"
-#include "gdb_string.h"
-#include "gdb_stat.h"
+#include <string.h>
+#include <sys/stat.h>
#include "gdb_usleep.h"
#include "regcache.h"
#include <ctype.h>
static void mips_close (void);
-static void mips_detach (struct target_ops *ops, char *args, int from_tty);
-
static int mips_map_regno (struct gdbarch *, int);
static void mips_set_register (int regno, ULONGEST value);
mips_error (char *string,...)
{
va_list args;
-
- va_start (args, string);
+ char *fmt;
target_terminal_ours ();
wrap_here (""); /* Force out any buffered output. */
gdb_flush (gdb_stdout);
- if (error_pre_print)
- fputs_filtered (error_pre_print, gdb_stderr);
- vfprintf_filtered (gdb_stderr, string, args);
- fprintf_filtered (gdb_stderr, "\n");
- va_end (args);
gdb_flush (gdb_stderr);
/* Clean up in such a way that mips_close won't try to talk to the
it). */
close_ports ();
- printf_unfiltered ("Ending remote MIPS debugging.\n");
if (!ptid_equal (inferior_ptid, null_ptid))
target_mourn_inferior ();
- deprecated_throw_reason (RETURN_ERROR);
+ fmt = concat (_("Ending remote MIPS debugging: "),
+ string, (char *) NULL);
+ make_cleanup (xfree, fmt);
+
+ va_start (args, string);
+ throw_verror (TARGET_CLOSE_ERROR, fmt, args);
+ va_end (args);
}
/* putc_readable - print a character, displaying non-printable chars in
reinit_frame_cache ();
registers_changed ();
stop_pc = regcache_read_pc (get_current_regcache ());
- print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
+ print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
xfree (serial_port_name);
do_cleanups (cleanup);
/* Detach from the remote board. */
static void
-mips_detach (struct target_ops *ops, char *args, int from_tty)
+mips_detach (struct target_ops *ops, const char *args, int from_tty)
{
if (args)
error (_("Argument given to \"detach\" when remotely debugging."));
- pop_target ();
-
- mips_close ();
+ unpush_target (ops);
if (from_tty)
printf_unfiltered ("Ending remote MIPS debugging.\n");
printf_unfiltered ("Ending remote MIPS debugging.\n");
target_mourn_inferior ();
-
- deprecated_throw_reason (RETURN_QUIT);
+ quit ();
}
target_terminal_inferior ();