GDBserver
Macros | Functions
linux-ptrace.h File Reference
#include "nat/gdb_ptrace.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

void linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer)
 
char * 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_supports_tracefork (void)
 
int linux_supports_traceexec (void)
 
int linux_supports_traceclone (void)
 
int linux_supports_tracevforkdone (void)
 
int linux_supports_tracesysgood (void)
 
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. */

◆ GDB_ARCH_IS_TRAP_BRKPT

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

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

Referenced by save_stop_reason().

◆ GDB_ARCH_IS_TRAP_HWBKPT

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

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

Referenced by save_stop_reason().

◆ PTRACE_EVENT_CLONE

#define PTRACE_EVENT_CLONE   3

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

Referenced by handle_extended_wait().

◆ PTRACE_EVENT_EXEC

#define PTRACE_EVENT_EXEC   4

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

Referenced by handle_extended_wait(), and linux_low_filter_event().

◆ PTRACE_EVENT_EXIT

#define PTRACE_EVENT_EXIT   6

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

◆ PTRACE_EVENT_FORK

#define PTRACE_EVENT_FORK   1

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

Referenced by handle_extended_wait(), and linux_test_for_tracefork().

◆ PTRACE_EVENT_VFORK

#define PTRACE_EVENT_VFORK   2

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

Referenced by handle_extended_wait().

◆ PTRACE_EVENT_VFORK_DONE

#define PTRACE_EVENT_VFORK_DONE   5

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

Referenced by handle_extended_wait().

◆ PTRACE_GETEVENTMSG

#define PTRACE_GETEVENTMSG   0x4201

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

Referenced by handle_extended_wait(), and linux_test_for_tracefork().

◆ PTRACE_GETREGSET

#define PTRACE_GETREGSET   0x4204

◆ PTRACE_GETSIGINFO

#define PTRACE_GETSIGINFO   0x4202

◆ PTRACE_O_EXITKILL

#define PTRACE_O_EXITKILL   0x00100000

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

Referenced by linux_low_ptrace_options(), and linux_test_for_exitkill().

◆ PTRACE_O_TRACECLONE

#define PTRACE_O_TRACECLONE   0x00000008

◆ PTRACE_O_TRACEEXEC

#define PTRACE_O_TRACEEXEC   0x00000010

◆ PTRACE_O_TRACEEXIT

#define PTRACE_O_TRACEEXIT   0x00000040

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

◆ PTRACE_O_TRACEFORK

#define PTRACE_O_TRACEFORK   0x00000002

◆ PTRACE_O_TRACESYSGOOD

#define PTRACE_O_TRACESYSGOOD   0x00000001

◆ PTRACE_O_TRACEVFORK

#define PTRACE_O_TRACEVFORK   0x00000004

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

Referenced by linux_low_ptrace_options(), and linux_test_for_tracefork().

◆ PTRACE_O_TRACEVFORKDONE

#define PTRACE_O_TRACEVFORKDONE   0x00000020

◆ PTRACE_SETOPTIONS

#define PTRACE_SETOPTIONS   0x4200

◆ PTRACE_SETREGSET

#define PTRACE_SETREGSET   0x4205

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

Referenced by aarch64_linux_set_debug_regs().

◆ PTRACE_SETSIGINFO

#define PTRACE_SETSIGINFO   0x4203

◆ PTRACE_TYPE_ARG3

#define PTRACE_TYPE_ARG3   void *

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

◆ PTRACE_TYPE_ARG4

#define PTRACE_TYPE_ARG4   void *

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

◆ TRAP_HWBKPT

#define TRAP_HWBKPT   4

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

◆ USE_SIGTRAP_SIGINFO

#define USE_SIGTRAP_SIGINFO   1

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 512 of file linux-ptrace.c.

References ptrace(), PTRACE_SETOPTIONS, and PTRACE_TYPE_ARG3.

◆ 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 608 of file linux-ptrace.c.

References linux_ptrace_get_extended_event().

Referenced by get_detach_signal(), and linux_low_filter_event().

◆ linux_ptrace_attach_fail_reason()

void linux_ptrace_attach_fail_reason ( pid_t  pid,
struct buffer buffer 
)

◆ linux_ptrace_attach_fail_reason_string()

char* linux_ptrace_attach_fail_reason_string ( ptid_t  ptid,
int  err 
)

◆ 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 586 of file linux-ptrace.c.

References linux_ptrace_test_ret_to_nx().

Referenced by initialize_low().

◆ linux_supports_traceclone()

int linux_supports_traceclone ( void  )

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

References PTRACE_O_TRACECLONE, and ptrace_supports_feature().

◆ linux_supports_traceexec()

int linux_supports_traceexec ( void  )

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

References PTRACE_O_TRACEEXEC, and ptrace_supports_feature().

Referenced by linux_supports_exec_events().

◆ linux_supports_tracefork()

int linux_supports_tracefork ( void  )

◆ linux_supports_tracesysgood()

int linux_supports_tracesysgood ( void  )

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

References PTRACE_O_TRACESYSGOOD, and ptrace_supports_feature().

Referenced by linux_supports_catch_syscall().

◆ linux_supports_tracevforkdone()

int linux_supports_tracevforkdone ( void  )

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

References PTRACE_O_TRACEVFORKDONE, and ptrace_supports_feature().

◆ linux_wstatus_maybe_breakpoint()

int linux_wstatus_maybe_breakpoint ( int  wstat)

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

References WIFSTOPPED, and WSTOPSIG.

Referenced by linux_low_filter_event(), and linux_wait_1().