GDB (xrefs)
Loading...
Searching...
No Matches
Macros | Functions
linux-ptrace.h File Reference
#include "nat/gdb_ptrace.h"
#include "gdbsupport/gdb_wait.h"

Go to the source code of this file.

Macros

#define PTRACE_TYPE_ARG3   void *
 
#define PTRACE_TYPE_ARG4   void *
 
#define PTRACE_GETSIGINFO   0x4202
 
#define PTRACE_SETSIGINFO   0x4203
 
#define PTRACE_GETREGSET   0x4204
 
#define PTRACE_SETREGSET   0x4205
 
#define PTRACE_SETOPTIONS   0x4200
 
#define PTRACE_GETEVENTMSG   0x4201
 
#define PTRACE_O_TRACESYSGOOD   0x00000001
 
#define PTRACE_O_TRACEFORK   0x00000002
 
#define PTRACE_O_TRACEVFORK   0x00000004
 
#define PTRACE_O_TRACECLONE   0x00000008
 
#define PTRACE_O_TRACEEXEC   0x00000010
 
#define PTRACE_O_TRACEVFORKDONE   0x00000020
 
#define PTRACE_O_TRACEEXIT   0x00000040
 
#define PTRACE_EVENT_FORK   1
 
#define PTRACE_EVENT_VFORK   2
 
#define PTRACE_EVENT_CLONE   3
 
#define PTRACE_EVENT_EXEC   4
 
#define PTRACE_EVENT_VFORK_DONE   5
 
#define PTRACE_EVENT_EXIT   6
 
#define PTRACE_O_EXITKILL   0x00100000
 
#define __WALL   0x40000000 /* Wait for any child. */
 
#define USE_SIGTRAP_SIGINFO   1
 
#define GDB_ARCH_IS_TRAP_BRKPT(X)   ((X) == TRAP_BRKPT)
 
#define GDB_ARCH_IS_TRAP_HWBKPT(X)   ((X) == TRAP_HWBKPT)
 
#define TRAP_HWBKPT   4
 

Functions

std::string linux_ptrace_attach_fail_reason (pid_t pid)
 
std::string linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err)
 
void linux_ptrace_init_warnings (void)
 
void linux_check_ptrace_features (void)
 
void linux_enable_event_reporting (pid_t pid, int attached)
 
void linux_disable_event_reporting (pid_t pid)
 
int linux_ptrace_get_extended_event (int wstat)
 
int linux_is_extended_waitstatus (int wstat)
 
int linux_wstatus_maybe_breakpoint (int wstat)
 

Macro Definition Documentation

◆ __WALL

#define __WALL   0x40000000 /* Wait for any child. */

Definition at line 97 of file linux-ptrace.h.

◆ GDB_ARCH_IS_TRAP_BRKPT

#define GDB_ARCH_IS_TRAP_BRKPT (   X)    ((X) == TRAP_BRKPT)

Definition at line 171 of file linux-ptrace.h.

◆ GDB_ARCH_IS_TRAP_HWBKPT

#define GDB_ARCH_IS_TRAP_HWBKPT (   X)    ((X) == TRAP_HWBKPT)

Definition at line 172 of file linux-ptrace.h.

◆ PTRACE_EVENT_CLONE

#define PTRACE_EVENT_CLONE   3

Definition at line 74 of file linux-ptrace.h.

◆ PTRACE_EVENT_EXEC

#define PTRACE_EVENT_EXEC   4

Definition at line 75 of file linux-ptrace.h.

◆ PTRACE_EVENT_EXIT

#define PTRACE_EVENT_EXIT   6

Definition at line 77 of file linux-ptrace.h.

◆ PTRACE_EVENT_FORK

#define PTRACE_EVENT_FORK   1

Definition at line 72 of file linux-ptrace.h.

◆ PTRACE_EVENT_VFORK

#define PTRACE_EVENT_VFORK   2

Definition at line 73 of file linux-ptrace.h.

◆ PTRACE_EVENT_VFORK_DONE

#define PTRACE_EVENT_VFORK_DONE   5

Definition at line 76 of file linux-ptrace.h.

◆ PTRACE_GETEVENTMSG

#define PTRACE_GETEVENTMSG   0x4201

Definition at line 60 of file linux-ptrace.h.

◆ PTRACE_GETREGSET

#define PTRACE_GETREGSET   0x4204

Definition at line 48 of file linux-ptrace.h.

