GDBserver
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 95 of file linux-ptrace.h.

◆ GDB_ARCH_IS_TRAP_BRKPT

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

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

◆ GDB_ARCH_IS_TRAP_HWBKPT

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

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

◆ PTRACE_EVENT_CLONE

#define PTRACE_EVENT_CLONE   3

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

◆ PTRACE_EVENT_EXEC

#define PTRACE_EVENT_EXEC   4

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

◆ PTRACE_EVENT_EXIT

#define PTRACE_EVENT_EXIT   6

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

◆ PTRACE_EVENT_FORK

#define PTRACE_EVENT_FORK   1

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

◆ PTRACE_EVENT_VFORK

#define PTRACE_EVENT_VFORK   2

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

◆ PTRACE_EVENT_VFORK_DONE

#define PTRACE_EVENT_VFORK_DONE   5

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

◆ PTRACE_GETEVENTMSG

#define PTRACE_GETEVENTMSG   0x4201

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

◆ PTRACE_GETREGSET

#define PTRACE_GETREGSET   0x4204

◆ PTRACE_GETSIGINFO

#define PTRACE_GETSIGINFO   0x4202

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

◆ PTRACE_O_EXITKILL

#define PTRACE_O_EXITKILL   0x00100000

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

Referenced by linux_test_for_exitkill().

◆ PTRACE_O_TRACECLONE

#define PTRACE_O_TRACECLONE   0x00000008

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

Referenced by linux_check_ptrace_features(), and linux_enable_event_reporting().

◆ PTRACE_O_TRACEEXEC

#define PTRACE_O_TRACEEXEC   0x00000010

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

Referenced by linux_check_ptrace_features().

◆ PTRACE_O_TRACEEXIT

#define PTRACE_O_TRACEEXIT   0x00000040

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

◆ PTRACE_O_TRACEFORK

#define PTRACE_O_TRACEFORK   0x00000002

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

Referenced by linux_check_ptrace_features().

◆ PTRACE_O_TRACESYSGOOD

#define PTRACE_O_TRACESYSGOOD   0x00000001

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

Referenced by linux_check_ptrace_features().

◆ PTRACE_O_TRACEVFORK

#define PTRACE_O_TRACEVFORK   0x00000004

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

Referenced by linux_check_ptrace_features().

◆ PTRACE_O_TRACEVFORKDONE

#define PTRACE_O_TRACEVFORKDONE   0x00000020

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

Referenced by linux_check_ptrace_features().

◆ PTRACE_SETOPTIONS

#define PTRACE_SETOPTIONS   0x4200

◆ PTRACE_SETREGSET

#define PTRACE_SETREGSET   0x4205

◆ PTRACE_SETSIGINFO

#define PTRACE_SETSIGINFO   0x4203

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

◆ PTRACE_TYPE_ARG3

#define PTRACE_TYPE_ARG3   void *

◆ PTRACE_TYPE_ARG4

#define PTRACE_TYPE_ARG4   void *

◆ TRAP_HWBKPT

#define TRAP_HWBKPT   4

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

◆ USE_SIGTRAP_SIGINFO

#define USE_SIGTRAP_SIGINFO   1

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

Function Documentation

◆ linux_check_ptrace_features()

void linux_check_ptrace_features ( void )
extern

◆ linux_disable_event_reporting()

void linux_disable_event_reporting ( pid_t pid)
extern

Definition at line 399 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 )
extern

◆ linux_is_extended_waitstatus()

int linux_is_extended_waitstatus ( int wstat)
extern

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

References linux_ptrace_get_extended_event().

◆ linux_ptrace_attach_fail_reason()

std::string linux_ptrace_attach_fail_reason ( pid_t pid)
extern

◆ linux_ptrace_attach_fail_reason_string()

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

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

References linux_ptrace_attach_fail_reason().

◆ linux_ptrace_get_extended_event()

int linux_ptrace_get_extended_event ( int wstat)
extern

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

Referenced by linux_is_extended_waitstatus().

◆ linux_ptrace_init_warnings()

void linux_ptrace_init_warnings ( void )
extern

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

References linux_ptrace_test_ret_to_nx().

◆ linux_wstatus_maybe_breakpoint()

int linux_wstatus_maybe_breakpoint ( int wstat)
extern

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