15 #include <linux/ptrace.h>
17 #include <asm/cacheflush.h>
22 static unsigned long kprobe_status;
23 static struct pt_regs jprobe_saved_regs;
31 if ((
unsigned long)p->
addr & 0x01) {
32 printk(
"Attempt to register kprobe at an unaligned address\n");
70 pr_debug(
"preparing to singlestep over %p (PC=%08lx)\n",
94 pr_debug(
"resuming execution at PC=%08lx\n", regs->
pc);
113 void *
addr = (
void *)regs->
pc;
116 pr_debug(
"kprobe_handler: kprobe_running=%p\n",
126 if (kprobe_running()) {
130 printk(
"FIXME: kprobe hit while single-stepping!\n");
134 printk(
"FIXME: kprobe hit while handling another kprobe\n");
137 p = kprobe_running();
150 set_current_kprobe(p);
156 prepare_singlestep(p, regs);
169 pr_debug(
"post_kprobe_handler, cur=%p\n", cur);
175 kprobe_status = KPROBE_HIT_SSDONE;
179 resume_execution(cur, regs);
180 reset_current_kprobe();
188 struct kprobe *cur = kprobe_running();
190 pr_debug(
"kprobe_fault_handler: trapnr=%d\n", trapnr);
196 resume_execution(cur, regs);
209 int ret = NOTIFY_DONE;
211 pr_debug(
"kprobe_exceptions_notify: val=%lu, data=%p\n",
220 if (post_kprobe_handler(args->
regs))
249 asm volatile(
"breakpoint" :::
"memory");