step.c (577f99c1d08cf9cbdafd4e858dd13ff04d855090) | step.c (4ba51fd75cc3789be83f0d6f878dabbb0cb19bca) |
---|---|
1/* 2 * x86 single-step support code, common to 32-bit and 64-bit. 3 */ 4#include <linux/sched.h> 5#include <linux/mm.h> 6#include <linux/ptrace.h> 7 8unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs) --- 126 unchanged lines hidden (view full) --- 135 return 1; 136} 137 138/* 139 * Install this value in MSR_IA32_DEBUGCTLMSR whenever child is running. 140 */ 141static void write_debugctlmsr(struct task_struct *child, unsigned long val) 142{ | 1/* 2 * x86 single-step support code, common to 32-bit and 64-bit. 3 */ 4#include <linux/sched.h> 5#include <linux/mm.h> 6#include <linux/ptrace.h> 7 8unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs) --- 126 unchanged lines hidden (view full) --- 135 return 1; 136} 137 138/* 139 * Install this value in MSR_IA32_DEBUGCTLMSR whenever child is running. 140 */ 141static void write_debugctlmsr(struct task_struct *child, unsigned long val) 142{ |
143 if (child->thread.debugctlmsr == val) 144 return; 145 |
|
143 child->thread.debugctlmsr = val; 144 145 if (child != current) 146 return; 147 148 wrmsrl(MSR_IA32_DEBUGCTLMSR, val); 149} 150 --- 9 unchanged lines hidden (view full) --- 160 * So noone should try to use debugger block stepping in a program 161 * that uses user-mode single stepping itself. 162 */ 163 if (enable_single_step(child) && block) { 164 set_tsk_thread_flag(child, TIF_DEBUGCTLMSR); 165 write_debugctlmsr(child, 166 child->thread.debugctlmsr | DEBUGCTLMSR_BTF); 167 } else { | 146 child->thread.debugctlmsr = val; 147 148 if (child != current) 149 return; 150 151 wrmsrl(MSR_IA32_DEBUGCTLMSR, val); 152} 153 --- 9 unchanged lines hidden (view full) --- 163 * So noone should try to use debugger block stepping in a program 164 * that uses user-mode single stepping itself. 165 */ 166 if (enable_single_step(child) && block) { 167 set_tsk_thread_flag(child, TIF_DEBUGCTLMSR); 168 write_debugctlmsr(child, 169 child->thread.debugctlmsr | DEBUGCTLMSR_BTF); 170 } else { |
168 write_debugctlmsr(child, 169 child->thread.debugctlmsr & ~DEBUGCTLMSR_BTF); | 171 write_debugctlmsr(child, 172 child->thread.debugctlmsr & ~DEBUGCTLMSR_BTF); |
170 | 173 |
171 if (!child->thread.debugctlmsr) 172 clear_tsk_thread_flag(child, TIF_DEBUGCTLMSR); | 174 if (!child->thread.debugctlmsr) 175 clear_tsk_thread_flag(child, TIF_DEBUGCTLMSR); |
173 } 174} 175 176void user_enable_single_step(struct task_struct *child) 177{ 178 enable_step(child, 0); 179} 180 --- 23 unchanged lines hidden --- | 176 } 177} 178 179void user_enable_single_step(struct task_struct *child) 180{ 181 enable_step(child, 0); 182} 183 --- 23 unchanged lines hidden --- |