소스 검색

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>
Jason Wessel 15 년 전
부모
커밋
3fa43aba08
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      kernel/debug/debug_core.c

+ 2 - 0
kernel/debug/debug_core.c

@@ -605,6 +605,8 @@ cpu_master_loop:
 		if (dbg_kdb_mode) {
 		if (dbg_kdb_mode) {
 			kgdb_connected = 1;
 			kgdb_connected = 1;
 			error = kdb_stub(ks);
 			error = kdb_stub(ks);
+			if (error == -1)
+				continue;
 			kgdb_connected = 0;
 			kgdb_connected = 0;
 		} else {
 		} else {
 			error = gdb_serial_stub(ks);
 			error = gdb_serial_stub(ks);