static void
mips_files_info PARAMS ((struct target_ops *ignore));
-static void
-mips_load PARAMS ((char *args, int from_tty));
-
static void
mips_create_inferior PARAMS ((char *execfile, char *args, char **env));
all hell to break loose--the rest of GDB will tend to get left in an
inconsistent state. */
-static void NORETURN
+static NORETURN void
mips_error (va_alist)
va_dcl
{
static int state = 0;
static char nextstate[5] = { '<', 'I', 'D', 'T', '>' };
+ if (state == 5)
+ timeout = 1;
ch = SERIAL_READCHAR (mips_desc, timeout);
if (ch == SERIAL_EOF)
mips_error ("End of file from remote");
/* Don't use _filtered; we can't deal with a QUIT out of
target_wait, and I think this might be called from there. */
printf_unfiltered ("Reinitializing MIPS debugging mode\n");
- SERIAL_WRITE (mips_desc, "\rdb tty0\r", sizeof "\rdb tty0\r" - 1);
+ SERIAL_WRITE (mips_desc, "\015db tty0\015", sizeof "\015db tty0\015" - 1);
sleep (1);
mips_need_reply = 0;
we can't deal with a QUIT out of target_wait. */
if (! mips_initializing || sr_get_debug () > 0)
{
- putchar_unfiltered (ch);
+ if (ch < 0x20 && ch != '\n')
+ {
+ putchar_unfiltered ('^');
+ putchar_unfiltered (ch + 0x40);
+ }
+ else
+ putchar_unfiltered (ch);
gdb_flush (gdb_stdout);
}
/* The board seems to want to send us a packet. I don't know what
it means. The packet seems to be triggered by a carriage return
character, although perhaps any character would do. */
- cr = '\r';
+ cr = '\015';
+ /* FIXME check the result from this */
SERIAL_WRITE (mips_desc, &cr, 1);
if (mips_receive_packet (buff, 0, 3) < 0)
cc = '\003';
SERIAL_WRITE (mips_desc, &cc, 1);
sleep (2);
- SERIAL_WRITE (mips_desc, "\rdb tty0\r", sizeof "\rdb tty0\r" - 1);
+ SERIAL_WRITE (mips_desc, "\015db tty0\015", sizeof "\015db tty0\015" - 1);
sleep (1);
- cr = '\r';
+ cr = '\015';
SERIAL_WRITE (mips_desc, &cr, 1);
}
mips_receive_packet (buff, 1, 3);
if (mips_desc == (serial_t) NULL)
perror_with_name (name);
+ if (baud_rate != -1)
+ {
+ if (SERIAL_SETBAUDRATE (mips_desc, baud_rate))
+ {
+ SERIAL_CLOSE (mips_desc);
+ perror_with_name (name);
+ }
+ }
+
SERIAL_RAW (mips_desc);
mips_is_open = 1;
status = mips_store_word (addr,
extract_unsigned_integer (&buffer[i*4], 4),
NULL);
+ /* Report each kilobyte (we download 32-bit words at a time) */
+ if (i % 256 == 255)
+ {
+ printf_unfiltered ("*");
+ fflush (stdout);
+ }
if (status)
{
errno = status;
}
/* FIXME: Do we want a QUIT here? */
}
+ if (count >= 256)
+ printf_unfiltered ("\n");
}
else
{
/* The IDT board uses an unusual breakpoint value, and sometimes gets
confused when it sees the usual MIPS breakpoint instruction. */
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
-static unsigned char break_insn[] = {0, 0, 0x0a, 0x0d};
-#else
-static unsigned char break_insn[] = {0x0d, 0x0a, 0, 0};
-#endif
+#define BREAK_INSN (0x00000a0d)
+#define BREAK_INSN_SIZE (4)
/* Insert a breakpoint on targets that don't have any better breakpoint
support. We read the contents of the target location and stash it,
{
int status;
- return
- mips_store_word (addr,
- extract_unsigned_integer (break_insn, sizeof break_insn),
- contents_cache);
+ return mips_store_word (addr, BREAK_INSN, contents_cache);
}
static int
CORE_ADDR addr;
char *contents_cache;
{
- return target_write_memory (addr, contents_cache, sizeof break_insn);
+ return target_write_memory (addr, contents_cache, BREAK_INSN_SIZE);
}
\f
/* The target vector. */
mips_mourn_inferior, /* to_mourn_inferior */
NULL, /* to_can_run */
NULL, /* to_notice_signals */
+ 0, /* to_stop */
process_stratum, /* to_stratum */
NULL, /* to_next */
1, /* to_has_all_memory */