◆ PTRACE_GETSIGINFO

#define PTRACE_GETSIGINFO   0x4202

Definition at line 43 of file linux-ptrace.h.

◆ PTRACE_O_EXITKILL

#define PTRACE_O_EXITKILL   0x00100000

Definition at line 83 of file linux-ptrace.h.

◆ PTRACE_O_TRACECLONE

#define PTRACE_O_TRACECLONE   0x00000008

Definition at line 66 of file linux-ptrace.h.

◆ PTRACE_O_TRACEEXEC

#define PTRACE_O_TRACEEXEC   0x00000010

Definition at line 67 of file linux-ptrace.h.

◆ PTRACE_O_TRACEEXIT

#define PTRACE_O_TRACEEXIT   0x00000040

Definition at line 69 of file linux-ptrace.h.

◆ PTRACE_O_TRACEFORK

#define PTRACE_O_TRACEFORK   0x00000002

Definition at line 64 of file linux-ptrace.h.

◆ PTRACE_O_TRACESYSGOOD

#define PTRACE_O_TRACESYSGOOD   0x00000001

Definition at line 63 of file linux-ptrace.h.

◆ PTRACE_O_TRACEVFORK

#define PTRACE_O_TRACEVFORK   0x00000004

Definition at line 65 of file linux-ptrace.h.

◆ PTRACE_O_TRACEVFORKDONE

#define PTRACE_O_TRACEVFORKDONE   0x00000020

Definition at line 68 of file linux-ptrace.h.

◆ PTRACE_SETOPTIONS

#define PTRACE_SETOPTIONS   0x4200

Definition at line 59 of file linux-ptrace.h.

◆ PTRACE_SETREGSET

#define PTRACE_SETREGSET   0x4205

Definition at line 52 of file linux-ptrace.h.

◆ PTRACE_SETSIGINFO

#define PTRACE_SETSIGINFO   0x4203

Definition at line 44 of file linux-ptrace.h.

◆ PTRACE_TYPE_ARG3

#define PTRACE_TYPE_ARG3   void *

Definition at line 35 of file linux-ptrace.h.

◆ PTRACE_TYPE_ARG4

#define PTRACE_TYPE_ARG4   void *

Definition at line 39 of file linux-ptrace.h.

◆ TRAP_HWBKPT

#define TRAP_HWBKPT   4

Definition at line 176 of file linux-ptrace.h.

◆ USE_SIGTRAP_SIGINFO

#define USE_SIGTRAP_SIGINFO   1

Definition at line 118 of file linux-ptrace.h.

Function Documentation

◆ linux_check_ptrace_features()

void linux_check_ptrace_features ( void  )

◆ linux_disable_event_reporting()

void linux_disable_event_reporting ( pid_t  pid)

Definition at line 400 of file linux-ptrace.c.

References pid, ptrace, PTRACE_SETOPTIONS, and PTRACE_TYPE_ARG3.

Referenced by linux_nat_target::follow_fork().

◆ linux_enable_event_reporting()

void linux_enable_event_reporting ( pid_t  pid,
int  attached 
)

◆ linux_is_extended_waitstatus()

int linux_is_extended_waitstatus ( int  wstat)

Definition at line 432 of file linux-ptrace.c.

References linux_ptrace_get_extended_event().

Referenced by detach_one_lwp(), linux_nat_filter_event(), and wait_lwp().

◆ linux_ptrace_attach_fail_reason()

std::string linux_ptrace_attach_fail_reason ( pid_t  pid)

◆ linux_ptrace_attach_fail_reason_string()

std::string linux_ptrace_attach_fail_reason_string ( ptid_t  ptid,
int  err 
)

Definition at line 59 of file linux-ptrace.c.

References err, and linux_ptrace_attach_fail_reason().

Referenced by attach_proc_task_lwp_callback().

◆ linux_ptrace_get_extended_event()

int linux_ptrace_get_extended_event ( int  wstat)

◆ linux_ptrace_init_warnings()

void linux_ptrace_init_warnings ( void  )

Definition at line 410 of file linux-ptrace.c.

References linux_ptrace_test_ret_to_nx().

Referenced by linux_init_ptrace_procfs().

◆ linux_wstatus_maybe_breakpoint()

int linux_wstatus_maybe_breakpoint ( int  wstat)

Definition at line 440 of file linux-ptrace.c.

Referenced by linux_nat_filter_event().