* monitor.h (init_monitor_ops): Declare.

* rom68k-rom.c: Clarify some comments.
	(rom68k_open): Define as static, to match decl.
This commit is contained in:
Stan Shebs 1995-04-13 01:23:53 +00:00
parent 56b73ad2e3
commit d108166fde
3 changed files with 58 additions and 49 deletions

View File

@ -1,3 +1,9 @@
Wed Apr 12 16:40:20 1995 Stan Shebs <shebs@andros.cygnus.com>
* monitor.h (init_monitor_ops): Declare.
* rom68k-rom.c: Clarify some comments.
(rom68k_open): Define as static, to match decl.
Wed Apr 12 16:36:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
* gdb.gdb: New file.

View File

@ -167,5 +167,8 @@ extern struct monitor_ops *current_monitor;
#define MEM_DIS_CMD (current_monitor->getmem)
#define REG_DELIM (current_monitor->regset.delim)
extern void monitor_open PARAMS ((char *args, struct monitor_ops *ops, int from_tty));
extern char *monitor_supply_register PARAMS ((int regno, char *valstr));
extern void init_monitor_ops PARAMS ((struct target_ops *));
extern void monitor_open PARAMS ((char *, struct monitor_ops *, int));
extern char *monitor_supply_register PARAMS ((int, char *));

View File

@ -1,7 +1,5 @@
/* Remote target glue for the rom68k ROM monitor. This was running on a
Motorola IDP board.
Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
/* Remote target glue for the ROM68K ROM monitor.
Copyright 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
This file is part of GDB.
@ -25,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "monitor.h"
#include "serial.h"
static void rom68k_open PARAMS ((char *args, int from_tty));
static void rom68k_open PARAMS ((char *, int));
static void
rom68k_supply_register (regname, regnamelen, val, vallen)
@ -41,58 +39,59 @@ rom68k_supply_register (regname, regnamelen, val, vallen)
regno = -1;
if (regnamelen == 2)
switch (regname[0])
{
case 'S':
if (regname[1] == 'R')
regno = PS_REGNUM;
break;
case 'P':
if (regname[1] == 'C')
regno = PC_REGNUM;
break;
case 'D':
if (regname[1] != 'R')
{
switch (regname[0])
{
case 'S':
if (regname[1] == 'R')
regno = PS_REGNUM;
break;
regno = D0_REGNUM;
numregs = 8;
break;
case 'A':
if (regname[1] != 'R')
case 'P':
if (regname[1] == 'C')
regno = PC_REGNUM;
break;
regno = A0_REGNUM;
numregs = 7;
break;
}
case 'D':
if (regname[1] != 'R')
break;
regno = D0_REGNUM;
numregs = 8;
break;
case 'A':
if (regname[1] != 'R')
break;
regno = A0_REGNUM;
numregs = 7;
break;
}
}
else if (regnamelen == 3)
switch (regname[0])
{
case 'I':
if (regname[1] == 'S' && regname[2] == 'P')
regno = SP_REGNUM;
}
{
switch (regname[0])
{
case 'I':
if (regname[1] == 'S' && regname[2] == 'P')
regno = SP_REGNUM;
}
}
if (regno >= 0)
while (numregs-- > 0)
val = monitor_supply_register (regno++, val);
}
/*
* this array of registers need to match the indexes used by GDB. The
* whole reason this exists is cause the various ROM monitors use
* different strings than GDB does, and doesn't support all the
* registers either. So, typing "info reg sp" becomes a "r30".
*/
/* 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
either. So, typing "info reg sp" becomes a "r30". */
static char *rom68k_regnames[NUM_REGS] = {
"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
"A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
"SR", "PC" };
/*
* Define the monitor command strings. Since these are passed directly
* through to a printf style function, we need can include formatting
* strings. We also need a CR or LF on the end.
*/
/* Define the monitor command strings. Since these are passed directly
through to a printf style function, we may include formatting
strings. We also need a CR or LF on the end. */
static struct target_ops rom68k_ops;
@ -158,10 +157,10 @@ static struct monitor_ops rom68k_cmds =
SERIAL_1_STOPBITS, /* number of stop bits */
rom68k_regnames, /* registers names */
MONITOR_OPS_MAGIC /* magic */
};
};
void
rom68k_open(args, from_tty)
static void
rom68k_open (args, from_tty)
char *args;
int from_tty;
{
@ -181,6 +180,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
add_target (&rom68k_ops);
/* 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;
}