Skip to content

Commit 3fa43ab

Browse files
committed
debug_core,kdb: fix crash when arch does not have single step
When an arch such as mips and microblaze does not implement either HW or software single stepping the debug core should re-enter kdb. The kdb code will properly ignore the single step operation. Attempting to single step the kernel without software or hardware support causes unpredictable kernel crashes. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent df49393 commit 3fa43ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/debug/debug_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
605605
if (dbg_kdb_mode) {
606606
kgdb_connected = 1;
607607
error = kdb_stub(ks);
608+
if (error == -1)
609+
continue;
608610
kgdb_connected = 0;
609611
} else {
610612
error = gdb_serial_stub(ks);

0 commit comments

Comments
 (0)