+Fri Jan 12 15:56:12 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * dsrec.c (load_srec): Remove unused variable.
+ monitor.c (monitor_expect): Don't expect a ^C to echo.
+ * serial.c (serial_open): Add parallel interface.
+ * sh3-rom.c (parallel, parallel_in_use): New.
+ (sh3_load): If parallel_in_use, download though the
+ parallel port.
+ (sh3_open): Open parallel port if specified.
+ (sh3_close): New function.
+ (_inititalize_sh3): Add sh3_close hook and documentation.
+ * monitor.c (monitor_close): Export.
+ * monitor.h (monitor_close): Add prototype.
+
Fri Jan 12 13:11:42 1996 Stan Shebs <shebs@andros.cygnus.com>
From Wilfried Moser <wilfried.moser@aut.alcatel.at>:
/* Remote debugging interface ROM monitors.
- * Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
- * Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
- *
- * Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+ * Copyright 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
* Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
*
* This file is part of GDB.
#define REG_DELIM (current_monitor->regset.delim)
extern void monitor_open PARAMS ((char *args, struct monitor_ops *ops, int from_tty));
+extern void monitor_close PARAMS ((int quitting));
extern char *monitor_supply_register PARAMS ((int regno, char *valstr));
extern int monitor_expect PARAMS ((char *prompt, char *buf, int buflen));
extern int monitor_expect_prompt PARAMS ((char *buf, int buflen));
/* Generic serial interface routines
- Copyright 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1996 Free Software Foundation, Inc.
This file is part of GDB.
ops = serial_interface_lookup ("pc");
else if (strchr (name, ':'))
ops = serial_interface_lookup ("tcp");
+ else if (strncmp (name, "lpt", 3) == 0)
+ ops = serial_interface_lookup ("parallel");
else
ops = serial_interface_lookup ("hardwire");
/* Remote target glue for the Hitachi SH-3 ROM monitor.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996 Free Software Foundation, Inc.
This file is part of GDB.
#include "serial.h"
#include "srec.h"
+static serial_t parallel;
+static int parallel_in_use;
+
static void sh3_open PARAMS ((char *args, int from_tty));
static void
char *file;
int hashmark;
{
- monitor_printf ("il;s:x\r");
- monitor_expect ("\005", NULL, 0); /* Look for ENQ */
- SERIAL_WRITE (desc, "\006", 1); /* Send ACK */
- monitor_expect ("LO x\r", NULL, 0); /* Look for filename */
+ if (parallel_in_use)
+ {
+ monitor_printf("pl;s\r");
+ load_srec (parallel, file, 80, SREC_ALL, hashmark);
+ monitor_expect_prompt (NULL, 0);
+ }
+ else
+ {
+ monitor_printf ("il;s:x\r");
+ monitor_expect ("\005", NULL, 0); /* Look for ENQ */
+ SERIAL_WRITE (desc, "\006", 1); /* Send ACK */
+ monitor_expect ("LO x\r", NULL, 0); /* Look for filename */
- load_srec (desc, file, 80, SREC_ALL, hashmark);
+ load_srec (desc, file, 80, SREC_ALL, hashmark);
- monitor_expect ("\005", NULL, 0); /* Look for ENQ */
- SERIAL_WRITE (desc, "\006", 1); /* Send ACK */
- monitor_expect_prompt (NULL, 0);
+ monitor_expect ("\005", NULL, 0); /* Look for ENQ */
+ SERIAL_WRITE (desc, "\006", 1); /* Send ACK */
+ monitor_expect_prompt (NULL, 0);
+ }
}
/* This array of registers need to match the indexes used by GDB.
char *args;
int from_tty;
{
- monitor_open (args, &sh3_cmds, from_tty);
+ char *serial_port_name = args;
+ char *parallel_port_name = 0;
+ if (args)
+ {
+ char *cursor = serial_port_name = strsave (args);
+
+ while (*cursor && *cursor != ' ')
+ cursor++;
+
+ if (*cursor)
+ *cursor++ = 0;
+
+ while (*cursor == ' ')
+ cursor++;
+
+ if (*cursor)
+ parallel_port_name = cursor;
+ }
+
+ monitor_open (serial_port_name, &sh3_cmds, from_tty);
+
+ if (parallel_port_name)
+ {
+ parallel = SERIAL_OPEN (parallel_port_name);
+ if (!parallel)
+ {
+ perror_with_name ("Unable to open parallel port.");
+ }
+ parallel_in_use = 1;
+ }
+}
+
+
+static void
+sh3_close (quitting)
+ int quitting;
+{
+ monitor_close (quitting);
+ if (parallel_in_use) {
+ SERIAL_CLOSE (parallel);
+ parallel_in_use = 0;
+ }
}
void
sh3_ops.to_shortname = "sh3";
sh3_ops.to_longname = "Hitachi SH-3 rom monitor";
- sh3_ops.to_doc = "Debug on a Hitachi eval board running the SH-3 rom monitor.\n\
+
+ sh3_ops.to_doc =
+#ifdef _WINDOWS
+ /* On windows we can talk through the parallel port too. */
+ "Debug on a Hitachi eval board running the SH-3 rom monitor.\n"
+ "Specify the serial device it is connected to (e.g. com2).\n"
+ "If you want to use the parallel port to download to it, specify that\n"
+ "as the second argument. (e.g. lpt1)";
+#else
+ "Debug on a Hitachi eval board running the SH-3 rom monitor.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).";
+#endif
+
sh3_ops.to_open = sh3_open;
+ sh3_ops.to_close = sh3_close;
add_target (&sh3_ops);
}