if (diag)
return diag;
} else if (symname[0] == '%') {
- if (kdb_check_regs())
- return 0;
+ diag = kdb_check_regs();
+ if (diag)
+ return diag;
/* Implement register values with % at a later time as it is
* arch optional.
*/
*/
static int kdb_rd(int argc, const char **argv)
{
- int len = 0;
+ int len = kdb_check_regs();
+#if DBG_MAX_REG_NUM > 0
int i;
char *rname;
int rsize;
u16 reg16;
u8 reg8;
- if (kdb_check_regs())
- return 0;
-
- /* Fallback to Linux showregs() if we don't have DBG_MAX_REG_NUM */
- if (DBG_MAX_REG_NUM <= 0) {
- kdb_dumpregs(kdb_current_regs);
- return 0;
- }
+ if (len)
+ return len;
for (i = 0; i < DBG_MAX_REG_NUM; i++) {
rsize = dbg_reg_def[i].size * 2;
}
}
kdb_printf("\n");
+#else
+ if (len)
+ return len;
+ kdb_dumpregs(kdb_current_regs);
+#endif
return 0;
}
if (diag)
return diag;
- if (kdb_check_regs())
- return 0;
+ diag = kdb_check_regs();
+ if (diag)
+ return diag;
diag = KDB_BADREG;
for (i = 0; i < DBG_MAX_REG_NUM; i++) {