12 * this array of registers need to match the indexes used by GDB. The
13 * whole reason this exists is cause the various ROM monitors use
14 * different strings than GDB does, and doesn't support all the
15 * registers either. So, typing "info reg sp" becomes a "r30".
17 static char *w89k_regnames[] = {
18 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
19 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",
20 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29",
21 "r30", "r31", "sar", "pc", "", "", "",
22 "eiem", "iir", "iva", "ior", "ipsw","", "", "", "", "",
23 "", "", "", "", "", "", "", "ccr", "", "",
24 "tr0", "tr1", "", "", "", "", "",
25 "", "", "", "", "", "", "", "",
26 "", "", "", "", "", "", "", "",
27 "", "", "", "", "", "", "", "",
28 "", "", "", "", "", "", "", "",
29 "", "", "", "", "", "", "", "",
30 "", "", "", "", "", "", "", "",
31 "", "", "", "", "", "", "", "",
32 "", "", "", "", "", "", "", ""
36 * Define the monitor command strings. Since these are passed directly
37 * through to a printf style function, we need can include formatting
38 * strings. We also need a CR or LF on the end.
41 struct target_ops w89k_ops = {
43 "WinBond's debug monitor for the W89k Eval board",
44 "Debug on a WinBond W89K eval board.\n\
45 Specify the serial device it is connected to (e.g. /dev/ttya).",
52 monitor_fetch_register,
53 monitor_store_register,
54 monitor_prepare_to_store,
55 monitor_xfer_inferior_memory,
57 monitor_insert_breakpoint,
58 monitor_remove_breakpoint, /* Breakpoints */
63 0, /* Terminal handling */
65 monitor_load, /* load */
66 0, /* lookup_symbol */
67 monitor_create_inferior,
68 monitor_mourn_inferior,
70 0, /* notice_signals */
77 1, /* all mem, mem, stack, regs, exec */
79 0, /* Section pointers */
80 OPS_MAGIC, /* Always the last thing */
83 struct monitor_ops w89k_cmds = {
84 1, /* 1 for ASCII, 0 for binary */
85 "\n", /* monitor init string */
86 "g = %x\n", /* execute or usually GO command */
87 "g\n", /* continue command */
88 "t\n", /* single step */
89 "bp %x\n", /* set a breakpoint */
90 "bc %x\n", /* clear a breakpoint */
91 0, /* 0 for number, 1 for address */
93 "e %x %x\n", /* set memory */
98 "db %x %x\n", /* get memory */
102 { /* set a register */
103 "r %s %x\n", /* set a register */
104 "", /* delimiter between registers */
108 "r %s\r", /* get a register */
109 "", /* delimiter between registers */
112 "U\r", /* download command */
113 "ROM>", /* monitor command prompt */
114 "", /* end-of-command delimitor */
115 "", /* optional command terminator */
116 &w89k_ops, /* target operations */
117 "xmodem-srec,xmodem-som", /* load types */
118 w89k_regnames /* registers names */
122 w89k_open(args, from_tty)
126 target_preopen(from_tty);
127 push_target (&w89k_ops);
128 push_monitor (&w89k_cmds);
129 monitor_open (args, "w89k", from_tty);
135 add_target (&w89k_ops);
137 /* this is the default, since it's the only baud rate supported by the hardware */