Skip to content

Commit b0679c6

Browse files
committed
debug_core,kdb: fix kgdb_connected bit set in the wrong place
Immediately following an exit from the kdb shell the kgdb_connected variable should be set to zero, unless there are breakpoints planted. If the kgdb_connected variable is not zeroed out with kdb, it is impossible to turn off kdb. This patch is merely a work around for now, the real fix will check for the breakpoints. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 9e8b624 commit b0679c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/debug/debug_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,13 @@ 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+
kgdb_connected = 0;
608609
} else {
609610
error = gdb_serial_stub(ks);
610611
}
611612

612613
if (error == DBG_PASS_EVENT) {
613614
dbg_kdb_mode = !dbg_kdb_mode;
614-
kgdb_connected = 0;
615615
} else if (error == DBG_SWITCH_CPU_EVENT) {
616616
dbg_cpu_switch(cpu, dbg_switch_cpu);
617617
goto cpu_loop;

0 commit comments

Comments
 (0)