s390/ptrace: add support for PTRACE_SINGLEBLOCK
The PTRACE_SINGLEBLOCK option is used to get control whenever the inferior has executed a successful branch. The PER option to implement block stepping is successful-branching event, bit 32 in the PER-event mask. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
@@ -85,7 +85,10 @@ void update_cr_regs(struct task_struct *task)
|
||||
|
||||
/* merge TIF_SINGLE_STEP into user specified PER registers. */
|
||||
if (test_tsk_thread_flag(task, TIF_SINGLE_STEP)) {
|
||||
new.control |= PER_EVENT_IFETCH;
|
||||
if (test_tsk_thread_flag(task, TIF_BLOCK_STEP))
|
||||
new.control |= PER_EVENT_BRANCH;
|
||||
else
|
||||
new.control |= PER_EVENT_IFETCH;
|
||||
#ifdef CONFIG_64BIT
|
||||
new.control |= PER_CONTROL_SUSPENSION;
|
||||
new.control |= PER_EVENT_TRANSACTION_END;
|
||||
@@ -107,14 +110,22 @@ void update_cr_regs(struct task_struct *task)
|
||||
|
||||
void user_enable_single_step(struct task_struct *task)
|
||||
{
|
||||
clear_tsk_thread_flag(task, TIF_BLOCK_STEP);
|
||||
set_tsk_thread_flag(task, TIF_SINGLE_STEP);
|
||||
}
|
||||
|
||||
void user_disable_single_step(struct task_struct *task)
|
||||
{
|
||||
clear_tsk_thread_flag(task, TIF_BLOCK_STEP);
|
||||
clear_tsk_thread_flag(task, TIF_SINGLE_STEP);
|
||||
}
|
||||
|
||||
void user_enable_block_step(struct task_struct *task)
|
||||
{
|
||||
set_tsk_thread_flag(task, TIF_SINGLE_STEP);
|
||||
set_tsk_thread_flag(task, TIF_BLOCK_STEP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called by kernel/ptrace.c when detaching..
|
||||
*
|
||||
|
Reference in New Issue
Block a user