reptyr  0.8.0
About: reptyr is a utility for taking an existing running program and attaching it to a new terminal.
  Fossies Dox: reptyr-reptyr-0.8.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ptrace.h File Reference
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/user.h>
#include <unistd.h>
Include dependency graph for ptrace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  ptrace_child
struct  syscall_numbers


#define PTRACE_SETOPTIONS   0x4200
#define PTRACE_GETEVENTMSG   0x4201
#define PTRACE_GETREGSET   0x4204
#define PTRACE_SETREGSET   0x4205


typedef unsigned long child_addr_t


enum  child_state {
  ptrace_detached = 0, ptrace_at_syscall, ptrace_after_syscall, ptrace_running,
  ptrace_stopped, ptrace_exited


int ptrace_wait (struct ptrace_child *child)
int ptrace_attach_child (struct ptrace_child *child, pid_t pid)
int ptrace_finish_attach (struct ptrace_child *child, pid_t pid)
int ptrace_detach_child (struct ptrace_child *child)
int ptrace_advance_to_state (struct ptrace_child *child, enum child_state desired)
int ptrace_save_regs (struct ptrace_child *child)
int ptrace_restore_regs (struct ptrace_child *child)
unsigned long ptrace_remote_syscall (struct ptrace_child *child, unsigned long sysno, unsigned long p0, unsigned long p1, unsigned long p2, unsigned long p3, unsigned long p4, unsigned long p5)
int ptrace_memcpy_to_child (struct ptrace_child *, child_addr_t, const void *, size_t)
int ptrace_memcpy_from_child (struct ptrace_child *, void *, child_addr_t, size_t)
struct syscall_numbersptrace_syscall_numbers (struct ptrace_child *child)

Macro Definition Documentation


#define PTRACE_GETEVENTMSG   0x4201

Definition at line 48 of file ptrace.h.


#define PTRACE_GETREGSET   0x4204

Definition at line 51 of file ptrace.h.


#define PTRACE_SETOPTIONS   0x4200

Definition at line 45 of file ptrace.h.


#define PTRACE_SETREGSET   0x4205

Definition at line 54 of file ptrace.h.

Typedef Documentation

◆ child_addr_t

typedef unsigned long child_addr_t

Definition at line 110 of file ptrace.h.

Enumeration Type Documentation

◆ child_state


Definition at line 57 of file ptrace.h.

Function Documentation

◆ ptrace_advance_to_state()

◆ ptrace_attach_child()

int ptrace_attach_child ( struct ptrace_child child,
pid_t  pid 

Definition at line 96 of file freebsd_ptrace.c.

References ptrace_child::pid, ptrace_command, and ptrace_finish_attach().

Referenced by grab_pid(), and preflight_check().

◆ ptrace_detach_child()

int ptrace_detach_child ( struct ptrace_child child)

◆ ptrace_finish_attach()

int ptrace_finish_attach ( struct ptrace_child child,
pid_t  pid 

◆ ptrace_memcpy_from_child()

int ptrace_memcpy_from_child ( struct ptrace_child child,
void *  dst,
child_addr_t  src,
size_t  n 

Definition at line 299 of file freebsd_ptrace.c.

References ptrace_child::error, min, and ptrace_command.

◆ ptrace_memcpy_to_child()

int ptrace_memcpy_to_child ( struct ptrace_child child,
child_addr_t  dst,
const void *  src,
size_t  n 

◆ ptrace_remote_syscall()

unsigned long ptrace_remote_syscall ( struct ptrace_child child,
unsigned long  sysno,
unsigned long  p0,
unsigned long  p1,
unsigned long  p2,
unsigned long  p3,
unsigned long  p4,
unsigned long  p5 

◆ ptrace_restore_regs()

int ptrace_restore_regs ( struct ptrace_child child)

◆ ptrace_save_regs()

int ptrace_save_regs ( struct ptrace_child child)

◆ ptrace_syscall_numbers()

struct syscall_numbers* ptrace_syscall_numbers ( struct ptrace_child child)

Definition at line 92 of file freebsd_ptrace.c.

References arch_syscall_numbers, and ptrace_child::personality.

Referenced by do_dup2(), do_fork(), and mmap_scratch().

◆ ptrace_wait()