Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
ptrace.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/regset.h>
#include <linux/tracehook.h>
#include <linux/elf.h>
#include <linux/user.h>
#include <linux/security.h>
#include <linux/signal.h>
#include <linux/seccomp.h>
#include <linux/audit.h>
#include <trace/syscall.h>
#include <linux/hw_breakpoint.h>
#include <linux/perf_event.h>
#include <asm/uaccess.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/switch_to.h>
#include <trace/events/syscalls.h>

Go to the source code of this file.

Data Structures

struct  pt_regs_offset
 

Macros

#define CREATE_TRACE_POINTS
 
#define PARAMETER_SAVE_AREA_OFFSET   48 /* bytes */
 
#define STR(s)   #s /* convert to string */
 
#define REG_OFFSET_NAME(r)   {.name = #r, .offset = offsetof(struct pt_regs, r)}
 
#define GPR_OFFSET_NAME(num)   {.name = STR(gpr##num), .offset = offsetof(struct pt_regs, gpr[num])}
 
#define REG_OFFSET_END   {.name = NULL, .offset = 0}
 

: the name of a register

regs_query_register_offset() - query register offset from its name

regs_query_register_offset() returns the offset of a register in struct pt_regs from its name. If the name is invalid, this returns -EINVAL;

#define MSR_DEBUGCHANGE   (MSR_SE | MSR_BE)
 
#define PT_MAX_PUT_REG   PT_CCR
 
enum  powerpc_regset { REGSET_GPR, REGSET_FPR }
 
int regs_query_register_offset (const char *name)
 
const charregs_query_register_name (unsigned int offset)
 
unsigned long ptrace_get_reg (struct task_struct *task, int regno)
 
int ptrace_put_reg (struct task_struct *task, int regno, unsigned long data)
 
struct user_regset_viewtask_user_regset_view (struct task_struct *task)
 
void user_enable_single_step (struct task_struct *task)
 
void user_enable_block_step (struct task_struct *task)
 
void user_disable_single_step (struct task_struct *task)
 
int ptrace_set_debugreg (struct task_struct *task, unsigned long addr, unsigned long data)
 
void ptrace_disable (struct task_struct *child)
 
long arch_ptrace (struct task_struct *child, long request, unsigned long addr, unsigned long data)
 
long do_syscall_trace_enter (struct pt_regs *regs)
 
void do_syscall_trace_leave (struct pt_regs *regs)
 

Macro Definition Documentation

#define CREATE_TRACE_POINTS

Definition at line 41 of file ptrace.c.

#define GPR_OFFSET_NAME (   num)    {.name = STR(gpr##num), .offset = offsetof(struct pt_regs, gpr[num])}

Definition at line 61 of file ptrace.c.

#define MSR_DEBUGCHANGE   (MSR_SE | MSR_BE)

Definition at line 158 of file ptrace.c.

#define PARAMETER_SAVE_AREA_OFFSET   48 /* bytes */

Definition at line 51 of file ptrace.c.

#define PT_MAX_PUT_REG   PT_CCR

Definition at line 167 of file ptrace.c.

#define REG_OFFSET_END   {.name = NULL, .offset = 0}

Definition at line 63 of file ptrace.c.

#define REG_OFFSET_NAME (   r)    {.name = #r, .offset = offsetof(struct pt_regs, r)}

Definition at line 60 of file ptrace.c.

#define STR (   s)    #s /* convert to string */

Definition at line 59 of file ptrace.c.

Enumeration Type Documentation

Enumerator:
REGSET_GPR 
REGSET_FPR 

Definition at line 584 of file ptrace.c.

Function Documentation

long arch_ptrace ( struct task_struct child,
long  request,
unsigned long  addr,
unsigned long  data 
)

Definition at line 1438 of file ptrace.c.

long do_syscall_trace_enter ( struct pt_regs regs)

Definition at line 1670 of file ptrace.c.

void do_syscall_trace_leave ( struct pt_regs regs)

Definition at line 1706 of file ptrace.c.

void ptrace_disable ( struct task_struct child)

Definition at line 1033 of file ptrace.c.

unsigned long ptrace_get_reg ( struct task_struct task,
int  regno 
)

Definition at line 195 of file ptrace.c.

int ptrace_put_reg ( struct task_struct task,
int  regno,
unsigned long  data 
)

Definition at line 212 of file ptrace.c.

int ptrace_set_debugreg ( struct task_struct task,
unsigned long  addr,
unsigned long  data 
)

Definition at line 899 of file ptrace.c.

const char* regs_query_register_name ( unsigned int  offset)

regs_query_register_name() - query register name from its offset : the offset of a register in struct pt_regs.

regs_query_register_name() returns the name of a register from its offset in struct pt_regs. If the is invalid, this returns NULL;

Definition at line 138 of file ptrace.c.

int regs_query_register_offset ( const char name)

Definition at line 122 of file ptrace.c.

struct user_regset_view* task_user_regset_view ( struct task_struct tsk)
read

task_user_regset_view - Return the process's native regset view. : a thread of the process in question

Return the &struct user_regset_view that is native for the given process. For example, what it would access when it called ptrace(). Throughout the life of the process, this only changes at exec.

Definition at line 806 of file ptrace.c.

void user_disable_single_step ( struct task_struct task)

Definition at line 850 of file ptrace.c.

void user_enable_block_step ( struct task_struct task)

Definition at line 833 of file ptrace.c.

void user_enable_single_step ( struct task_struct task)

Definition at line 816 of file ptrace.c.