aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2008-02-15 15:55:56 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 14:05:39 -0400
commit64e9ee3095b61d0300ea548216a57d2536611309 (patch)
tree21cf21caafa18b5661ceeaeb4d29e2ed784d0345 /kernel
parent67baf94cd260dc37504dbd15ba3faa2d8cf8a444 (diff)
kgdb: add x86 HW breakpoints
Add HW breakpoints into the arch specific portion of x86 kgdb. In the current x86 kernel.org kernels HW breakpoints are changed out in lazy fashion because there is no infrastructure around changing them when changing to a kernel task or entering the kernel mode via a system call. This lazy approach means that if a user process uses HW breakpoints the kgdb will loose out. This is an acceptable trade off because the developer debugging the kernel is assumed to know what is going on system wide and would be aware of this trade off. There is a minor bug fix to the kgdb core so as to correctly call the hw breakpoint functions with a valid value from the enum. There is also a minor change to the x86_64 startup code when using early HW breakpoints. When the debugger is connected, the cpu startup code must not zero out the HW breakpoint registers or you cannot hit the breakpoints you are interested in, in the first place. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kgdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 319c08c92ee2..68aea78407e4 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -1139,10 +1139,10 @@ static void gdb_cmd_break(struct kgdb_state *ks)
1139 error = kgdb_remove_sw_break(addr); 1139 error = kgdb_remove_sw_break(addr);
1140 else if (remcom_in_buffer[0] == 'Z') 1140 else if (remcom_in_buffer[0] == 'Z')
1141 error = arch_kgdb_ops.set_hw_breakpoint(addr, 1141 error = arch_kgdb_ops.set_hw_breakpoint(addr,
1142 (int)length, *bpt_type); 1142 (int)length, *bpt_type - '0');
1143 else if (remcom_in_buffer[0] == 'z') 1143 else if (remcom_in_buffer[0] == 'z')
1144 error = arch_kgdb_ops.remove_hw_breakpoint(addr, 1144 error = arch_kgdb_ops.remove_hw_breakpoint(addr,
1145 (int) length, *bpt_type); 1145 (int) length, *bpt_type - '0');
1146 1146
1147 if (error == 0) 1147 if (error == 0)
1148 strcpy(remcom_out_buffer, "OK"); 1148 strcpy(remcom_out_buffer, "OK");