debug_core,kdb: fix crash when arch does not have single step
authorJason Wessel <jason.wessel@windriver.com>
Thu, 5 Aug 2010 14:22:25 +0000 (09:22 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Thu, 5 Aug 2010 14:22:25 +0000 (09:22 -0500)
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>
kernel/debug/debug_core.c

index 8bc5eeffec8a953f844d853cc9abe30bbb4d77c4..9ed9307615d9ab0c6132333756f9c44bc56a4bde 100644 (file)
@@ -605,6 +605,8 @@ cpu_master_loop:
                if (dbg_kdb_mode) {
                        kgdb_connected = 1;
                        error = kdb_stub(ks);
+                       if (error == -1)
+                               continue;
                        kgdb_connected = 0;
                } else {
                        error = gdb_serial_stub(ks);