Commit fcf2736c authored by Daniel Thompson's avatar Daniel Thompson

Revert "kdb: Get rid of confusing diag msg from "rd" if current task has no regs"

This reverts commit bbfceba1.

When DBG_MAX_REG_NUM is zero then a number of symbols are conditionally
defined. It is therefore not possible to check it using C expressions.
Reported-by: default avatarAnatoly Pugachev <matorola@gmail.com>
Acked-by: default avatarDoug Anderson <dianders@chromium.org>
Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
parent dc2c733e
...@@ -543,8 +543,9 @@ int kdbgetaddrarg(int argc, const char **argv, int *nextarg, ...@@ -543,8 +543,9 @@ int kdbgetaddrarg(int argc, const char **argv, int *nextarg,
if (diag) if (diag)
return diag; return diag;
} else if (symname[0] == '%') { } else if (symname[0] == '%') {
if (kdb_check_regs()) diag = kdb_check_regs();
return 0; if (diag)
return diag;
/* Implement register values with % at a later time as it is /* Implement register values with % at a later time as it is
* arch optional. * arch optional.
*/ */
...@@ -1835,7 +1836,8 @@ static int kdb_go(int argc, const char **argv) ...@@ -1835,7 +1836,8 @@ static int kdb_go(int argc, const char **argv)
*/ */
static int kdb_rd(int argc, const char **argv) 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; int i;
char *rname; char *rname;
int rsize; int rsize;
...@@ -1844,14 +1846,8 @@ static int kdb_rd(int argc, const char **argv) ...@@ -1844,14 +1846,8 @@ static int kdb_rd(int argc, const char **argv)
u16 reg16; u16 reg16;
u8 reg8; u8 reg8;
if (kdb_check_regs()) if (len)
return 0; return len;
/* 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;
}
for (i = 0; i < DBG_MAX_REG_NUM; i++) { for (i = 0; i < DBG_MAX_REG_NUM; i++) {
rsize = dbg_reg_def[i].size * 2; rsize = dbg_reg_def[i].size * 2;
...@@ -1893,7 +1889,12 @@ static int kdb_rd(int argc, const char **argv) ...@@ -1893,7 +1889,12 @@ static int kdb_rd(int argc, const char **argv)
} }
} }
kdb_printf("\n"); kdb_printf("\n");
#else
if (len)
return len;
kdb_dumpregs(kdb_current_regs);
#endif
return 0; return 0;
} }
...@@ -1927,8 +1928,9 @@ static int kdb_rm(int argc, const char **argv) ...@@ -1927,8 +1928,9 @@ static int kdb_rm(int argc, const char **argv)
if (diag) if (diag)
return diag; return diag;
if (kdb_check_regs()) diag = kdb_check_regs();
return 0; if (diag)
return diag;
diag = KDB_BADREG; diag = KDB_BADREG;
for (i = 0; i < DBG_MAX_REG_NUM; i++) { for (i = 0; i < DBG_MAX_REG_NUM; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment