提交 df4a7a48 编写于 作者: H He Sheng 提交者: guzitao

sw64: handle kprobe breakpoint if CONFIG_KPROBES=y

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG

--------------------------------

If CONFIG_KPROBES is not set, kprobe breakpoint instructions are
treated as illegal instructions.
Signed-off-by: NHe Sheng <hesheng@wxiat.com>
Reviewed-by: NCui Wei <cuiwei@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 0642af24
...@@ -261,12 +261,14 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs) ...@@ -261,12 +261,14 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs)
case IF_OPDEC: case IF_OPDEC:
switch (inst) { switch (inst) {
#ifdef CONFIG_KPROBES
case BREAK_KPROBE: case BREAK_KPROBE:
if (notify_die(DIE_BREAK, "kprobe", regs, 0, 0, SIGTRAP) == NOTIFY_STOP) if (notify_die(DIE_BREAK, "kprobe", regs, 0, 0, SIGTRAP) == NOTIFY_STOP)
return; return;
case BREAK_KPROBE_SS: case BREAK_KPROBE_SS:
if (notify_die(DIE_SSTEPBP, "single_step", regs, 0, 0, SIGTRAP) == NOTIFY_STOP) if (notify_die(DIE_SSTEPBP, "single_step", regs, 0, 0, SIGTRAP) == NOTIFY_STOP)
return; return;
#endif
#ifdef CONFIG_UPROBES #ifdef CONFIG_UPROBES
case UPROBE_BRK_UPROBE: case UPROBE_BRK_UPROBE:
if (notify_die(DIE_UPROBE, "uprobe", regs, 0, 0, SIGTRAP) == NOTIFY_STOP) if (notify_die(DIE_UPROBE, "uprobe", regs, 0, 0, SIGTRAP) == NOTIFY_STOP)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册