aboutsummaryrefslogtreecommitdiff
path: root/gdb/op50-rom.c
diff options
context:
space:
mode:
authorRob Savoye <rob@cygnus>1994-10-06 05:28:49 +0000
committerRob Savoye <rob@cygnus>1994-10-06 05:28:49 +0000
commit27e889bf600d712a0135265b1f0b3c0207e84ff6 (patch)
tree198e43e64603c0ce4359264eb471a2894bc4bf5f /gdb/op50-rom.c
parent28a499bb809674b9b468bd765178bb2a4841f720 (diff)
downloadfsf-binutils-gdb-27e889bf600d712a0135265b1f0b3c0207e84ff6.zip
fsf-binutils-gdb-27e889bf600d712a0135265b1f0b3c0207e84ff6.tar.gz
fsf-binutils-gdb-27e889bf600d712a0135265b1f0b3c0207e84ff6.tar.bz2
Both targets initialize, can dump registers too.
Diffstat (limited to 'gdb/op50-rom.c')
-rw-r--r--gdb/op50-rom.c83
1 files changed, 64 insertions, 19 deletions
diff --git a/gdb/op50-rom.c b/gdb/op50-rom.c
index 419c875..ea08a26 100644
--- a/gdb/op50-rom.c
+++ b/gdb/op50-rom.c
@@ -1,10 +1,39 @@
+/*
+ * op50n-rom.c -- configure GDB for an Oki op59n eval board.
+ */
#include "defs.h"
#include "gdbcore.h"
#include "target.h"
#include "monitor.h"
void op50n_open();
-void general_open();
+void monitor_open();
+
+/*
+ * 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".
+ */
+static char *op50n_regnames[] = {
+ "r0_zero", "r1_tO ", "r2_rp ", "r3_s15 ", "r4_s14 ", "r5_s13 ", "r6_s12 ",
+ "r7_s11 ", "r8_s10 ", "r9_s9 ", "r10_s8 ", "r11_s7 ", "r12_s6 ", "r13_s5 ",
+ "r14_s4 ", "r15_s3 ", "r16_s2 ", "r17_s1 ", "r18_s0 ", "r19_t4 ", "r20_t3 ",
+ "r21_t2 ", "r22_t1 ", "r23_a3 ", "r24_a2 ", "r25_a1 ", "r26_a0 ", "r27_dp ",
+ "r28_v0 ", "r29_v1 ", "r30_sp ", "r31_t5 ", "", "", "",
+ "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", ""
+};
/*
* Define the monitor command strings. Since these are passed directly
@@ -55,23 +84,33 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
};
struct monitor_ops op50n_cmds = {
- "\r", /* monitor init string */
- "g\r", /* execute or usually GO command */
- "g\r", /* continue command */
- "t\r", /* single step */
- "b %x\r", /* set a breakpoint */
- "b %x\r", /* clear a breakpoint */
- "s %x %x\r", /* set memory to a value */
- "s %x\r", /* display memory */
- "", /* prompt memory commands use */
- "x %s %x\r", /* set a register */
- "", /* delimiter between registers */
- "x %s\r", /* read a register */
- "r\r", /* download command */
- "#", /* monitor command prompt */
- "", /* end-of-command delimitor */
- ".", /* optional command terminator */
- &op50n_ops /* target operations */
+ 1, /* 1 for ASCII, 0 for binary */
+ "\n", /* monitor init string */
+ "", /* execute or usually GO command */
+ "", /* continue command */
+ "", /* single step */
+ "", /* set a breakpoint */
+ "", /* clear a breakpoint */
+ "", /* set memory to a value */
+ "", /* display memory */
+ "", /* prompt memory commands use */
+ { /* set a register */
+ "x %s %x\n", /* set a register */
+ "", /* delimiter between registers */
+ "", /* the result */
+ },
+ {
+ "x %s\n", /* get a register */
+ "=", /* delimiter between registers */
+ " ", /* the result */
+ },
+ "r 0\r", /* download command */
+ "#", /* monitor command prompt */
+ " ", /* end-of-command delimitor */
+ ".\n", /* optional command terminator */
+ &op50n_ops, /* target operations */
+ "srec,binary", /* load types */
+ op50n_regnames
};
void
@@ -79,13 +118,19 @@ op50n_open(args, from_tty)
char *args;
int from_tty;
{
+ target_preopen(from_tty);
push_target(&op50n_ops);
push_monitor (&op50n_cmds);
- general_open (args, "op50n", from_tty);
+ monitor_open (args, "op50n", from_tty);
}
void
_initialize_op50n ()
{
add_target (&op50n_ops);
+
+ /* this is the default, since it's that's how the board comes up after
+ power cycle. It can then be changed using set remotebaud
+ */
+ baud_rate = 9600;
}