traps.c (6f23fc47c1b2ac226704fb7294f43ed3b0965e51) | traps.c (9f564b92cf6d0ecb398f9348600a7d8a7f8ea804) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2012 Regents of the University of California 4 */ 5 6#include <linux/cpu.h> 7#include <linux/kernel.h> 8#include <linux/init.h> 9#include <linux/sched.h> 10#include <linux/sched/debug.h> 11#include <linux/sched/signal.h> 12#include <linux/signal.h> 13#include <linux/kdebug.h> 14#include <linux/uaccess.h> 15#include <linux/kprobes.h> | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2012 Regents of the University of California 4 */ 5 6#include <linux/cpu.h> 7#include <linux/kernel.h> 8#include <linux/init.h> 9#include <linux/sched.h> 10#include <linux/sched/debug.h> 11#include <linux/sched/signal.h> 12#include <linux/signal.h> 13#include <linux/kdebug.h> 14#include <linux/uaccess.h> 15#include <linux/kprobes.h> |
16#include <linux/uprobes.h> 17#include <asm/uprobes.h> |
|
16#include <linux/mm.h> 17#include <linux/module.h> 18#include <linux/irq.h> 19#include <linux/kexec.h> 20#include <linux/entry-common.h> 21 22#include <asm/asm-prototypes.h> 23#include <asm/bug.h> --- 218 unchanged lines hidden (view full) --- 242 bug_insn_t insn; 243 244 if (get_kernel_nofault(insn, (bug_insn_t *)pc)) 245 return 0; 246 247 return GET_INSN_LENGTH(insn); 248} 249 | 18#include <linux/mm.h> 19#include <linux/module.h> 20#include <linux/irq.h> 21#include <linux/kexec.h> 22#include <linux/entry-common.h> 23 24#include <asm/asm-prototypes.h> 25#include <asm/bug.h> --- 218 unchanged lines hidden (view full) --- 244 bug_insn_t insn; 245 246 if (get_kernel_nofault(insn, (bug_insn_t *)pc)) 247 return 0; 248 249 return GET_INSN_LENGTH(insn); 250} 251 |
252static bool probe_single_step_handler(struct pt_regs *regs) 253{ 254 bool user = user_mode(regs); 255 256 return user ? uprobe_single_step_handler(regs) : kprobe_single_step_handler(regs); 257} 258 259static bool probe_breakpoint_handler(struct pt_regs *regs) 260{ 261 bool user = user_mode(regs); 262 263 return user ? uprobe_breakpoint_handler(regs) : kprobe_breakpoint_handler(regs); 264} 265 |
|
250void handle_break(struct pt_regs *regs) 251{ | 266void handle_break(struct pt_regs *regs) 267{ |
252#ifdef CONFIG_KPROBES 253 if (kprobe_single_step_handler(regs)) | 268 if (probe_single_step_handler(regs)) |
254 return; 255 | 269 return; 270 |
256 if (kprobe_breakpoint_handler(regs)) | 271 if (probe_breakpoint_handler(regs)) |
257 return; | 272 return; |
258#endif 259#ifdef CONFIG_UPROBES 260 if (uprobe_single_step_handler(regs)) 261 return; | |
262 | 273 |
263 if (uprobe_breakpoint_handler(regs)) 264 return; 265#endif | |
266 current->thread.bad_cause = regs->cause; 267 268 if (user_mode(regs)) 269 force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->epc); 270#ifdef CONFIG_KGDB 271 else if (notify_die(DIE_TRAP, "EBREAK", regs, 0, regs->cause, SIGTRAP) 272 == NOTIFY_STOP) 273 return; --- 188 unchanged lines hidden --- | 274 current->thread.bad_cause = regs->cause; 275 276 if (user_mode(regs)) 277 force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->epc); 278#ifdef CONFIG_KGDB 279 else if (notify_die(DIE_TRAP, "EBREAK", regs, 0, regs->cause, SIGTRAP) 280 == NOTIFY_STOP) 281 return; --- 188 unchanged lines hidden --- |