summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-02-06 09:05:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-02-06 09:05:42 -0800
commitd854b2d639fd61ccdc184385ee4036658a52e57e (patch)
tree30a5e50ea537dc55cc527a44d3f3d3ad0d4f4873 /kernel
parent9e6c535c64adf6155e4a11fe8d63b384fe3452f8 (diff)
parentfcf2736c82ca1908e3a0e74730c404baebd8ccdf (diff)
Merge tag 'kgdb-fixes-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux
Pull kgdb fix from Daniel Thompson: "One of the simplifications added for 5.6-rc1 has caused build regressions on some platforms (it was reported for sparc64). This fixes it with a revert" * tag 'kgdb-fixes-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: Revert "kdb: Get rid of confusing diag msg from "rd" if current task has no regs"
Diffstat (limited to 'kernel')
-rw-r--r--kernel/debug/kdb/kdb_main.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index b22292b649c4..ba12e9f4661e 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -543,8 +543,9 @@ int kdbgetaddrarg(int argc, const char **argv, int *nextarg,
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.
*/
@@ -1835,7 +1836,8 @@ static int kdb_go(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;
char *rname;
int rsize;
@@ -1844,14 +1846,8 @@ static int kdb_rd(int argc, const char **argv)
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;
@@ -1893,7 +1889,12 @@ static int kdb_rd(int argc, const char **argv)
}
}
kdb_printf("\n");
+#else
+ if (len)
+ return len;
+ kdb_dumpregs(kdb_current_regs);
+#endif
return 0;
}
@@ -1927,8 +1928,9 @@ static int kdb_rm(int argc, const char **argv)
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++) {