* 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.
This commit is contained in:
Rob Savoye 1994-11-15 08:13:05 +00:00
parent f08a8281d3
commit b3b8d9bfa7
6 changed files with 62 additions and 19 deletions

View File

@ -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) Mon Nov 14 08:51:29 1994 Stu Grossman (grossman@cygnus.com)
* Makefile.in: Install gdbtk.tcl. * Makefile.in: Install gdbtk.tcl.

View File

@ -77,7 +77,9 @@ static serial_t monitor_desc = NULL;
/* sets the download protocol, choices are srec, generic, boot */ /* sets the download protocol, choices are srec, generic, boot */
char *loadtype; char *loadtype;
static char *loadtype_str; static char *loadtype_str;
static char *loadproto_str;
static void set_loadtype_command(); static void set_loadtype_command();
static void set_loadproto_command();
static void monitor_load_srec(); static void monitor_load_srec();
static int monitor_write_srec(); static int monitor_write_srec();
@ -127,6 +129,38 @@ set_loadtype_command (ignore, from_tty, c)
free (tmp); free (tmp);
error ("Loadtype \"%s\" does not exist.", (*(char **) c->var)); 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. * printf_monitor -- send data to monitor. Works just like printf.
@ -642,7 +676,7 @@ get_reg_name (regno)
static char buf[50]; static char buf[50];
const char *p; const char *p;
char *b; char *b;
b = buf; b = buf;
if (regno < 0) if (regno < 0)
@ -1253,7 +1287,7 @@ getacknak (byte)
i = 0; i = 0;
while (i++ < 60) { while (i++ < 60) {
character = (char)readchar (0); character = (char)readchar (0);
if (character == 0xfffffffe) { /* empty uart */ if ((character == 0xfffffffe) || (character == 0x7f)) { /* empty uart */
if (sr_get_debug() > 3) if (sr_get_debug() > 3)
putchar ('.'); putchar ('.');
fflush (stdout); fflush (stdout);
@ -1474,11 +1508,18 @@ _initialize_remote_monitors ()
struct cmd_list_element *c; struct cmd_list_element *c;
/* this sets the type of download protocol */ /* 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); "Set the type of the remote load protocol.\n", &setlist);
c->function.sfunc = set_loadtype_command; c->function.sfunc = set_loadtype_command;
add_show_from_set (c, &showlist); 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, add_show_from_set (add_set_cmd ("hash", no_class, var_boolean,
(char *)&hashmark, (char *)&hashmark,

View File

@ -47,6 +47,7 @@ struct monitor_ops {
char *cmd_end; /* optional command terminator */ char *cmd_end; /* optional command terminator */
struct target_ops *target; /* target operations */ struct target_ops *target; /* target operations */
char *loadtypes; /* the load types that are supported */ char *loadtypes; /* the load types that are supported */
char *loadprotos; /* the load protocols that are supported */
char **regnames; /* array of register names in ascii */ 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 PROTO_TYPE (current_monitor->type)
#define LOADTYPES (current_monitor->loadtypes) #define LOADTYPES (current_monitor->loadtypes)
#define LOADPROTOS (current_monitor->loadprotos)
#define INIT_CMD (current_monitor->init) #define INIT_CMD (current_monitor->init)
#define GO_CMD (current_monitor->execute) #define GO_CMD (current_monitor->execute)
#define CONT_CMD (current_monitor->resume) #define CONT_CMD (current_monitor->resume)

View File

@ -65,9 +65,8 @@ struct target_ops op50n_ops = {
"Debug on a Oki OP50N eval board.\n\ "Debug on a Oki OP50N eval board.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).", Specify the serial device it is connected to (e.g. /dev/ttya).",
op50n_open, op50n_open,
monitor_close, monitor_close,
0, monitor_attach,
monitor_detach, monitor_detach,
monitor_resume, monitor_resume,
monitor_wait, monitor_wait,
@ -137,7 +136,8 @@ struct monitor_ops op50n_cmds = {
" ", /* end-of-command delimitor */ " ", /* end-of-command delimitor */
".\n", /* optional command terminator */ ".\n", /* optional command terminator */
&op50n_ops, /* target operations */ &op50n_ops, /* target operations */
"srec,ascii-srec,default", /* load types */ "none,srec,default", /* load types */
"none", /* load types */
op50n_regnames op50n_regnames
}; };

View File

@ -89,6 +89,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
monitor_mourn_inferior, monitor_mourn_inferior,
0, /* can_run */ 0, /* can_run */
0, /* notice_signals */ 0, /* notice_signals */
0, /* to_stop */
process_stratum, process_stratum,
0, /* next */ 0, /* next */
1, 1,
@ -98,7 +99,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
1, /* all mem, mem, stack, regs, exec */ 1, /* all mem, mem, stack, regs, exec */
0, 0,
0, /* Section pointers */ 0, /* Section pointers */
OPS_MAGIC, /* Always the last thing */ OPS_MAGIC /* Always the last thing */
}; };
struct monitor_ops rom68k_cmds = { struct monitor_ops rom68k_cmds = {
@ -135,7 +136,8 @@ struct monitor_ops rom68k_cmds = {
"=", /* end-of-command delimitor */ "=", /* end-of-command delimitor */
".\n", /* optional command terminator */ ".\n", /* optional command terminator */
&rom68k_ops, /* target operations */ &rom68k_ops, /* target operations */
"srec,xmodem-ascii,xmodem-srec,default",/* load types */ "none,srec,default", /* load types */
"none", /* load protocols */
rom68k_regnames /* registers names */ 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 */ /* this is the default, since it's the only baud rate supported by the hardware */
baud_rate = 9600; baud_rate = 9600;
} }

View File

@ -1,7 +1,6 @@
/* Remote target glue for the WinBond ROM monitor running on the "Cougar" /* Remote target glue for the WinBond ROM monitor running on the "Cougar"
W89k eval board. W89k eval board.
Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -137,7 +136,8 @@ struct monitor_ops w89k_cmds = {
"", /* end-of-command delimitor */ "", /* end-of-command delimitor */
"", /* optional command terminator */ "", /* optional command terminator */
&w89k_ops, /* target operations */ &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 */ 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 */ /* this is the default, since it's the only baud rate supported by the hardware */
baud_rate = 9600; baud_rate = 9600;
} }