Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169851
b: refs/heads/master
c: 1cedae7
h: refs/heads/master
i:
  169849: 54d01c1
  169847: 273f7c9
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Dec 2, 2009
1 parent 7edfeff commit 97c346b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b62fe019e39edfd1dbe3f224ecd0a87d9365223
refs/heads/master: 1cedae72904b85462082dbcfd5190309ba37f8bd
16 changes: 12 additions & 4 deletions trunk/arch/x86/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ static unsigned long ptrace_get_dr7(struct perf_event *bp[])

static struct perf_event *
ptrace_modify_breakpoint(struct perf_event *bp, int len, int type,
struct task_struct *tsk)
struct task_struct *tsk, int disabled)
{
int err;
int gen_len, gen_type;
Expand All @@ -616,7 +616,7 @@ ptrace_modify_breakpoint(struct perf_event *bp, int len, int type,
attr = bp->attr;
attr.bp_len = gen_len;
attr.bp_type = gen_type;
attr.disabled = 0;
attr.disabled = disabled;

return modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk);
}
Expand Down Expand Up @@ -655,13 +655,21 @@ static int ptrace_write_dr7(struct task_struct *tsk, unsigned long data)
*/
if (!second_pass)
continue;

thread->ptrace_bps[i] = NULL;
unregister_hw_breakpoint(bp);
bp = ptrace_modify_breakpoint(bp, len, type,
tsk, 1);
if (IS_ERR(bp)) {
rc = PTR_ERR(bp);
thread->ptrace_bps[i] = NULL;
break;
}
thread->ptrace_bps[i] = bp;
}
continue;
}

bp = ptrace_modify_breakpoint(bp, len, type, tsk);
bp = ptrace_modify_breakpoint(bp, len, type, tsk, 0);

/* Incorrect bp, or we have a bug in bp API */
if (IS_ERR(bp)) {
Expand Down

0 comments on commit 97c346b

Please sign in to comment.