Crashpad
Public Types | Public Attributes | Static Public Attributes | List of all members
crashpad::PtraceBroker::Request Struct Reference

A request sent to a PtraceBroker from a PtraceClient. More...

#include "util/linux/ptrace_broker.h"

Public Types

enum  Type : uint16_t
 The type of request to serve. More...
 

Public Attributes

uint16_t version = kVersion
 The version number for this Request.
 
enum crashpad::PtraceBroker::Request::Type type
 
pid_t tid
 The thread ID associated with this request. Valid for kTypeAttach, kTypeGetThreadInfo, and kTypeReadMemory.
 
union {
   struct {
      VMAddress   base
 The base address of the memory region.
 
      VMSize   size
 The size of the memory region.
 
   }   iov
 Specifies the memory region to read for a kTypeReadMemory request.
 
   struct {
      VMSize   path_length
 The number of bytes in path. The path should not include a NUL-terminator.
 
      char   path []
 The file path to read.
 
   }   path
 Specifies the file path to read for a kTypeReadFile request.
 
}; 
 

Static Public Attributes

static constexpr uint16_t kVersion = 1
 

Detailed Description

A request sent to a PtraceBroker from a PtraceClient.

Member Enumeration Documentation

◆ Type

The type of request to serve.

Enumerator
kTypeAttach 

ptrace-attach the specified thread ID. Responds with kBoolTrue on success, otherwise kBoolFalse, followed by an Errno.

kTypeIs64Bit 

Responds with kBoolTrue if the target process is 64-bit. Otherwise, kBoolFalse.

kTypeGetThreadInfo 

Responds with a GetThreadInfoResponse containing a ThreadInfo for the specified thread ID. If an error occurs, GetThreadInfoResponse::success is set to kBoolFalse and is followed by an Errno.

kTypeReadMemory 

Reads memory from the attached process. The data is returned in a series of messages. Each message begins with an int32_t indicating the number of bytes read, 0 for end-of-file, or -1 for errors, followed by a ReadError. On success the bytes read follow.

kTypeReadFile 

Read a file's contents. The data is returned in a series of messages. The first message is an OpenResult, indicating the validity of the received file path. If the OpenResult is kOpenResultSuccess, each subsequent message begins with an int32_t indicating the number of bytes read, 0 for end-of-file, or -1 for errors, followed by an Errno. On success, the bytes read follow.

kTypeListDirectory 

Reads the contents of a directory. The data is returned in a series of messages. The first message is an OpenResult, indicating the validity of the received file path. If the OpenResult is kOpenResultSuccess, the subsequent messages return the contents of the directory as a dirent stream, as read by getdents64(). Each subsequent message begins with an int32_t indicating the number of bytes read, 0 for end-of-file, or -1 for errors, followed by an Errno. On success, the bytes read follow.

kTypeExit 

Causes the broker to return from Run(), detaching all attached threads. Does not respond.


The documentation for this struct was generated from the following file: