Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
ptrace.h File Reference
#include <linux/compiler.h>
#include <uapi/asm/ptrace.h>

Go to the source code of this file.

Data Structures

struct  single_step_state
 

Macros

#define PTRACE_O_MASK_TILE   (PTRACE_O_TRACEMIGRATE)
 
#define PT_TRACE_MIGRATE   0x00080000
 
#define PT_TRACE_MASK_TILE   (PT_TRACE_MIGRATE)
 
#define PT_FLAGS_DISABLE_IRQ   1 /* on return to kernel, disable irqs */
 
#define PT_FLAGS_CALLER_SAVES   2 /* caller-save registers are valid */
 
#define PT_FLAGS_RESTORE_REGS   4 /* restore callee-save regs on return */
 
#define instruction_pointer(regs)   ((regs)->pc)
 
#define profile_pc(regs)   instruction_pointer(regs)
 
#define user_mode(regs)   (EX1_PL((regs)->ex1) == USER_PL)
 
#define arch_has_single_step()   (1)
 
#define SINGLESTEP_STATE_MASK_IS_ENABLED   0x1
 
#define SINGLESTEP_STATE_MASK_UPDATE   0x2
 
#define SINGLESTEP_STATE_TARGET_LB   2
 
#define SINGLESTEP_STATE_TARGET_UB   7
 

Typedefs

typedef unsigned long pt_reg_t
 

Functions

struct pt_regsget_pt_regs (struct pt_regs *)
 
void do_syscall_trace (void)
 
void single_step_once (struct pt_regs *regs)
 
void single_step_execve (void)
 
void send_sigtrap (struct task_struct *tsk, struct pt_regs *regs, int error_code)
 

Macro Definition Documentation

#define arch_has_single_step ( )    (1)

Definition at line 49 of file ptrace.h.

#define instruction_pointer (   regs)    ((regs)->pc)

Definition at line 37 of file ptrace.h.

#define profile_pc (   regs)    instruction_pointer(regs)

Definition at line 38 of file ptrace.h.

#define PT_FLAGS_CALLER_SAVES   2 /* caller-save registers are valid */

Definition at line 32 of file ptrace.h.

#define PT_FLAGS_DISABLE_IRQ   1 /* on return to kernel, disable irqs */

Definition at line 31 of file ptrace.h.

#define PT_FLAGS_RESTORE_REGS   4 /* restore callee-save regs on return */

Definition at line 33 of file ptrace.h.

#define PT_TRACE_MASK_TILE   (PT_TRACE_MIGRATE)

Definition at line 28 of file ptrace.h.

#define PT_TRACE_MIGRATE   0x00080000

Definition at line 27 of file ptrace.h.

#define PTRACE_O_MASK_TILE   (PTRACE_O_TRACEMIGRATE)

Definition at line 26 of file ptrace.h.

#define SINGLESTEP_STATE_MASK_IS_ENABLED   0x1

Definition at line 91 of file ptrace.h.

#define SINGLESTEP_STATE_MASK_UPDATE   0x2

Definition at line 92 of file ptrace.h.

#define SINGLESTEP_STATE_TARGET_LB   2

Definition at line 93 of file ptrace.h.

#define SINGLESTEP_STATE_TARGET_UB   7

Definition at line 94 of file ptrace.h.

#define user_mode (   regs)    (EX1_PL((regs)->ex1) == USER_PL)

Definition at line 41 of file ptrace.h.

Typedef Documentation

typedef unsigned long pt_reg_t

Definition at line 21 of file ptrace.h.

Function Documentation

void do_syscall_trace ( void  )

Definition at line 181 of file ptrace.c.

struct pt_regs* get_pt_regs ( struct pt_regs )
read
void send_sigtrap ( struct task_struct tsk,
struct pt_regs regs,
int  error_code 
)

Definition at line 188 of file ptrace.c.

void single_step_execve ( void  )

Definition at line 281 of file single_step.c.

void single_step_once ( struct pt_regs regs)

single_step_once() - entry point when single stepping has been triggered. : The machine register state

When we arrive at this routine via a trampoline, the single step engine copies the executing bundle to the single step buffer. If the instruction is a condition branch, then the target is reset to one past the next instruction. If the instruction sets the lr, then that is noted. If the instruction is a jump or call, then the new target pc is preserved and the current bundle instruction set to null.

The necessary post-single-step rewriting information is stored in single_step_state-> We use data segment values because the stack will be rewound when we run the rewritten single-stepped instruction.

Definition at line 305 of file single_step.c.