diff options
author | Rob Savoye <rob@cygnus> | 1994-11-15 08:13:05 +0000 |
---|---|---|
committer | Rob Savoye <rob@cygnus> | 1994-11-15 08:13:05 +0000 |
commit | b3b8d9bfa7698d61d2831bfbe9fa41b487e03a45 (patch) | |
tree | 318ee47b20f8aa8546da0f39468807f6016b25d8 | |
parent | f08a8281d396236152395e6b9ebde017d4a024a0 (diff) | |
download | gdb-b3b8d9bfa7698d61d2831bfbe9fa41b487e03a45.zip gdb-b3b8d9bfa7698d61d2831bfbe9fa41b487e03a45.tar.gz gdb-b3b8d9bfa7698d61d2831bfbe9fa41b487e03a45.tar.bz2 |
* 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.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/monitor.c | 49 | ||||
-rw-r--r-- | gdb/monitor.h | 2 | ||||
-rw-r--r-- | gdb/op50-rom.c | 6 | ||||
-rw-r--r-- | gdb/rom68k-rom.c | 10 | ||||
-rw-r--r-- | gdb/w89k-rom.c | 8 |
6 files changed, 62 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 83988ac..c39a47b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Tue Nov 15 01:03:56 1994 Rob Savoye (rob@slipknot.cygnus.com) + + * op50-rom.c, w89k-rom.c, monitor.c: Modify to usr two variables + to set remote load type and protocol. + * rom68k-rom.c: Add to_stop in target_ops. + Mon Nov 14 08:51:29 1994 Stu Grossman (grossman@cygnus.com) * Makefile.in: Install gdbtk.tcl. diff --git a/gdb/monitor.c b/gdb/monitor.c index 0eaf293..f4139b9 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, diff --git a/gdb/monitor.h b/gdb/monitor.h index 6e3758f..f3aff8c 100644 --- a/gdb/monitor.h +++ b/gdb/monitor.h @@ -47,6 +47,7 @@ struct monitor_ops { char *cmd_end; /* optional command terminator */ struct target_ops *target; /* target operations */ char *loadtypes; /* the load types that are supported */ + char *loadprotos; /* the load protocols that are supported */ char **regnames; /* array of register names in ascii */ }; @@ -54,6 +55,7 @@ extern struct monitor_ops *current_monitor; #define PROTO_TYPE (current_monitor->type) #define LOADTYPES (current_monitor->loadtypes) +#define LOADPROTOS (current_monitor->loadprotos) #define INIT_CMD (current_monitor->init) #define GO_CMD (current_monitor->execute) #define CONT_CMD (current_monitor->resume) diff --git a/gdb/op50-rom.c b/gdb/op50-rom.c index fe58e71..9e7a63c 100644 --- a/gdb/op50-rom.c +++ b/gdb/op50-rom.c @@ -65,9 +65,8 @@ struct target_ops op50n_ops = { "Debug on a Oki OP50N eval board.\n\ Specify the serial device it is connected to (e.g. /dev/ttya).", op50n_open, - monitor_close, - 0, + monitor_attach, monitor_detach, monitor_resume, monitor_wait, @@ -137,7 +136,8 @@ struct monitor_ops op50n_cmds = { " ", /* end-of-command delimitor */ ".\n", /* optional command terminator */ &op50n_ops, /* target operations */ - "srec,ascii-srec,default", /* load types */ + "none,srec,default", /* load types */ + "none", /* load types */ op50n_regnames }; diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index 5b87fed..57398fd 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -89,6 +89,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", monitor_mourn_inferior, 0, /* can_run */ 0, /* notice_signals */ + 0, /* to_stop */ process_stratum, 0, /* next */ 1, @@ -98,7 +99,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", 1, /* all mem, mem, stack, regs, exec */ 0, 0, /* Section pointers */ - OPS_MAGIC, /* Always the last thing */ + OPS_MAGIC /* Always the last thing */ }; struct monitor_ops rom68k_cmds = { @@ -135,7 +136,8 @@ struct monitor_ops rom68k_cmds = { "=", /* end-of-command delimitor */ ".\n", /* optional command terminator */ &rom68k_ops, /* target operations */ - "srec,xmodem-ascii,xmodem-srec,default",/* load types */ + "none,srec,default", /* load types */ + "none", /* load protocols */ rom68k_regnames /* registers names */ }; @@ -158,7 +160,3 @@ _initialize_rom68k () /* this is the default, since it's the only baud rate supported by the hardware */ baud_rate = 9600; } - - - - diff --git a/gdb/w89k-rom.c b/gdb/w89k-rom.c index a484f022..2afe37f 100644 --- a/gdb/w89k-rom.c +++ b/gdb/w89k-rom.c @@ -1,7 +1,6 @@ /* Remote target glue for the WinBond ROM monitor running on the "Cougar" W89k eval board. - Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of GDB. @@ -137,7 +136,8 @@ struct monitor_ops w89k_cmds = { "", /* end-of-command delimitor */ "", /* optional command terminator */ &w89k_ops, /* target operations */ - "srec,xmodem-ascii,xmodem-srec,default",/* load types */ + "none,srec,default", /* load types */ + "none,xmodem", /* load protocols */ w89k_regnames /* registers names */ }; @@ -160,7 +160,3 @@ _initialize_w89k () /* this is the default, since it's the only baud rate supported by the hardware */ baud_rate = 9600; } - - - - |