summaryrefslogtreecommitdiff
path: root/gdb/monitor.c
diff options
context:
space:
mode:
authorRob Savoye <rob@cygnus>1994-11-15 08:13:05 +0000
committerRob Savoye <rob@cygnus>1994-11-15 08:13:05 +0000
commitb3b8d9bfa7698d61d2831bfbe9fa41b487e03a45 (patch)
tree318ee47b20f8aa8546da0f39468807f6016b25d8 /gdb/monitor.c
parentf08a8281d396236152395e6b9ebde017d4a024a0 (diff)
downloadbinutils-gdb-b3b8d9bfa7698d61d2831bfbe9fa41b487e03a45.tar.gz
* op50-rom.c, w89k-rom.c, monitor.c: Modify to use two variables
to set remote load type and protocol. * rom68k-rom.c: Add to_stop in target_ops.
Diffstat (limited to 'gdb/monitor.c')
-rw-r--r--gdb/monitor.c49
1 files changed, 45 insertions, 4 deletions
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 0eaf2938b3f..f4139b90171 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -77,7 +77,9 @@ static serial_t monitor_desc = NULL;
/* sets the download protocol, choices are srec, generic, boot */
char *loadtype;
static char *loadtype_str;
+static char *loadproto_str;
static void set_loadtype_command();
+static void set_loadproto_command();
static void monitor_load_srec();
static int monitor_write_srec();
@@ -127,6 +129,38 @@ set_loadtype_command (ignore, from_tty, c)
free (tmp);
error ("Loadtype \"%s\" does not exist.", (*(char **) c->var));
}
+/*
+ * set_loadproto_command -- set the protocol for downloading. Check to make
+ * sure you have a supported protocol for this target.
+ */
+static void
+set_loadproto_command (ignore, from_tty, c)
+ char *ignore;
+ int from_tty;
+ struct cmd_list_element *c;
+{
+ char *tmp;
+ char *type;
+ if (STREQ (LOADPROTOS, "")) {
+ error ("No load protocols set");
+ return;
+ }
+
+ tmp = savestring (LOADPROTOS, strlen(LOADPROTOS));
+ type = strtok(tmp, ",");
+ if (STREQ (type, (*(char **) c->var))) {
+ loadproto_str = savestring (*(char **) c->var, strlen (*(char **) c->var));
+ return;
+ }
+
+ while ((type = strtok (NULL, ",")) != (char *)NULL) {
+ if (STREQ (type, (*(char **) c->var)))
+ loadproto_str = savestring (*(char **) c->var, strlen (*(char **) c->var));
+ return;
+ }
+ free (tmp);
+ error ("Load protocol \"%s\" does not exist.", (*(char **) c->var));
+}
/*
* printf_monitor -- send data to monitor. Works just like printf.
@@ -642,7 +676,7 @@ get_reg_name (regno)
static char buf[50];
const char *p;
char *b;
-
+
b = buf;
if (regno < 0)
@@ -1253,7 +1287,7 @@ getacknak (byte)
i = 0;
while (i++ < 60) {
character = (char)readchar (0);
- if (character == 0xfffffffe) { /* empty uart */
+ if ((character == 0xfffffffe) || (character == 0x7f)) { /* empty uart */
if (sr_get_debug() > 3)
putchar ('.');
fflush (stdout);
@@ -1474,11 +1508,18 @@ _initialize_remote_monitors ()
struct cmd_list_element *c;
/* this sets the type of download protocol */
- c = add_set_cmd ("loadtype", no_class, var_string, (char *)&loadtype_str,
+ c = add_set_cmd ("remoteloadprotocol", no_class, var_string, (char *)&loadproto_str,
+ "Set the type of the remote load protocol.\n", &setlist);
+ c->function.sfunc = set_loadproto_command;
+ add_show_from_set (c, &showlist);
+ loadproto_str = savestring ("none", 5);
+
+ /* this sets the conversion type when loading */
+ c = add_set_cmd ("remoteloadtype", no_class, var_string, (char *)&loadtype_str,
"Set the type of the remote load protocol.\n", &setlist);
c->function.sfunc = set_loadtype_command;
add_show_from_set (c, &showlist);
- loadtype_str = savestring ("default", 8);
+ loadtype_str = savestring ("srec", 5);
add_show_from_set (add_set_cmd ("hash", no_class, var_boolean,
(char *)&hashmark,