Crashpad
Public Member Functions | List of all members
crashpad::ExceptionHandlerClient Class Reference

A client for an ExceptionHandlerServer. More...

#include "util/linux/exception_handler_client.h"

Public Member Functions

 ExceptionHandlerClient (int sock, bool multiple_clients)
 Constructs this object. More...
 
bool GetHandlerCredentials (ucred *creds)
 Communicates with the handler to determine its credentials. More...
 
int RequestCrashDump (const ExceptionHandlerProtocol::ClientInformation &info)
 Request a crash dump from the ExceptionHandlerServer. More...
 
int SetPtracer (pid_t pid)
 Uses prctl(PR_SET_PTRACER, ...) to set the process with process ID pid as the ptracer for this process. More...
 
void SetCanSetPtracer (bool can_set_ptracer)
 Enables or disables SetPtracer(). More...
 

Detailed Description

A client for an ExceptionHandlerServer.

Constructor & Destructor Documentation

◆ ExceptionHandlerClient()

crashpad::ExceptionHandlerClient::ExceptionHandlerClient ( int  sock,
bool  multiple_clients 
)

Constructs this object.

Parameters
[in]sockA socket connected to an ExceptionHandlerServer.
[in]multiple_clientstrue if this socket may be used by multiple clients.

Member Function Documentation

◆ GetHandlerCredentials()

bool crashpad::ExceptionHandlerClient::GetHandlerCredentials ( ucred *  creds)

Communicates with the handler to determine its credentials.

If using a multi-client socket, this method should be called before sharing the client socket end, or the handler's response may not be received.

Parameters
[out]credsThe handler process' credentials, valid if this method returns true.
Returns
true on success. Otherwise, false with a message logged.

◆ RequestCrashDump()

int crashpad::ExceptionHandlerClient::RequestCrashDump ( const ExceptionHandlerProtocol::ClientInformation info)

Request a crash dump from the ExceptionHandlerServer.

This method blocks until the crash dump is complete.

Parameters
[in]infoInformation about this client.
Returns
0 on success or an error code on failure.

◆ SetCanSetPtracer()

void crashpad::ExceptionHandlerClient::SetCanSetPtracer ( bool  can_set_ptracer)

Enables or disables SetPtracer().

Parameters
[in]can_set_ptracerWhether SetPtracer should be enabled.

◆ SetPtracer()

int crashpad::ExceptionHandlerClient::SetPtracer ( pid_t  pid)

Uses prctl(PR_SET_PTRACER, ...) to set the process with process ID pid as the ptracer for this process.

Parameters
[in]pidThe process ID of the process to be set as this process' ptracer.
Returns
0 on success or an error code on failure.

The documentation for this class was generated from the following files: