uprobes.c (bdc1e47217315be14ba04881b0a4c8ecb3ff320c) | uprobes.c (9bd1190a11c9d2c59d35cb999b8d170ad52aab5f) |
---|---|
1/* 2 * User-space Probes (UProbes) for x86 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 669 unchanged lines hidden (view full) --- 678 679 break; 680 } 681 return false; 682} 683 684void arch_uprobe_enable_step(struct arch_uprobe *auprobe) 685{ | 1/* 2 * User-space Probes (UProbes) for x86 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 669 unchanged lines hidden (view full) --- 678 679 break; 680 } 681 return false; 682} 683 684void arch_uprobe_enable_step(struct arch_uprobe *auprobe) 685{ |
686 struct uprobe_task *utask = current->utask; 687 struct arch_uprobe_task *autask = &utask->autask; | 686 struct task_struct *task = current; 687 struct arch_uprobe_task *autask = &task->utask->autask; 688 struct pt_regs *regs = task_pt_regs(task); |
688 689 autask->restore_flags = 0; | 689 690 autask->restore_flags = 0; |
690 if (!test_tsk_thread_flag(current, TIF_SINGLESTEP) && 691 !(auprobe->fixups & UPROBE_FIX_SETF)) | 691 if (!(regs->flags & X86_EFLAGS_TF) && 692 !(auprobe->fixups & UPROBE_FIX_SETF)) |
692 autask->restore_flags |= UPROBE_CLEAR_TF; | 693 autask->restore_flags |= UPROBE_CLEAR_TF; |
693 /* 694 * The state of TIF_BLOCKSTEP is not saved. With the TF flag set we 695 * would to examine the opcode and the flags to make it right. Without 696 * TF block stepping makes no sense. 697 */ 698 user_enable_single_step(current); | 694 695 regs->flags |= X86_EFLAGS_TF; 696 if (test_tsk_thread_flag(task, TIF_BLOCKSTEP)) 697 set_task_blockstep(task, false); |
699} 700 701void arch_uprobe_disable_step(struct arch_uprobe *auprobe) 702{ | 698} 699 700void arch_uprobe_disable_step(struct arch_uprobe *auprobe) 701{ |
703 struct uprobe_task *utask = current->utask; 704 struct arch_uprobe_task *autask = &utask->autask; 705 | 702 struct task_struct *task = current; 703 struct arch_uprobe_task *autask = &task->utask->autask; 704 struct pt_regs *regs = task_pt_regs(task); 705 /* 706 * The state of TIF_BLOCKSTEP was not saved so we can get an extra 707 * SIGTRAP if we do not clear TF. We need to examine the opcode to 708 * make it right. 709 */ |
706 if (autask->restore_flags & UPROBE_CLEAR_TF) | 710 if (autask->restore_flags & UPROBE_CLEAR_TF) |
707 user_disable_single_step(current); | 711 regs->flags &= ~X86_EFLAGS_TF; |
708} | 712} |