Commit b0679c63 authored by Jason Wessel's avatar Jason Wessel

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: default avatarJason Wessel <jason.wessel@windriver.com>
parent 9e8b624f
...@@ -605,13 +605,13 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -605,13 +605,13 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
if (dbg_kdb_mode) { if (dbg_kdb_mode) {
kgdb_connected = 1; kgdb_connected = 1;
error = kdb_stub(ks); error = kdb_stub(ks);
kgdb_connected = 0;
} else { } else {
error = gdb_serial_stub(ks); error = gdb_serial_stub(ks);
} }
if (error == DBG_PASS_EVENT) { if (error == DBG_PASS_EVENT) {
dbg_kdb_mode = !dbg_kdb_mode; dbg_kdb_mode = !dbg_kdb_mode;
kgdb_connected = 0;
} else if (error == DBG_SWITCH_CPU_EVENT) { } else if (error == DBG_SWITCH_CPU_EVENT) {
dbg_cpu_switch(cpu, dbg_switch_cpu); dbg_cpu_switch(cpu, dbg_switch_cpu);
goto cpu_loop; goto cpu_loop;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment