Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/ptrace.h
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
#define PT_LWP_EVENTS 24 /* report LWP birth and exit */ | #define PT_LWP_EVENTS 24 /* report LWP birth and exit */ | ||||
#define PT_GET_EVENT_MASK 25 /* get mask of optional events */ | #define PT_GET_EVENT_MASK 25 /* get mask of optional events */ | ||||
#define PT_SET_EVENT_MASK 26 /* set mask of optional events */ | #define PT_SET_EVENT_MASK 26 /* set mask of optional events */ | ||||
#define PT_GET_SC_ARGS 27 /* fetch syscall args */ | #define PT_GET_SC_ARGS 27 /* fetch syscall args */ | ||||
#define PT_GET_SC_RET 28 /* fetch syscall results */ | #define PT_GET_SC_RET 28 /* fetch syscall results */ | ||||
#define PT_COREDUMP 29 /* create a coredump */ | |||||
#define PT_GETREGS 33 /* get general-purpose registers */ | #define PT_GETREGS 33 /* get general-purpose registers */ | ||||
#define PT_SETREGS 34 /* set general-purpose registers */ | #define PT_SETREGS 34 /* set general-purpose registers */ | ||||
#define PT_GETFPREGS 35 /* get floating-point registers */ | #define PT_GETFPREGS 35 /* get floating-point registers */ | ||||
#define PT_SETFPREGS 36 /* set floating-point registers */ | #define PT_SETFPREGS 36 /* set floating-point registers */ | ||||
#define PT_GETDBREGS 37 /* get debugging registers */ | #define PT_GETDBREGS 37 /* get debugging registers */ | ||||
#define PT_SETDBREGS 38 /* set debugging registers */ | #define PT_SETDBREGS 38 /* set debugging registers */ | ||||
#define PT_VM_TIMESTAMP 40 /* Get VM version (timestamp) */ | #define PT_VM_TIMESTAMP 40 /* Get VM version (timestamp) */ | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | struct ptrace_vm_entry { | ||||
u_long pve_offset; /* Offset in backing object. */ | u_long pve_offset; /* Offset in backing object. */ | ||||
u_int pve_prot; /* Protection of memory range. */ | u_int pve_prot; /* Protection of memory range. */ | ||||
u_int pve_pathlen; /* Size of path. */ | u_int pve_pathlen; /* Size of path. */ | ||||
long pve_fileid; /* File ID. */ | long pve_fileid; /* File ID. */ | ||||
uint32_t pve_fsid; /* File system ID. */ | uint32_t pve_fsid; /* File system ID. */ | ||||
char *pve_path; /* Path name of object. */ | char *pve_path; /* Path name of object. */ | ||||
}; | }; | ||||
/* Argument structure for PT_COREDUMP */ | |||||
struct ptrace_coredump { | |||||
int pc_fd; /* File descriptor to write dump to. */ | |||||
uint32_t pc_flags; /* Flags PC_* */ | |||||
off_t pc_limit; /* Maximum size of the coredump, | |||||
0 for no limit. */ | |||||
mgorny_gentoo.org: Kamil Rytarowski suggested swapping these two to avoid padding after `pc_fd`. | |||||
}; | |||||
Done Inline ActionsI don't think we actually need to reserve fields, given that we pass the size in data, and can therefore extend it without breaking user code. mgorny_gentoo.org: I don't think we actually need to reserve fields, given that we pass the size in `data`, and… | |||||
/* Flags for PT_COREDUMP pc_flags */ | |||||
#define PC_COMPRESS 0x00000001 /* Allow compression */ | |||||
#define PC_ALL 0x00000002 /* Include non-dumpable entries */ | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
struct thr_coredump_req { | |||||
struct vnode *tc_vp; /* vnode to write coredump to. */ | |||||
off_t tc_limit; /* max coredump file size. */ | |||||
int tc_flags; /* user flags */ | |||||
int tc_error; /* request result */ | |||||
}; | |||||
int ptrace_set_pc(struct thread *_td, unsigned long _addr); | int ptrace_set_pc(struct thread *_td, unsigned long _addr); | ||||
int ptrace_single_step(struct thread *_td); | int ptrace_single_step(struct thread *_td); | ||||
int ptrace_clear_single_step(struct thread *_td); | int ptrace_clear_single_step(struct thread *_td); | ||||
#ifdef __HAVE_PTRACE_MACHDEP | #ifdef __HAVE_PTRACE_MACHDEP | ||||
int cpu_ptrace(struct thread *_td, int _req, void *_addr, int _data); | int cpu_ptrace(struct thread *_td, int _req, void *_addr, int _data); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Kamil Rytarowski suggested swapping these two to avoid padding after pc_fd.