Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
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/slab.h>
#include <linux/ptrace.h>
#include <linux/regset.h>
#include <linux/tracehook.h>
#include <linux/user.h>
#include <linux/elf.h>
#include <linux/security.h>
#include <linux/audit.h>
#include <linux/seccomp.h>
#include <linux/signal.h>
#include <linux/perf_event.h>
#include <linux/hw_breakpoint.h>
#include <linux/rcupdate.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/i387.h>
#include <asm/fpu-internal.h>
#include <asm/debugreg.h>
#include <asm/ldt.h>
#include <asm/desc.h>
#include <asm/prctl.h>
#include <asm/proto.h>
#include <asm/hw_breakpoint.h>
#include <asm/traps.h>
#include "tls.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_OFFSET_NAME(r)   {.name = #r, .offset = offsetof(struct pt_regs, r)}
 
#define REG_OFFSET_END   {.name = NULL, .offset = 0}
 

Enumerations

enum  x86_regset {
  REGSET_GENERAL, REGSET_FP, REGSET_XFP, REGSET_IOPERM64 = REGSET_XFP,
  REGSET_XSTATE, REGSET_TLS, REGSET_IOPERM32
}
 

: 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 FLAG_MASK_32
 
#define FLAG_MASK   (FLAG_MASK_32 | X86_EFLAGS_NT)
 
#define user_regs_struct32   user_regs_struct
 
#define genregs32_get   genregs_get
 
#define genregs32_set   genregs_set
 
#define IS_IA32   0
 
u64 xstate_fx_sw_bytes [USER_XSTATE_FX_SW_WORDS]
 
int regs_query_register_offset (const char *name)
 
const charregs_query_register_name (unsigned int offset)
 
void ptrace_disable (struct task_struct *child)
 
long arch_ptrace (struct task_struct *child, long request, unsigned long addr, unsigned long data)
 
void update_regset_xstate_info (unsigned int size, u64 xstate_mask)
 
struct user_regset_viewtask_user_regset_view (struct task_struct *task)
 
void user_single_step_siginfo (struct task_struct *tsk, struct pt_regs *regs, struct siginfo *info)
 
void send_sigtrap (struct task_struct *tsk, struct pt_regs *regs, int error_code, int si_code)
 
long syscall_trace_enter (struct pt_regs *regs)
 
void syscall_trace_leave (struct pt_regs *regs)
 

Macro Definition Documentation

#define CREATE_TRACE_POINTS

Definition at line 42 of file ptrace.c.

#define FLAG_MASK   (FLAG_MASK_32 | X86_EFLAGS_NT)

Definition at line 262 of file ptrace.c.

#define FLAG_MASK_32
#define genregs32_get   genregs_get

Definition at line 1363 of file ptrace.c.

#define genregs32_set   genregs_set

Definition at line 1364 of file ptrace.c.

#define IS_IA32   0

Definition at line 1483 of file ptrace.c.

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

Definition at line 61 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.

Definition at line 1362 of file ptrace.c.

Enumeration Type Documentation

enum x86_regset
Enumerator:
REGSET_GENERAL 
REGSET_FP 
REGSET_XFP 
REGSET_IOPERM64 
REGSET_XSTATE 
REGSET_TLS 
REGSET_IOPERM32 

Definition at line 45 of file ptrace.c.

Function Documentation

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

Definition at line 854 of file ptrace.c.

void ptrace_disable ( struct task_struct child)

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

int regs_query_register_offset ( const char name)

Definition at line 103 of file ptrace.c.

void send_sigtrap ( struct task_struct tsk,
struct pt_regs regs,
int  error_code,
int  si_code 
)

Definition at line 1467 of file ptrace.c.

Definition at line 1490 of file ptrace.c.

void syscall_trace_leave ( struct pt_regs regs)

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

void update_regset_xstate_info ( unsigned int  size,
u64  xstate_mask 
)

Definition at line 1422 of file ptrace.c.

void user_single_step_siginfo ( struct task_struct tsk,
struct pt_regs regs,
struct siginfo info 
)

Definition at line 1460 of file ptrace.c.

Variable Documentation

u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS]

Definition at line 1420 of file ptrace.c.