Commit 3fa43aba08c5b5a4b407e402606fbe463239b14a

Authored by Jason Wessel
1 parent df4939350b

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>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

kernel/debug/debug_core.c
... ... @@ -605,6 +605,8 @@
605 605 if (dbg_kdb_mode) {
606 606 kgdb_connected = 1;
607 607 error = kdb_stub(ks);
  608 + if (error == -1)
  609 + continue;
608 610 kgdb_connected = 0;
609 611 } else {
610 612 error = gdb_serial_stub(ks);