blob: 684e4a9ea5cfae486473b5a83ed5e3776a1a57a3 [file] [log] [blame]
wdenk47d1a6e2002-11-03 00:01:44 +00001/*
2 * BedBug Functions
3 */
4
5#include <common.h>
Simon Glass18d66532014-04-10 20:01:25 -06006#include <cli.h>
wdenk47d1a6e2002-11-03 00:01:44 +00007#include <command.h>
Simon Glass24b852a2015-11-08 23:47:45 -07008#include <console.h>
Simon Glass25a58182020-05-10 11:40:06 -06009#include <asm/ptrace.h>
wdenk47d1a6e2002-11-03 00:01:44 +000010#include <linux/ctype.h>
11#include <net.h>
wdenk8bde7f72003-06-27 21:31:46 +000012#include <bedbug/type.h>
wdenk47d1a6e2002-11-03 00:01:44 +000013#include <bedbug/bedbug.h>
14#include <bedbug/regs.h>
15#include <bedbug/ppc.h>
wdenk47d1a6e2002-11-03 00:01:44 +000016
Wolfgang Denkd87080b2006-03-31 18:32:53 +020017DECLARE_GLOBAL_DATA_PTR;
18
Wolfgang Denkd87080b2006-03-31 18:32:53 +020019extern void show_regs __P ((struct pt_regs *));
20extern int run_command __P ((const char *, int));
wdenk47d1a6e2002-11-03 00:01:44 +000021
Wolfgang Denkd87080b2006-03-31 18:32:53 +020022ulong dis_last_addr = 0; /* Last address disassembled */
23ulong dis_last_len = 20; /* Default disassembler length */
24CPU_DEBUG_CTX bug_ctx; /* Bedbug context structure */
Simon Glasse1bf8242014-04-10 20:01:27 -060025
Wolfgang Denkd87080b2006-03-31 18:32:53 +020026
wdenk47d1a6e2002-11-03 00:01:44 +000027/* ======================================================================
28 * U-Boot's puts function does not append a newline, so the bedbug stuff
29 * will use this for the output of the dis/assembler.
30 * ====================================================================== */
31
Wolfgang Denkd87080b2006-03-31 18:32:53 +020032int bedbug_puts (const char *str)
wdenk47d1a6e2002-11-03 00:01:44 +000033{
Wolfgang Denkd87080b2006-03-31 18:32:53 +020034 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +000035
Wolfgang Denkd87080b2006-03-31 18:32:53 +020036 printf ("%s\r\n", str);
37 return 0;
38} /* bedbug_puts */
Simon Glasse1bf8242014-04-10 20:01:27 -060039
Wolfgang Denkd87080b2006-03-31 18:32:53 +020040
41
wdenk47d1a6e2002-11-03 00:01:44 +000042/* ======================================================================
43 * Initialize the bug_ctx structure used by the bedbug debugger. This is
44 * specific to the CPU since each has different debug registers and
45 * settings.
46 * ====================================================================== */
47
Ovidiu Panait5fb292f2020-04-20 10:31:45 +030048int bedbug_init(void)
wdenk47d1a6e2002-11-03 00:01:44 +000049{
Wolfgang Denkd87080b2006-03-31 18:32:53 +020050 /* -------------------------------------------------- */
Ovidiu Panait5fb292f2020-04-20 10:31:45 +030051 return 0;
Wolfgang Denkd87080b2006-03-31 18:32:53 +020052} /* bedbug_init */
Simon Glasse1bf8242014-04-10 20:01:27 -060053
Wolfgang Denkd87080b2006-03-31 18:32:53 +020054
55
wdenk47d1a6e2002-11-03 00:01:44 +000056/* ======================================================================
57 * Entry point from the interpreter to the disassembler. Repeated calls
58 * will resume from the last disassembled address.
59 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -060060int do_bedbug_dis(struct cmd_tbl *cmdtp, int flag, int argc,
61 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +000062{
Wolfgang Denkd87080b2006-03-31 18:32:53 +020063 ulong addr; /* Address to start disassembly from */
64 ulong len; /* # of instructions to disassemble */
wdenk47d1a6e2002-11-03 00:01:44 +000065
Wolfgang Denkd87080b2006-03-31 18:32:53 +020066 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +000067
Wolfgang Denkd87080b2006-03-31 18:32:53 +020068 /* Setup to go from the last address if none is given */
69 addr = dis_last_addr;
70 len = dis_last_len;
wdenk47d1a6e2002-11-03 00:01:44 +000071
Wolfgang Denk47e26b12010-07-17 01:06:04 +020072 if (argc < 2)
Simon Glass4c12eeb2011-12-10 08:44:01 +000073 return CMD_RET_USAGE;
wdenk47d1a6e2002-11-03 00:01:44 +000074
Wolfgang Denkd87080b2006-03-31 18:32:53 +020075 if ((flag & CMD_FLAG_REPEAT) == 0) {
76 /* New command */
77 addr = simple_strtoul (argv[1], NULL, 16);
wdenk47d1a6e2002-11-03 00:01:44 +000078
Wolfgang Denkd87080b2006-03-31 18:32:53 +020079 /* If an extra param is given then it is the length */
80 if (argc > 2)
81 len = simple_strtoul (argv[2], NULL, 16);
82 }
wdenk47d1a6e2002-11-03 00:01:44 +000083
Wolfgang Denkd87080b2006-03-31 18:32:53 +020084 /* Run the disassembler */
85 disppc ((unsigned char *) addr, 0, len, bedbug_puts, F_RADHEX);
86
87 dis_last_addr = addr + (len * 4);
88 dis_last_len = len;
89 return 0;
90} /* do_bedbug_dis */
91
92U_BOOT_CMD (ds, 3, 1, do_bedbug_dis,
Peter Tyser2fb26042009-01-27 18:03:12 -060093 "disassemble memory",
Wolfgang Denka89c33d2009-05-24 17:06:54 +020094 "ds <address> [# instructions]");
Simon Glasse1bf8242014-04-10 20:01:27 -060095
wdenk47d1a6e2002-11-03 00:01:44 +000096/* ======================================================================
97 * Entry point from the interpreter to the assembler. Assembles
98 * instructions in consecutive memory locations until a '.' (period) is
99 * entered on a line by itself.
100 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -0600101int do_bedbug_asm(struct cmd_tbl *cmdtp, int flag, int argc,
102 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000103{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200104 long mem_addr; /* Address to assemble into */
105 unsigned long instr; /* Machine code for text */
106 char prompt[15]; /* Prompt string for user input */
107 int asm_err; /* Error code from the assembler */
wdenk47d1a6e2002-11-03 00:01:44 +0000108
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200109 /* -------------------------------------------------- */
110 int rcode = 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000111
Wolfgang Denk47e26b12010-07-17 01:06:04 +0200112 if (argc < 2)
Simon Glass4c12eeb2011-12-10 08:44:01 +0000113 return CMD_RET_USAGE;
wdenk47d1a6e2002-11-03 00:01:44 +0000114
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200115 printf ("\nEnter '.' when done\n");
116 mem_addr = simple_strtoul (argv[1], NULL, 16);
wdenk47d1a6e2002-11-03 00:01:44 +0000117
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200118 while (1) {
119 putc ('\n');
120 disppc ((unsigned char *) mem_addr, 0, 1, bedbug_puts,
121 F_RADHEX);
wdenk47d1a6e2002-11-03 00:01:44 +0000122
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200123 sprintf (prompt, "%08lx: ", mem_addr);
Simon Glasse1bf8242014-04-10 20:01:27 -0600124 cli_readline(prompt);
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200125
126 if (console_buffer[0] && strcmp (console_buffer, ".")) {
127 if ((instr =
128 asmppc (mem_addr, console_buffer,
129 &asm_err)) != 0) {
130 *(unsigned long *) mem_addr = instr;
131 mem_addr += 4;
132 } else {
133 printf ("*** Error: %s ***\n",
134 asm_error_str (asm_err));
135 rcode = 1;
136 }
137 } else {
138 break;
139 }
140 }
141 return rcode;
142} /* do_bedbug_asm */
143
144U_BOOT_CMD (as, 2, 0, do_bedbug_asm,
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200145 "assemble memory", "as <address>");
Simon Glasse1bf8242014-04-10 20:01:27 -0600146
wdenk47d1a6e2002-11-03 00:01:44 +0000147/* ======================================================================
148 * Used to set a break point from the interpreter. Simply calls into the
149 * CPU-specific break point set routine.
150 * ====================================================================== */
151
Simon Glass09140112020-05-10 11:40:03 -0600152int do_bedbug_break(struct cmd_tbl *cmdtp, int flag, int argc,
153 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000154{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200155 /* -------------------------------------------------- */
156 if (bug_ctx.do_break)
157 (*bug_ctx.do_break) (cmdtp, flag, argc, argv);
158 return 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000159
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200160} /* do_bedbug_break */
161
162U_BOOT_CMD (break, 3, 0, do_bedbug_break,
Peter Tyser2fb26042009-01-27 18:03:12 -0600163 "set or clear a breakpoint",
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200164 " - Set or clear a breakpoint\n"
165 "break <address> - Break at an address\n"
166 "break off <bp#> - Disable breakpoint.\n"
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200167 "break show - List breakpoints.");
Simon Glasse1bf8242014-04-10 20:01:27 -0600168
wdenk47d1a6e2002-11-03 00:01:44 +0000169/* ======================================================================
170 * Called from the debug interrupt routine. Simply calls the CPU-specific
171 * breakpoint handling routine.
172 * ====================================================================== */
173
174void do_bedbug_breakpoint (struct pt_regs *regs)
175{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200176 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000177
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200178 if (bug_ctx.break_isr)
179 (*bug_ctx.break_isr) (regs);
wdenk47d1a6e2002-11-03 00:01:44 +0000180
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200181 return;
182} /* do_bedbug_breakpoint */
Simon Glasse1bf8242014-04-10 20:01:27 -0600183
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200184
185
wdenk47d1a6e2002-11-03 00:01:44 +0000186/* ======================================================================
187 * Called from the CPU-specific breakpoint handling routine. Enter a
188 * mini main loop until the stopped flag is cleared from the breakpoint
189 * context.
190 *
191 * This handles the parts of the debugger that are common to all CPU's.
192 * ====================================================================== */
193
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200194void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
wdenk47d1a6e2002-11-03 00:01:44 +0000195{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200196 int len; /* Length of command line */
197 int flag; /* Command flags */
198 int rc = 0; /* Result from run_command */
199 char prompt_str[20]; /* Prompt string */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200200 static char lastcommand[CONFIG_SYS_CBSIZE] = { 0 }; /* previous command */
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200201 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000202
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200203 if (bug_ctx.clear)
204 (*bug_ctx.clear) (bug_ctx.current_bp);
wdenk47d1a6e2002-11-03 00:01:44 +0000205
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200206 printf ("Breakpoint %d: ", bug_ctx.current_bp);
207 disppc ((unsigned char *) addr, 0, 1, bedbug_puts, F_RADHEX);
wdenk47d1a6e2002-11-03 00:01:44 +0000208
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200209 bug_ctx.stopped = 1;
210 bug_ctx.regs = regs;
wdenk47d1a6e2002-11-03 00:01:44 +0000211
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200212 sprintf (prompt_str, "BEDBUG.%d =>", bug_ctx.current_bp);
wdenk47d1a6e2002-11-03 00:01:44 +0000213
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200214 /* A miniature main loop */
215 while (bug_ctx.stopped) {
Simon Glasse1bf8242014-04-10 20:01:27 -0600216 len = cli_readline(prompt_str);
wdenk47d1a6e2002-11-03 00:01:44 +0000217
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200218 flag = 0; /* assume no special flags for now */
wdenk47d1a6e2002-11-03 00:01:44 +0000219
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200220 if (len > 0)
221 strcpy (lastcommand, console_buffer);
222 else if (len == 0)
223 flag |= CMD_FLAG_REPEAT;
wdenk47d1a6e2002-11-03 00:01:44 +0000224
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200225 if (len == -1)
226 printf ("<INTERRUPT>\n");
227 else
Thomas Betker52715f82014-06-05 20:07:58 +0200228 rc = run_command_repeatable(lastcommand, flag);
wdenk47d1a6e2002-11-03 00:01:44 +0000229
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200230 if (rc <= 0) {
231 /* invalid command or not repeatable, forget it */
232 lastcommand[0] = 0;
233 }
234 }
wdenk47d1a6e2002-11-03 00:01:44 +0000235
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200236 bug_ctx.regs = NULL;
237 bug_ctx.current_bp = 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000238
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200239 return;
240} /* bedbug_main_loop */
Simon Glasse1bf8242014-04-10 20:01:27 -0600241
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200242
243
wdenk47d1a6e2002-11-03 00:01:44 +0000244/* ======================================================================
245 * Interpreter command to continue from a breakpoint. Just clears the
246 * stopped flag in the context so that the breakpoint routine will
247 * return.
248 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -0600249int do_bedbug_continue(struct cmd_tbl *cmdtp, int flag, int argc,
250 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000251{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200252 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000253
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200254 if (!bug_ctx.stopped) {
255 printf ("Not at a breakpoint\n");
256 return 1;
257 }
wdenk47d1a6e2002-11-03 00:01:44 +0000258
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200259 bug_ctx.stopped = 0;
260 return 0;
261} /* do_bedbug_continue */
262
263U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
Peter Tyser2fb26042009-01-27 18:03:12 -0600264 "continue from a breakpoint",
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200265 "");
Simon Glasse1bf8242014-04-10 20:01:27 -0600266
wdenk47d1a6e2002-11-03 00:01:44 +0000267/* ======================================================================
268 * Interpreter command to continue to the next instruction, stepping into
269 * subroutines. Works by calling the find_next_addr() routine to compute
270 * the address passes control to the CPU-specific set breakpoint routine
271 * for the current breakpoint number.
272 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -0600273int do_bedbug_step(struct cmd_tbl *cmdtp, int flag, int argc,
274 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000275{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200276 unsigned long addr; /* Address to stop at */
wdenk47d1a6e2002-11-03 00:01:44 +0000277
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200278 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000279
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200280 if (!bug_ctx.stopped) {
281 printf ("Not at a breakpoint\n");
282 return 1;
283 }
wdenk47d1a6e2002-11-03 00:01:44 +0000284
York Sun472d5462013-04-01 11:29:11 -0700285 if (!find_next_address((unsigned char *) &addr, false, bug_ctx.regs))
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200286 return 1;
wdenk47d1a6e2002-11-03 00:01:44 +0000287
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200288 if (bug_ctx.set)
289 (*bug_ctx.set) (bug_ctx.current_bp, addr);
290
291 bug_ctx.stopped = 0;
292 return 0;
293} /* do_bedbug_step */
294
295U_BOOT_CMD (step, 1, 1, do_bedbug_step,
Peter Tyser2fb26042009-01-27 18:03:12 -0600296 "single step execution.",
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200297 "");
Simon Glasse1bf8242014-04-10 20:01:27 -0600298
wdenk47d1a6e2002-11-03 00:01:44 +0000299/* ======================================================================
300 * Interpreter command to continue to the next instruction, stepping over
301 * subroutines. Works by calling the find_next_addr() routine to compute
302 * the address passes control to the CPU-specific set breakpoint routine
303 * for the current breakpoint number.
304 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -0600305int do_bedbug_next(struct cmd_tbl *cmdtp, int flag, int argc,
306 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000307{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200308 unsigned long addr; /* Address to stop at */
wdenk47d1a6e2002-11-03 00:01:44 +0000309
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200310 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000311
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200312 if (!bug_ctx.stopped) {
313 printf ("Not at a breakpoint\n");
314 return 1;
315 }
wdenk47d1a6e2002-11-03 00:01:44 +0000316
York Sun472d5462013-04-01 11:29:11 -0700317 if (!find_next_address((unsigned char *) &addr, true, bug_ctx.regs))
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200318 return 1;
wdenk47d1a6e2002-11-03 00:01:44 +0000319
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200320 if (bug_ctx.set)
321 (*bug_ctx.set) (bug_ctx.current_bp, addr);
322
323 bug_ctx.stopped = 0;
324 return 0;
325} /* do_bedbug_next */
326
327U_BOOT_CMD (next, 1, 1, do_bedbug_next,
Peter Tyser2fb26042009-01-27 18:03:12 -0600328 "single step execution, stepping over subroutines.",
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200329 "");
Simon Glasse1bf8242014-04-10 20:01:27 -0600330
wdenk47d1a6e2002-11-03 00:01:44 +0000331/* ======================================================================
332 * Interpreter command to print the current stack. This assumes an EABI
333 * architecture, so it starts with GPR R1 and works back up the stack.
334 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -0600335int do_bedbug_stack(struct cmd_tbl *cmdtp, int flag, int argc,
336 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000337{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200338 unsigned long sp; /* Stack pointer */
339 unsigned long func; /* LR from stack */
340 int depth; /* Stack iteration level */
341 int skip = 1; /* Flag to skip the first entry */
342 unsigned long top; /* Top of memory address */
wdenk47d1a6e2002-11-03 00:01:44 +0000343
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200344 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000345
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200346 if (!bug_ctx.stopped) {
347 printf ("Not at a breakpoint\n");
348 return 1;
349 }
wdenk47d1a6e2002-11-03 00:01:44 +0000350
Stefan Roesee207f222020-08-12 13:16:36 +0200351 top = gd->ram_start + gd->ram_size;
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200352 depth = 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000353
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200354 printf ("Depth PC\n");
355 printf ("----- --------\n");
356 printf ("%5d %08lx\n", depth++, bug_ctx.regs->nip);
wdenk47d1a6e2002-11-03 00:01:44 +0000357
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200358 sp = bug_ctx.regs->gpr[1];
359 func = *(unsigned long *) (sp + 4);
wdenk47d1a6e2002-11-03 00:01:44 +0000360
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200361 while ((func < top) && (sp < top)) {
362 if (!skip)
363 printf ("%5d %08lx\n", depth++, func);
364 else
365 --skip;
wdenk47d1a6e2002-11-03 00:01:44 +0000366
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200367 sp = *(unsigned long *) sp;
368 func = *(unsigned long *) (sp + 4);
369 }
370 return 0;
371} /* do_bedbug_stack */
372
373U_BOOT_CMD (where, 1, 1, do_bedbug_stack,
Peter Tyser2fb26042009-01-27 18:03:12 -0600374 "Print the running stack.",
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200375 "");
Simon Glasse1bf8242014-04-10 20:01:27 -0600376
wdenk47d1a6e2002-11-03 00:01:44 +0000377/* ======================================================================
378 * Interpreter command to dump the registers. Calls the CPU-specific
379 * show registers routine.
380 * ====================================================================== */
Simon Glass09140112020-05-10 11:40:03 -0600381int do_bedbug_rdump(struct cmd_tbl *cmdtp, int flag, int argc,
382 char *const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000383{
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200384 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000385
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200386 if (!bug_ctx.stopped) {
387 printf ("Not at a breakpoint\n");
388 return 1;
389 }
wdenk47d1a6e2002-11-03 00:01:44 +0000390
Wolfgang Denkd87080b2006-03-31 18:32:53 +0200391 show_regs (bug_ctx.regs);
392 return 0;
393} /* do_bedbug_rdump */
394
395U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
Wolfgang Denka89c33d2009-05-24 17:06:54 +0200396 "Show registers.", "");
wdenk47d1a6e2002-11-03 00:01:44 +0000397/* ====================================================================== */
wdenk47d1a6e2002-11-03 00:01:44 +0000398
399
400/*
401 * Copyright (c) 2001 William L. Pitts
402 * All rights reserved.
403 *
404 * Redistribution and use in source and binary forms are freely
405 * permitted provided that the above copyright notice and this
406 * paragraph and the following disclaimer are duplicated in all
407 * such forms.
408 *
409 * This software is provided "AS IS" and without any express or
410 * implied warranties, including, without limitation, the implied
411 * warranties of merchantability and fitness for a particular
412 * purpose.
413 */