Thu Dec 26 15:15:21 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
* sparclet-rom.c: Remove includes of Unix system files. Add function "sparclet_supply_register" so that parse_register_dump will not seg-fault by calling a null function pointer. Remove XMODEM support (unfinished work?). Remove flag "MO_HANDLE_NL", so monitor's output can be read by humans. Add fill command. Remove colon from getreg.resp_delim so PSR register will work. Remove pointer to sparclet_load (downloading SREC's doesn't work). Null out local register names for %g0, all %cc and all %asr regs, since the monitor can't report them. Will return zero instead. * sparclet-stub.c: New -- remote protocol support for sparclet CPU. * config/sparc/tm-sparclet.h: Re-arrange REGISTER_NAMES: Add back %g0 and %psr, add %cc coprocessor regs, add %asr regs. Adjust NUM_REGS and REGISTER_BYTES accordingly
This commit is contained in:
parent
280f90e1a0
commit
a7f6f9ed4d
4 changed files with 1355 additions and 55 deletions
|
@ -1,3 +1,20 @@
|
||||||
|
Thu Dec 26 15:15:21 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
|
||||||
|
|
||||||
|
* sparclet-rom.c: Remove includes of Unix system files.
|
||||||
|
Add function "sparclet_supply_register" so that parse_register_dump
|
||||||
|
will not seg-fault by calling a null function pointer.
|
||||||
|
Remove XMODEM support (unfinished work?).
|
||||||
|
Remove flag "MO_HANDLE_NL", so monitor's output can be read by humans.
|
||||||
|
Add fill command.
|
||||||
|
Remove colon from getreg.resp_delim so PSR register will work.
|
||||||
|
Remove pointer to sparclet_load (downloading SREC's doesn't work).
|
||||||
|
Null out local register names for %g0, all %cc and all %asr regs,
|
||||||
|
since the monitor can't report them. Will return zero instead.
|
||||||
|
* sparclet-stub.c: New -- remote protocol support for sparclet CPU.
|
||||||
|
* config/sparc/tm-sparclet.h: Re-arrange REGISTER_NAMES:
|
||||||
|
Add back %g0 and %psr, add %cc coprocessor regs, add %asr regs.
|
||||||
|
Adjust NUM_REGS and REGISTER_BYTES accordingly
|
||||||
|
|
||||||
Tue Dec 24 10:27:37 1996 Jeffrey A Law (law@cygnus.com)
|
Tue Dec 24 10:27:37 1996 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* remote-e7000.c (want_h8300h, want_nopc_h8300h): Renamed
|
* remote-e7000.c (want_h8300h, want_nopc_h8300h): Renamed
|
||||||
|
|
|
@ -37,6 +37,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
|
#define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
|
||||||
#define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91}
|
#define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91}
|
||||||
|
|
||||||
|
#undef NUM_REGS /* formerly "72" */
|
||||||
|
/* WIN FP CPU CCP ASR AWR APSR */
|
||||||
|
#define NUM_REGS (32 + 32 + 8 + 8 + 8/*+ 32 + 1*/)
|
||||||
|
|
||||||
|
#undef REGISTER_BYTES /* formerly "(32*4 + 32*4 + 8*4)" */
|
||||||
|
#define REGISTER_BYTES (32*4 + 32*4 + 8*4 + 8*4 + 8*4/* + 32*4 + 1*4*/)
|
||||||
|
|
||||||
/* Initializer for an array of names of registers.
|
/* Initializer for an array of names of registers.
|
||||||
There should be NUM_REGS strings in this initializer. */
|
There should be NUM_REGS strings in this initializer. */
|
||||||
/* Sparclet has no fp! */
|
/* Sparclet has no fp! */
|
||||||
|
@ -44,28 +51,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
change the numbers here. */
|
change the numbers here. */
|
||||||
|
|
||||||
#undef REGISTER_NAMES
|
#undef REGISTER_NAMES
|
||||||
/* g0 removed - Sparclet returns error if attempt to access. */
|
|
||||||
/* psr removed - Sparclet does not return ": " in response,
|
|
||||||
the monitor is therefore unable to get the expected response delimiter,
|
|
||||||
causing a timeout. */
|
|
||||||
#define REGISTER_NAMES \
|
#define REGISTER_NAMES \
|
||||||
{ "", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
|
{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
|
||||||
"o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", \
|
"o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", \
|
||||||
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
|
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
|
||||||
"i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", \
|
"i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", \
|
||||||
\
|
\
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
"", "", "", "", "", "", "", "", /* no FPU regs */ \
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
"", "", "", "", "", "", "", "", \
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
"", "", "", "", "", "", "", "", \
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
"", "", "", "", "", "", "", "", \
|
||||||
|
/* no CPSR, FPSR */ \
|
||||||
|
"y", "psr", "wim", "tbr", "pc", "npc", "", "", \
|
||||||
\
|
\
|
||||||
"y", 0, "wim", "tbr", "pc", "npc", 0, 0 }
|
"ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "", \
|
||||||
|
\
|
||||||
|
"asr1", "asr15", "asr17", "asr18", "asr19", "asr20", "asr21", "asr22", \
|
||||||
|
/* \
|
||||||
|
"awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7", \
|
||||||
|
"awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15", \
|
||||||
|
"awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23", \
|
||||||
|
"awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31", \
|
||||||
|
"apsr", \
|
||||||
|
*/ \
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove FP dependant code which was defined in tm-sparc.h */
|
/* Remove FP dependant code which was defined in tm-sparc.h */
|
||||||
#undef FP0_REGNUM /* Floating point register 0 */
|
#undef FP0_REGNUM /* Floating point register 0 */
|
||||||
#undef FPS_REGNUM /* Floating point status register */
|
#undef FPS_REGNUM /* Floating point status register */
|
||||||
#undef CPS_REGNUM /* Coprocessor status register */
|
#undef CPS_REGNUM /* Coprocessor status register */
|
||||||
|
|
||||||
|
/* sparclet register numbers */
|
||||||
|
#define CCSR_REGNUM 72
|
||||||
|
|
||||||
#undef EXTRACT_RETURN_VALUE
|
#undef EXTRACT_RETURN_VALUE
|
||||||
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -82,6 +100,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
|
write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
|
||||||
TYPE_LENGTH (TYPE)); \
|
TYPE_LENGTH (TYPE)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef PRINT_REGISTER_HOOK
|
#undef PRINT_REGISTER_HOOK
|
||||||
#define PRINT_REGISTER_HOOK(regno)
|
#define PRINT_REGISTER_HOOK(regno)
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "symfile.h" /* for generic_load */
|
#include "symfile.h" /* for generic_load */
|
||||||
|
|
||||||
|
#if 0 /* Do we really need all this Unix stuff here? */
|
||||||
#if !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) && !defined (HAVE_SGTTY)
|
#if !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) && !defined (HAVE_SGTTY)
|
||||||
#define HAVE_SGTTY
|
#define HAVE_SGTTY
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,6 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#endif /* Unix stuff */
|
||||||
|
|
||||||
#define USE_GENERIC_LOAD
|
#define USE_GENERIC_LOAD
|
||||||
#define USE_SW_BREAKS
|
#define USE_SW_BREAKS
|
||||||
|
@ -64,7 +66,9 @@ sparclet_load_gen (filename, from_tty)
|
||||||
inferior_pid = 0; /* No process now */
|
inferior_pid = 0; /* No process now */
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_XMODEM_LOAD
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sparclet_xmodem_load (desc, file, hashmark)
|
sparclet_xmodem_load (desc, file, hashmark)
|
||||||
|
@ -130,7 +134,7 @@ sparclet_load (desc, file, hashmark)
|
||||||
{
|
{
|
||||||
???
|
???
|
||||||
}
|
}
|
||||||
#endif /* USE_GENERIC_LOAD */
|
#endif /* USE_XMODEM_LOAD */
|
||||||
|
|
||||||
/* This array of registers need to match the indexes used by GDB.
|
/* This array of registers need to match the indexes used by GDB.
|
||||||
This exists because the various ROM monitors use different strings
|
This exists because the various ROM monitors use different strings
|
||||||
|
@ -160,6 +164,26 @@ y: 0x00000000
|
||||||
/* monitor wants lower case */
|
/* monitor wants lower case */
|
||||||
static char *sparclet_regnames[NUM_REGS] = REGISTER_NAMES;
|
static char *sparclet_regnames[NUM_REGS] = REGISTER_NAMES;
|
||||||
|
|
||||||
|
|
||||||
|
/* Function: sparclet_supply_register
|
||||||
|
Just returns with no action.
|
||||||
|
This function is required, because parse_register_dump (monitor.c)
|
||||||
|
expects to be able to call it. If we don't supply something, it will
|
||||||
|
call a null pointer and core-dump. Since this function does not
|
||||||
|
actually do anything, GDB will request the registers individually. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
sparclet_supply_register (regname, regnamelen, val, vallen)
|
||||||
|
char *regname;
|
||||||
|
int regnamelen;
|
||||||
|
char *val;
|
||||||
|
int vallen;
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Define the monitor command strings. Since these are passed directly
|
/* Define the monitor command strings. Since these are passed directly
|
||||||
through to a printf style function, we may include formatting
|
through to a printf style function, we may include formatting
|
||||||
strings. We also need a CR or LF on the end. */
|
strings. We also need a CR or LF on the end. */
|
||||||
|
@ -170,13 +194,12 @@ static char *sparclet_inits[] = {"\n\r\r\n", NULL};
|
||||||
|
|
||||||
static struct monitor_ops sparclet_cmds =
|
static struct monitor_ops sparclet_cmds =
|
||||||
{
|
{
|
||||||
MO_CLR_BREAK_USES_ADDR
|
MO_CLR_BREAK_USES_ADDR |
|
||||||
| MO_HEX_PREFIX
|
MO_HEX_PREFIX |
|
||||||
| MO_HANDLE_NL
|
MO_NO_ECHO_ON_OPEN |
|
||||||
| MO_NO_ECHO_ON_OPEN
|
MO_NO_ECHO_ON_SETMEM |
|
||||||
| MO_NO_ECHO_ON_SETMEM
|
MO_RUN_FIRST_TIME |
|
||||||
| MO_RUN_FIRST_TIME
|
MO_GETMEM_READ_SINGLE, /* flags */
|
||||||
| MO_GETMEM_READ_SINGLE, /* flags */
|
|
||||||
sparclet_inits, /* Init strings */
|
sparclet_inits, /* Init strings */
|
||||||
"cont\r", /* continue command */
|
"cont\r", /* continue command */
|
||||||
"step\r", /* single step */
|
"step\r", /* single step */
|
||||||
|
@ -185,17 +208,17 @@ static struct monitor_ops sparclet_cmds =
|
||||||
/* can't use "br" because only 2 hw bps are supported */
|
/* can't use "br" because only 2 hw bps are supported */
|
||||||
"-bp %x\r", /* clear a breakpoint */
|
"-bp %x\r", /* clear a breakpoint */
|
||||||
"-bp\r", /* clear all breakpoints */
|
"-bp\r", /* clear all breakpoints */
|
||||||
NULL, /* fill (start end val) */
|
"fill %x -n %x -v %x -b\r", /* fill (start length val) */
|
||||||
/* can't use "fi" because it takes words, not bytes */
|
/* can't use "fi" because it takes words, not bytes */
|
||||||
{
|
{
|
||||||
/* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */
|
/* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */
|
||||||
"ex %x -b\r%x\rq\r", /* setmem.cmdb (addr, value) */
|
"ex %x -b\r%x\rq\r", /* setmem.cmdb (addr, value) */
|
||||||
"ex %x -s\r%x\rq\r", /* setmem.cmdw (addr, value) */
|
"ex %x -s\r%x\rq\r", /* setmem.cmdw (addr, value) */
|
||||||
"ex %x -l\r%x\rq\r",
|
"ex %x -l\r%x\rq\r", /* setmem.cmdl (addr, value) */
|
||||||
NULL, /* setmem.cmdll (addr, value) */
|
NULL, /* setmem.cmdll (addr, value) */
|
||||||
NULL, /*": ", /* setmem.resp_delim */
|
NULL, /*": " */ /* setmem.resp_delim */
|
||||||
NULL, /*"? ", /* setmem.term */
|
NULL, /*"? " */ /* setmem.term */
|
||||||
NULL, /*"q\r", /* setmem.term_cmd */
|
NULL, /*"q\r" */ /* setmem.term_cmd */
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
/* since the parsing of multiple bytes is difficult due to
|
/* since the parsing of multiple bytes is difficult due to
|
||||||
|
@ -218,21 +241,21 @@ static struct monitor_ops sparclet_cmds =
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"reg %s\r", /* getreg.cmd (name) */
|
"reg %s\r", /* getreg.cmd (name) */
|
||||||
": ", /* getreg.resp_delim */
|
" ", /* getreg.resp_delim */
|
||||||
NULL, /* getreg.term */
|
NULL, /* getreg.term */
|
||||||
NULL, /* getreg.term_cmd */
|
NULL, /* getreg.term_cmd */
|
||||||
},
|
},
|
||||||
"reg\r", /* dump_registers */
|
"reg\r", /* dump_registers */
|
||||||
"\\(\\w+\\)=\\([0-9a-fA-F]+\\)", /* register_pattern */
|
"\\(\\w+\\)=\\([0-9a-fA-F]+\\)", /* register_pattern */
|
||||||
NULL, /* supply_register */
|
sparclet_supply_register, /* supply_register */
|
||||||
#ifdef USE_GENERIC_LOAD
|
#ifdef USE_GENERIC_LOAD
|
||||||
NULL, /* load_routine (defaults to SRECs) */
|
NULL, /* load_routine (defaults to SRECs) */
|
||||||
NULL, /* download command */
|
NULL, /* download command */
|
||||||
NULL, /* load response */
|
NULL, /* load response */
|
||||||
#else
|
#else
|
||||||
sparclet_load, /* load_routine (defaults to SRECs) */
|
NULL, /* load_routine (defaults to SRECs) */
|
||||||
/* load [c|a] [s|f|r] [addr count] */
|
/* load [c|a] [s | f | r [addr count]] */
|
||||||
"load a s %x\r", /* download command */
|
"load c s\r", /* download command (srecs on console) */
|
||||||
"load: ", /* load response */
|
"load: ", /* load response */
|
||||||
#endif
|
#endif
|
||||||
"monitor>", /* monitor command prompt */
|
"monitor>", /* monitor command prompt */
|
||||||
|
@ -256,8 +279,16 @@ sparclet_open (args, from_tty)
|
||||||
void
|
void
|
||||||
_initialize_sparclet ()
|
_initialize_sparclet ()
|
||||||
{
|
{
|
||||||
init_monitor_ops (&sparclet_ops);
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < NUM_REGS; i++)
|
||||||
|
if (sparclet_regnames[i][0] == 'c' ||
|
||||||
|
sparclet_regnames[i][0] == 'a')
|
||||||
|
sparclet_regnames[i] = 0; /* mon can't report c* or a* regs */
|
||||||
|
|
||||||
|
sparclet_regnames[0] = 0; /* mon won't report %G0 */
|
||||||
|
|
||||||
|
init_monitor_ops (&sparclet_ops);
|
||||||
sparclet_ops.to_shortname = "sparclet"; /* for the target command */
|
sparclet_ops.to_shortname = "sparclet"; /* for the target command */
|
||||||
sparclet_ops.to_longname = "SPARC Sparclet monitor";
|
sparclet_ops.to_longname = "SPARC Sparclet monitor";
|
||||||
#ifdef USE_GENERIC_LOAD
|
#ifdef USE_GENERIC_LOAD
|
||||||
|
|
1233
gdb/sparclet-stub.c
Normal file
1233
gdb/sparclet-stub.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue