aboutsummaryrefslogtreecommitdiff
path: root/gdb/sh3-rom.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-11-14 23:24:10 +0000
committerStu Grossman <grossman@cygnus>1995-11-14 23:24:10 +0000
commit5c8ba01776c033aafffbfa0dc972cb29a22a5113 (patch)
treea81b0a3291ff437ccc14c4e6889b60e31c4b2e10 /gdb/sh3-rom.c
parent1c1a4269dd2fc1e95de5cc070390425c8f8a3ed6 (diff)
downloadgdb-5c8ba01776c033aafffbfa0dc972cb29a22a5113.zip
gdb-5c8ba01776c033aafffbfa0dc972cb29a22a5113.tar.gz
gdb-5c8ba01776c033aafffbfa0dc972cb29a22a5113.tar.bz2
* monitor.c (monitor_load_srec monitor_make_srec): Move all
S-record download code into srec.c. * srec.c srec.h: New files. Contain S-record loading routines formerly in monitor.c. * serial.c serial.h: New routine just like fprintf, but uses serial_t instead of FILE *. * sh-tdep.c (frame_find_saved_regs init_extra_frame_info): Don't add four to saved pc (makes things match manual). Also, fix bug where we didn't get pc from stack frame correctly. * config/sh/tm-sh.h (SAVED_PC_AFTER_CALL): Don't add four to saved pc. Real hardware does this for you. * sh3-rom.c (sh3_load): New routine. Sets up for download then calls generic S-record loader. * config/h8300/h8300.mt, config/h8500/h8500.mt, config/m68k/monitor.mt, config/pa/hppapro.mt, config/sh/sh.mt: Add srec.o to TDEPFILES.
Diffstat (limited to 'gdb/sh3-rom.c')
-rw-r--r--gdb/sh3-rom.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gdb/sh3-rom.c b/gdb/sh3-rom.c
index b52fa5e..0973bfd 100644
--- a/gdb/sh3-rom.c
+++ b/gdb/sh3-rom.c
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "monitor.h"
#include "serial.h"
+#include "srec.h"
static void sh3_open PARAMS ((char *args, int from_tty));
@@ -102,6 +103,24 @@ sh3_supply_register (regname, regnamelen, val, vallen)
val = monitor_supply_register (regno++, val);
}
+static void
+sh3_load (desc, file, hashmark)
+ serial_t desc;
+ 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 */
+
+ 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);
+}
+
/* This array of registers need to match the indexes used by GDB.
This exists because the various ROM monitors use different strings
than does GDB, and don't necessarily support all the registers
@@ -167,8 +186,8 @@ static struct monitor_ops sh3_cmds =
/* register_pattern */
"\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)",
sh3_supply_register, /* supply_register */
- NULL, /* load_routine (defaults to SRECs) */
- "il;s:x\r\006", /* download command */
+ sh3_load, /* load_routine */
+ NULL, /* download command */
NULL, /* Load response */
"\n:", /* monitor command prompt */
"\r", /* end-of-line terminator */