LLDB  mainline
Classes | Macros | Functions
ProcessMonitor.cpp File Reference
#include <errno.h>
#include <poll.h>
#include <signal.h>
#include <stdint.h>
#include <string.h>
#include <sys/ptrace.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include "lldb/Host/Host.h"
#include "lldb/Host/PseudoTerminal.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/UnixSignals.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Status.h"
#include "llvm/Support/Errno.h"
#include "FreeBSDThread.h"
#include "Plugins/Process/POSIX/CrashReason.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "ProcessFreeBSD.h"
#include "ProcessMonitor.h"
Include dependency graph for ProcessMonitor.cpp:

Go to the source code of this file.

Classes

class  Operation
 Represents a ProcessMonitor operation. More...
 
class  ReadOperation
 Implements ProcessMonitor::ReadMemory. More...
 
class  WriteOperation
 Implements ProcessMonitor::WriteMemory. More...
 
class  ReadRegOperation
 Implements ProcessMonitor::ReadRegisterValue. More...
 
class  WriteRegOperation
 Implements ProcessMonitor::WriteRegisterValue. More...
 
class  ReadDebugRegOperation
 Implements ProcessMonitor::ReadDebugRegisterValue. More...
 
class  WriteDebugRegOperation
 Implements ProcessMonitor::WriteDebugRegisterValue. More...
 
class  ReadGPROperation
 Implements ProcessMonitor::ReadGPR. More...
 
class  ReadFPROperation
 Implements ProcessMonitor::ReadFPR. More...
 
class  WriteGPROperation
 Implements ProcessMonitor::WriteGPR. More...
 
class  WriteFPROperation
 Implements ProcessMonitor::WriteFPR. More...
 
class  ResumeOperation
 Implements ProcessMonitor::Resume. More...
 
class  SingleStepOperation
 Implements ProcessMonitor::SingleStep. More...
 
class  LwpInfoOperation
 Implements ProcessMonitor::GetLwpInfo. More...
 
class  ThreadSuspendOperation
 Implements ProcessMonitor::ThreadSuspend. More...
 
class  EventMessageOperation
 Implements ProcessMonitor::GetEventMessage. More...
 
class  KillOperation
 Implements ProcessMonitor::Kill. More...
 
class  DetachOperation
 Implements ProcessMonitor::Detach. More...
 

Macros

#define PTRACE(req, pid, addr, data)    PtraceWrapper((req), (pid), (addr), (data), #req, __FILE__, __LINE__)
 

Functions

const char * Get_PT_IO_OP (int op)
 
long PtraceWrapper (int req, lldb::pid_t pid, void *addr, int data, const char *reqName, const char *file, int line)
 
long PtraceWrapper (int req, lldb::pid_t pid, void *addr, int data)
 
static size_t DoReadMemory (lldb::pid_t pid, lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
 
static size_t DoWriteMemory (lldb::pid_t pid, lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
 
static bool EnsureFDFlags (int fd, int flags, Status &error)
 

Macro Definition Documentation

◆ PTRACE

#define PTRACE (   req,
  pid,
  addr,
  data 
)     PtraceWrapper((req), (pid), (addr), (data), #req, __FILE__, __LINE__)

Definition at line 135 of file ProcessMonitor.cpp.

Function Documentation

◆ DoReadMemory()

static size_t DoReadMemory ( lldb::pid_t  pid,
lldb::addr_t  vm_addr,
void *  buf,
size_t  size,
Status error 
)
static

Definition at line 142 of file ProcessMonitor.cpp.

References error(), and PTRACE.

Referenced by ReadOperation::Execute().

◆ DoWriteMemory()

static size_t DoWriteMemory ( lldb::pid_t  pid,
lldb::addr_t  vm_addr,
const void *  buf,
size_t  size,
Status error 
)
static

Definition at line 158 of file ProcessMonitor.cpp.

References error(), and PTRACE.

Referenced by WriteOperation::Execute().

◆ EnsureFDFlags()

static bool EnsureFDFlags ( int  fd,
int  flags,
Status error 
)
static

Definition at line 176 of file ProcessMonitor.cpp.

References error().

Referenced by ProcessMonitor::Launch().

◆ Get_PT_IO_OP()

const char* Get_PT_IO_OP ( int  op)

Definition at line 42 of file ProcessMonitor.cpp.

Referenced by PtraceWrapper().

◆ PtraceWrapper() [1/2]

long PtraceWrapper ( int  req,
lldb::pid_t  pid,
void *  addr,
int  data 
)

Definition at line 128 of file ProcessMonitor.cpp.

◆ PtraceWrapper() [2/2]

long PtraceWrapper ( int  req,
lldb::pid_t  pid,
void *  addr,
int  data,
const char *  reqName,
const char *  file,
int  line 
)