Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Variables
ptrace.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/elf.h>
#include <linux/smp.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/security.h>
#include <linux/init.h>
#include <linux/signal.h>
#include <linux/uaccess.h>
#include <linux/perf_event.h>
#include <linux/hw_breakpoint.h>
#include <linux/regset.h>
#include <linux/audit.h>
#include <linux/tracehook.h>
#include <linux/unistd.h>
#include <asm/pgtable.h>
#include <asm/traps.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 REG_PC   15
 
#define REG_PSR   16
 
#define BREAKINST_ARM   0xe7f001f0
 
#define BREAKINST_THUMB   0xde01
 
#define REG_OFFSET_NAME(r)   {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)}
 
#define REG_OFFSET_END   {.name = NULL, .offset = 0}
 

Variables

struct pt_regs_offset __attribute__
 

: 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;

enum  arm_regset { REGSET_GPR, REGSET_FPR }
 
enum  ptrace_syscall_dir { PTRACE_SYSCALL_ENTER = 0, PTRACE_SYSCALL_EXIT }
 
int regs_query_register_offset (const char *name)
 
const charregs_query_register_name (unsigned int offset)
 
bool regs_within_kernel_stack (struct pt_regs *regs, unsigned long addr)
 
unsigned long regs_get_kernel_stack_nth (struct pt_regs *regs, unsigned int n)
 
void ptrace_disable (struct task_struct *child)
 
void ptrace_break (struct task_struct *tsk, struct pt_regs *regs)
 
 core_initcall (ptrace_break_init)
 
struct user_regset_viewtask_user_regset_view (struct task_struct *task)
 
long arch_ptrace (struct task_struct *child, long request, unsigned long addr, unsigned long data)
 
asmlinkage int syscall_trace_enter (struct pt_regs *regs, int scno)
 
asmlinkage int syscall_trace_exit (struct pt_regs *regs, int scno)
 

Macro Definition Documentation

#define BREAKINST_ARM   0xe7f001f0

Definition at line 58 of file ptrace.c.

#define BREAKINST_THUMB   0xde01

Definition at line 59 of file ptrace.c.

#define CREATE_TRACE_POINTS

Definition at line 33 of file ptrace.c.

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

Definition at line 69 of file ptrace.c.

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

Definition at line 67 of file ptrace.c.

#define REG_PC   15

Definition at line 36 of file ptrace.c.

#define REG_PSR   16

Definition at line 37 of file ptrace.c.

Enumeration Type Documentation

enum arm_regset
Enumerator:
REGSET_GPR 
REGSET_FPR 

Definition at line 743 of file ptrace.c.

Enumerator:
PTRACE_SYSCALL_ENTER 
PTRACE_SYSCALL_EXIT 

Definition at line 914 of file ptrace.c.

Function Documentation

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

Definition at line 798 of file ptrace.c.

core_initcall ( ptrace_break_init  )
void ptrace_break ( struct task_struct tsk,
struct pt_regs regs 
)

Definition at line 203 of file ptrace.c.

void ptrace_disable ( struct task_struct child)

Definition at line 195 of file ptrace.c.

unsigned long regs_get_kernel_stack_nth ( struct pt_regs regs,
unsigned int  n 
)

regs_get_kernel_stack_nth() - get Nth entry of the stack : pt_regs which contains kernel stack pointer.
: stack entry number.

regs_get_kernel_stack_nth() returns
th entry of the kernel stack which is specified by . If the
th entry is NOT in the kernel stack, this returns 0.

Definition at line 148 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 116 of file ptrace.c.

int regs_query_register_offset ( const char name)

Definition at line 100 of file ptrace.c.

bool regs_within_kernel_stack ( struct pt_regs regs,
unsigned long  addr 
)

regs_within_kernel_stack() - check the address in the stack : pt_regs which contains kernel stack pointer. : address which is checked.

regs_within_kernel_stack() checks is within the kernel stack page(s). If is within the kernel stack, it returns true. If not, returns false.

Definition at line 133 of file ptrace.c.

Definition at line 945 of file ptrace.c.

Definition at line 955 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 793 of file ptrace.c.

Variable Documentation