blob: 32067575ed159c1f6ac71cae431f4eb5746bff85 [file] [log] [blame]
wdenk47d1a6e2002-11-03 00:01:44 +00001/*
2 * BedBug Functions
3 */
4
5#include <common.h>
Simon Glassdec3c012014-04-10 20:01:25 -06006#include <cli.h>
wdenk47d1a6e2002-11-03 00:01:44 +00007#include <command.h>
Simon Glassa73bda42015-11-08 23:47:45 -07008#include <console.h>
wdenk47d1a6e2002-11-03 00:01:44 +00009#include <linux/ctype.h>
10#include <net.h>
wdenk57b2d802003-06-27 21:31:46 +000011#include <bedbug/type.h>
wdenk47d1a6e2002-11-03 00:01:44 +000012#include <bedbug/bedbug.h>
13#include <bedbug/regs.h>
14#include <bedbug/ppc.h>
wdenk47d1a6e2002-11-03 00:01:44 +000015
Wolfgang Denk6405a152006-03-31 18:32:53 +020016DECLARE_GLOBAL_DATA_PTR;
17
Wolfgang Denk6405a152006-03-31 18:32:53 +020018extern void show_regs __P ((struct pt_regs *));
19extern int run_command __P ((const char *, int));
wdenk47d1a6e2002-11-03 00:01:44 +000020
Wolfgang Denk6405a152006-03-31 18:32:53 +020021ulong dis_last_addr = 0; /* Last address disassembled */
22ulong dis_last_len = 20; /* Default disassembler length */
23CPU_DEBUG_CTX bug_ctx; /* Bedbug context structure */
Simon Glassbe6aafc2014-04-10 20:01:27 -060024
Wolfgang Denk6405a152006-03-31 18:32:53 +020025
wdenk47d1a6e2002-11-03 00:01:44 +000026/* ======================================================================
27 * U-Boot's puts function does not append a newline, so the bedbug stuff
28 * will use this for the output of the dis/assembler.
29 * ====================================================================== */
30
Wolfgang Denk6405a152006-03-31 18:32:53 +020031int bedbug_puts (const char *str)
wdenk47d1a6e2002-11-03 00:01:44 +000032{
Wolfgang Denk6405a152006-03-31 18:32:53 +020033 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +000034
Wolfgang Denk6405a152006-03-31 18:32:53 +020035 printf ("%s\r\n", str);
36 return 0;
37} /* bedbug_puts */
wdenk47d1a6e2002-11-03 00:01:44 +000038
39
Simon Glassbe6aafc2014-04-10 20:01:27 -060040
wdenk47d1a6e2002-11-03 00:01:44 +000041/* ======================================================================
42 * Initialize the bug_ctx structure used by the bedbug debugger. This is
43 * specific to the CPU since each has different debug registers and
44 * settings.
45 * ====================================================================== */
46
Wolfgang Denk6405a152006-03-31 18:32:53 +020047void bedbug_init (void)
wdenk47d1a6e2002-11-03 00:01:44 +000048{
Wolfgang Denk6405a152006-03-31 18:32:53 +020049 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +000050
51#if defined(CONFIG_4xx)
Wolfgang Denk6405a152006-03-31 18:32:53 +020052 void bedbug405_init (void);
53
54 bedbug405_init ();
wdenk47d1a6e2002-11-03 00:01:44 +000055#endif
56
Wolfgang Denk6405a152006-03-31 18:32:53 +020057 return;
58} /* bedbug_init */
Simon Glassbe6aafc2014-04-10 20:01:27 -060059
wdenk47d1a6e2002-11-03 00:01:44 +000060
61
wdenk47d1a6e2002-11-03 00:01:44 +000062/* ======================================================================
63 * Entry point from the interpreter to the disassembler. Repeated calls
64 * will resume from the last disassembled address.
65 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +020066int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +000067{
Wolfgang Denk6405a152006-03-31 18:32:53 +020068 ulong addr; /* Address to start disassembly from */
69 ulong len; /* # of instructions to disassemble */
70
71 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +000072
Wolfgang Denk6405a152006-03-31 18:32:53 +020073 /* Setup to go from the last address if none is given */
74 addr = dis_last_addr;
75 len = dis_last_len;
wdenk47d1a6e2002-11-03 00:01:44 +000076
Wolfgang Denk3b683112010-07-17 01:06:04 +020077 if (argc < 2)
Simon Glassa06dfc72011-12-10 08:44:01 +000078 return CMD_RET_USAGE;
wdenk47d1a6e2002-11-03 00:01:44 +000079
Wolfgang Denk6405a152006-03-31 18:32:53 +020080 if ((flag & CMD_FLAG_REPEAT) == 0) {
81 /* New command */
82 addr = simple_strtoul (argv[1], NULL, 16);
wdenk47d1a6e2002-11-03 00:01:44 +000083
Wolfgang Denk6405a152006-03-31 18:32:53 +020084 /* If an extra param is given then it is the length */
85 if (argc > 2)
86 len = simple_strtoul (argv[2], NULL, 16);
87 }
wdenk47d1a6e2002-11-03 00:01:44 +000088
Wolfgang Denk6405a152006-03-31 18:32:53 +020089 /* Run the disassembler */
90 disppc ((unsigned char *) addr, 0, len, bedbug_puts, F_RADHEX);
wdenk47d1a6e2002-11-03 00:01:44 +000091
Wolfgang Denk6405a152006-03-31 18:32:53 +020092 dis_last_addr = addr + (len * 4);
93 dis_last_len = len;
94 return 0;
95} /* do_bedbug_dis */
96
97U_BOOT_CMD (ds, 3, 1, do_bedbug_dis,
Peter Tyserdfb72b82009-01-27 18:03:12 -060098 "disassemble memory",
Wolfgang Denkc54781c2009-05-24 17:06:54 +020099 "ds <address> [# instructions]");
Simon Glassbe6aafc2014-04-10 20:01:27 -0600100
wdenk47d1a6e2002-11-03 00:01:44 +0000101/* ======================================================================
102 * Entry point from the interpreter to the assembler. Assembles
103 * instructions in consecutive memory locations until a '.' (period) is
104 * entered on a line by itself.
105 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200106int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000107{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200108 long mem_addr; /* Address to assemble into */
109 unsigned long instr; /* Machine code for text */
110 char prompt[15]; /* Prompt string for user input */
111 int asm_err; /* Error code from the assembler */
112
113 /* -------------------------------------------------- */
114 int rcode = 0;
115
Wolfgang Denk3b683112010-07-17 01:06:04 +0200116 if (argc < 2)
Simon Glassa06dfc72011-12-10 08:44:01 +0000117 return CMD_RET_USAGE;
wdenk47d1a6e2002-11-03 00:01:44 +0000118
Wolfgang Denk6405a152006-03-31 18:32:53 +0200119 printf ("\nEnter '.' when done\n");
120 mem_addr = simple_strtoul (argv[1], NULL, 16);
wdenk47d1a6e2002-11-03 00:01:44 +0000121
Wolfgang Denk6405a152006-03-31 18:32:53 +0200122 while (1) {
123 putc ('\n');
124 disppc ((unsigned char *) mem_addr, 0, 1, bedbug_puts,
125 F_RADHEX);
wdenk47d1a6e2002-11-03 00:01:44 +0000126
Wolfgang Denk6405a152006-03-31 18:32:53 +0200127 sprintf (prompt, "%08lx: ", mem_addr);
Simon Glassbe6aafc2014-04-10 20:01:27 -0600128 cli_readline(prompt);
wdenk47d1a6e2002-11-03 00:01:44 +0000129
Wolfgang Denk6405a152006-03-31 18:32:53 +0200130 if (console_buffer[0] && strcmp (console_buffer, ".")) {
131 if ((instr =
132 asmppc (mem_addr, console_buffer,
133 &asm_err)) != 0) {
134 *(unsigned long *) mem_addr = instr;
135 mem_addr += 4;
136 } else {
137 printf ("*** Error: %s ***\n",
138 asm_error_str (asm_err));
139 rcode = 1;
140 }
141 } else {
142 break;
143 }
144 }
145 return rcode;
146} /* do_bedbug_asm */
wdenk47d1a6e2002-11-03 00:01:44 +0000147
Wolfgang Denk6405a152006-03-31 18:32:53 +0200148U_BOOT_CMD (as, 2, 0, do_bedbug_asm,
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200149 "assemble memory", "as <address>");
Simon Glassbe6aafc2014-04-10 20:01:27 -0600150
wdenk47d1a6e2002-11-03 00:01:44 +0000151/* ======================================================================
152 * Used to set a break point from the interpreter. Simply calls into the
153 * CPU-specific break point set routine.
154 * ====================================================================== */
155
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200156int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000157{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200158 /* -------------------------------------------------- */
159 if (bug_ctx.do_break)
160 (*bug_ctx.do_break) (cmdtp, flag, argc, argv);
161 return 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000162
Wolfgang Denk6405a152006-03-31 18:32:53 +0200163} /* do_bedbug_break */
164
165U_BOOT_CMD (break, 3, 0, do_bedbug_break,
Peter Tyserdfb72b82009-01-27 18:03:12 -0600166 "set or clear a breakpoint",
Wolfgang Denk6405a152006-03-31 18:32:53 +0200167 " - Set or clear a breakpoint\n"
168 "break <address> - Break at an address\n"
169 "break off <bp#> - Disable breakpoint.\n"
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200170 "break show - List breakpoints.");
Simon Glassbe6aafc2014-04-10 20:01:27 -0600171
wdenk47d1a6e2002-11-03 00:01:44 +0000172/* ======================================================================
173 * Called from the debug interrupt routine. Simply calls the CPU-specific
174 * breakpoint handling routine.
175 * ====================================================================== */
176
177void do_bedbug_breakpoint (struct pt_regs *regs)
178{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200179 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000180
Wolfgang Denk6405a152006-03-31 18:32:53 +0200181 if (bug_ctx.break_isr)
182 (*bug_ctx.break_isr) (regs);
wdenk47d1a6e2002-11-03 00:01:44 +0000183
Wolfgang Denk6405a152006-03-31 18:32:53 +0200184 return;
185} /* do_bedbug_breakpoint */
wdenk47d1a6e2002-11-03 00:01:44 +0000186
187
Simon Glassbe6aafc2014-04-10 20:01:27 -0600188
wdenk47d1a6e2002-11-03 00:01:44 +0000189/* ======================================================================
190 * Called from the CPU-specific breakpoint handling routine. Enter a
191 * mini main loop until the stopped flag is cleared from the breakpoint
192 * context.
193 *
194 * This handles the parts of the debugger that are common to all CPU's.
195 * ====================================================================== */
196
Wolfgang Denk6405a152006-03-31 18:32:53 +0200197void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
wdenk47d1a6e2002-11-03 00:01:44 +0000198{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200199 int len; /* Length of command line */
200 int flag; /* Command flags */
201 int rc = 0; /* Result from run_command */
202 char prompt_str[20]; /* Prompt string */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200203 static char lastcommand[CONFIG_SYS_CBSIZE] = { 0 }; /* previous command */
Wolfgang Denk6405a152006-03-31 18:32:53 +0200204 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000205
Wolfgang Denk6405a152006-03-31 18:32:53 +0200206 if (bug_ctx.clear)
207 (*bug_ctx.clear) (bug_ctx.current_bp);
wdenk47d1a6e2002-11-03 00:01:44 +0000208
Wolfgang Denk6405a152006-03-31 18:32:53 +0200209 printf ("Breakpoint %d: ", bug_ctx.current_bp);
210 disppc ((unsigned char *) addr, 0, 1, bedbug_puts, F_RADHEX);
wdenk47d1a6e2002-11-03 00:01:44 +0000211
Wolfgang Denk6405a152006-03-31 18:32:53 +0200212 bug_ctx.stopped = 1;
213 bug_ctx.regs = regs;
wdenk47d1a6e2002-11-03 00:01:44 +0000214
Wolfgang Denk6405a152006-03-31 18:32:53 +0200215 sprintf (prompt_str, "BEDBUG.%d =>", bug_ctx.current_bp);
wdenk47d1a6e2002-11-03 00:01:44 +0000216
Wolfgang Denk6405a152006-03-31 18:32:53 +0200217 /* A miniature main loop */
218 while (bug_ctx.stopped) {
Simon Glassbe6aafc2014-04-10 20:01:27 -0600219 len = cli_readline(prompt_str);
wdenk47d1a6e2002-11-03 00:01:44 +0000220
Wolfgang Denk6405a152006-03-31 18:32:53 +0200221 flag = 0; /* assume no special flags for now */
wdenk47d1a6e2002-11-03 00:01:44 +0000222
Wolfgang Denk6405a152006-03-31 18:32:53 +0200223 if (len > 0)
224 strcpy (lastcommand, console_buffer);
225 else if (len == 0)
226 flag |= CMD_FLAG_REPEAT;
wdenk47d1a6e2002-11-03 00:01:44 +0000227
Wolfgang Denk6405a152006-03-31 18:32:53 +0200228 if (len == -1)
229 printf ("<INTERRUPT>\n");
230 else
Thomas Betker02717562014-06-05 20:07:58 +0200231 rc = run_command_repeatable(lastcommand, flag);
wdenk47d1a6e2002-11-03 00:01:44 +0000232
Wolfgang Denk6405a152006-03-31 18:32:53 +0200233 if (rc <= 0) {
234 /* invalid command or not repeatable, forget it */
235 lastcommand[0] = 0;
236 }
237 }
wdenk47d1a6e2002-11-03 00:01:44 +0000238
Wolfgang Denk6405a152006-03-31 18:32:53 +0200239 bug_ctx.regs = NULL;
240 bug_ctx.current_bp = 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000241
Wolfgang Denk6405a152006-03-31 18:32:53 +0200242 return;
243} /* bedbug_main_loop */
wdenk47d1a6e2002-11-03 00:01:44 +0000244
245
Simon Glassbe6aafc2014-04-10 20:01:27 -0600246
wdenk47d1a6e2002-11-03 00:01:44 +0000247/* ======================================================================
248 * Interpreter command to continue from a breakpoint. Just clears the
249 * stopped flag in the context so that the breakpoint routine will
250 * return.
251 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200252int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000253{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200254 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000255
Wolfgang Denk6405a152006-03-31 18:32:53 +0200256 if (!bug_ctx.stopped) {
257 printf ("Not at a breakpoint\n");
258 return 1;
259 }
wdenk47d1a6e2002-11-03 00:01:44 +0000260
Wolfgang Denk6405a152006-03-31 18:32:53 +0200261 bug_ctx.stopped = 0;
262 return 0;
263} /* do_bedbug_continue */
264
265U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
Peter Tyserdfb72b82009-01-27 18:03:12 -0600266 "continue from a breakpoint",
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200267 "");
Simon Glassbe6aafc2014-04-10 20:01:27 -0600268
wdenk47d1a6e2002-11-03 00:01:44 +0000269/* ======================================================================
270 * Interpreter command to continue to the next instruction, stepping into
271 * subroutines. Works by calling the find_next_addr() routine to compute
272 * the address passes control to the CPU-specific set breakpoint routine
273 * for the current breakpoint number.
274 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200275int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000276{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200277 unsigned long addr; /* Address to stop at */
wdenk47d1a6e2002-11-03 00:01:44 +0000278
Wolfgang Denk6405a152006-03-31 18:32:53 +0200279 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000280
Wolfgang Denk6405a152006-03-31 18:32:53 +0200281 if (!bug_ctx.stopped) {
282 printf ("Not at a breakpoint\n");
283 return 1;
284 }
wdenk47d1a6e2002-11-03 00:01:44 +0000285
York Sun4a598092013-04-01 11:29:11 -0700286 if (!find_next_address((unsigned char *) &addr, false, bug_ctx.regs))
Wolfgang Denk6405a152006-03-31 18:32:53 +0200287 return 1;
wdenk47d1a6e2002-11-03 00:01:44 +0000288
Wolfgang Denk6405a152006-03-31 18:32:53 +0200289 if (bug_ctx.set)
290 (*bug_ctx.set) (bug_ctx.current_bp, addr);
291
292 bug_ctx.stopped = 0;
293 return 0;
294} /* do_bedbug_step */
295
296U_BOOT_CMD (step, 1, 1, do_bedbug_step,
Peter Tyserdfb72b82009-01-27 18:03:12 -0600297 "single step execution.",
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200298 "");
Simon Glassbe6aafc2014-04-10 20:01:27 -0600299
wdenk47d1a6e2002-11-03 00:01:44 +0000300/* ======================================================================
301 * Interpreter command to continue to the next instruction, stepping over
302 * subroutines. Works by calling the find_next_addr() routine to compute
303 * the address passes control to the CPU-specific set breakpoint routine
304 * for the current breakpoint number.
305 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200306int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000307{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200308 unsigned long addr; /* Address to stop at */
309
310 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000311
Wolfgang Denk6405a152006-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 Sun4a598092013-04-01 11:29:11 -0700317 if (!find_next_address((unsigned char *) &addr, true, bug_ctx.regs))
Wolfgang Denk6405a152006-03-31 18:32:53 +0200318 return 1;
wdenk47d1a6e2002-11-03 00:01:44 +0000319
Wolfgang Denk6405a152006-03-31 18:32:53 +0200320 if (bug_ctx.set)
321 (*bug_ctx.set) (bug_ctx.current_bp, addr);
wdenk47d1a6e2002-11-03 00:01:44 +0000322
Wolfgang Denk6405a152006-03-31 18:32:53 +0200323 bug_ctx.stopped = 0;
324 return 0;
325} /* do_bedbug_next */
326
327U_BOOT_CMD (next, 1, 1, do_bedbug_next,
Peter Tyserdfb72b82009-01-27 18:03:12 -0600328 "single step execution, stepping over subroutines.",
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200329 "");
Simon Glassbe6aafc2014-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 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200335int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000336{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200337 unsigned long sp; /* Stack pointer */
338 unsigned long func; /* LR from stack */
339 int depth; /* Stack iteration level */
340 int skip = 1; /* Flag to skip the first entry */
341 unsigned long top; /* Top of memory address */
wdenk47d1a6e2002-11-03 00:01:44 +0000342
Wolfgang Denk6405a152006-03-31 18:32:53 +0200343 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000344
Wolfgang Denk6405a152006-03-31 18:32:53 +0200345 if (!bug_ctx.stopped) {
346 printf ("Not at a breakpoint\n");
347 return 1;
348 }
wdenk47d1a6e2002-11-03 00:01:44 +0000349
Wolfgang Denk6405a152006-03-31 18:32:53 +0200350 top = gd->bd->bi_memstart + gd->bd->bi_memsize;
351 depth = 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000352
Wolfgang Denk6405a152006-03-31 18:32:53 +0200353 printf ("Depth PC\n");
354 printf ("----- --------\n");
355 printf ("%5d %08lx\n", depth++, bug_ctx.regs->nip);
wdenk47d1a6e2002-11-03 00:01:44 +0000356
Wolfgang Denk6405a152006-03-31 18:32:53 +0200357 sp = bug_ctx.regs->gpr[1];
358 func = *(unsigned long *) (sp + 4);
wdenk47d1a6e2002-11-03 00:01:44 +0000359
Wolfgang Denk6405a152006-03-31 18:32:53 +0200360 while ((func < top) && (sp < top)) {
361 if (!skip)
362 printf ("%5d %08lx\n", depth++, func);
363 else
364 --skip;
wdenk47d1a6e2002-11-03 00:01:44 +0000365
Wolfgang Denk6405a152006-03-31 18:32:53 +0200366 sp = *(unsigned long *) sp;
367 func = *(unsigned long *) (sp + 4);
368 }
369 return 0;
370} /* do_bedbug_stack */
371
372U_BOOT_CMD (where, 1, 1, do_bedbug_stack,
Peter Tyserdfb72b82009-01-27 18:03:12 -0600373 "Print the running stack.",
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200374 "");
Simon Glassbe6aafc2014-04-10 20:01:27 -0600375
wdenk47d1a6e2002-11-03 00:01:44 +0000376/* ======================================================================
377 * Interpreter command to dump the registers. Calls the CPU-specific
378 * show registers routine.
379 * ====================================================================== */
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200380int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
wdenk47d1a6e2002-11-03 00:01:44 +0000381{
Wolfgang Denk6405a152006-03-31 18:32:53 +0200382 /* -------------------------------------------------- */
wdenk47d1a6e2002-11-03 00:01:44 +0000383
Wolfgang Denk6405a152006-03-31 18:32:53 +0200384 if (!bug_ctx.stopped) {
385 printf ("Not at a breakpoint\n");
386 return 1;
387 }
wdenk47d1a6e2002-11-03 00:01:44 +0000388
Wolfgang Denk6405a152006-03-31 18:32:53 +0200389 show_regs (bug_ctx.regs);
390 return 0;
391} /* do_bedbug_rdump */
392
393U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200394 "Show registers.", "");
wdenk47d1a6e2002-11-03 00:01:44 +0000395/* ====================================================================== */
wdenk47d1a6e2002-11-03 00:01:44 +0000396
397
398/*
399 * Copyright (c) 2001 William L. Pitts
400 * All rights reserved.
401 *
402 * Redistribution and use in source and binary forms are freely
403 * permitted provided that the above copyright notice and this
404 * paragraph and the following disclaimer are duplicated in all
405 * such forms.
406 *
407 * This software is provided "AS IS" and without any express or
408 * implied warranties, including, without limitation, the implied
409 * warranties of merchantability and fitness for a particular
410 * purpose.
411 */