LLDB  mainline
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
lldb_private::NativeProcessProtocol Class Referenceabstract

#include <NativeProcessProtocol.h>

Inheritance diagram for lldb_private::NativeProcessProtocol:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::NativeProcessProtocol:
Collaboration graph
[legend]

Classes

class  Factory
 
class  NativeDelegate
 
struct  SoftwareBreakpoint
 

Public Member Functions

virtual ~NativeProcessProtocol ()
 
virtual Status Resume (const ResumeActionList &resume_actions)=0
 
virtual Status Halt ()=0
 
virtual Status Detach ()=0
 
virtual Status Signal (int signo)=0
 Sends a process a UNIX signal signal. More...
 
virtual Status Interrupt ()
 Tells a process to interrupt all operations as if by a Ctrl-C. More...
 
virtual Status Kill ()=0
 
virtual Status IgnoreSignals (llvm::ArrayRef< int > signals)
 
virtual Status GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info)
 
virtual Status ReadMemory (lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read)=0
 
Status ReadMemoryWithoutTrap (lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read)
 
llvm::Expected< llvm::StringRef > ReadCStringFromMemory (lldb::addr_t addr, char *buffer, size_t max_size, size_t &total_bytes_read)
 Reads a null terminated string from memory. More...
 
virtual Status WriteMemory (lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written)=0
 
virtual Status AllocateMemory (size_t size, uint32_t permissions, lldb::addr_t &addr)=0
 
virtual Status DeallocateMemory (lldb::addr_t addr)=0
 
virtual lldb::addr_t GetSharedLibraryInfoAddress ()=0
 
virtual llvm::Expected< std::vector< SVR4LibraryInfo > > GetLoadedSVR4Libraries ()
 
virtual bool IsAlive () const
 
virtual size_t UpdateThreads ()=0
 
virtual const ArchSpecGetArchitecture () const =0
 
virtual Status SetBreakpoint (lldb::addr_t addr, uint32_t size, bool hardware)=0
 
virtual Status RemoveBreakpoint (lldb::addr_t addr, bool hardware=false)
 
virtual const HardwareBreakpointMapGetHardwareBreakpointMap () const
 
virtual Status SetHardwareBreakpoint (lldb::addr_t addr, size_t size)
 
virtual Status RemoveHardwareBreakpoint (lldb::addr_t addr)
 
virtual const NativeWatchpointList::WatchpointMapGetWatchpointMap () const
 
virtual llvm::Optional< std::pair< uint32_t, uint32_t > > GetHardwareDebugSupportInfo () const
 
virtual Status SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware)
 
virtual Status RemoveWatchpoint (lldb::addr_t addr)
 
lldb::pid_t GetID () const
 
lldb::StateType GetState () const
 
bool IsRunning () const
 
bool IsStepping () const
 
bool CanResume () const
 
lldb::ByteOrder GetByteOrder () const
 
uint32_t GetAddressByteSize () const
 
virtual llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > GetAuxvData () const =0
 
virtual llvm::Optional< WaitStatusGetExitStatus ()
 
virtual bool SetExitStatus (WaitStatus status, bool bNotifyStateChange)
 
NativeThreadProtocolGetThreadAtIndex (uint32_t idx)
 
NativeThreadProtocolGetThreadByID (lldb::tid_t tid)
 
void SetCurrentThreadID (lldb::tid_t tid)
 
lldb::tid_t GetCurrentThreadID ()
 
NativeThreadProtocolGetCurrentThread ()
 
virtual int GetTerminalFileDescriptor ()
 
uint32_t GetStopID () const
 
bool RegisterNativeDelegate (NativeDelegate &native_delegate)
 Register a native delegate. More...
 
bool UnregisterNativeDelegate (NativeDelegate &native_delegate)
 Unregister a native delegate previously registered. More...
 
virtual Status GetLoadedModuleFileSpec (const char *module_path, FileSpec &file_spec)=0
 
virtual Status GetFileLoadAddress (const llvm::StringRef &file_name, lldb::addr_t &load_addr)=0
 
virtual lldb::user_id_t StartTrace (const TraceOptions &config, Status &error)
 StartTracing API for starting a tracing instance with the TraceOptions on a specific thread or process. More...
 
virtual Status StopTrace (lldb::user_id_t traceid, lldb::tid_t thread=LLDB_INVALID_THREAD_ID)
 StopTracing API as the name suggests stops a tracing instance. More...
 
virtual Status GetData (lldb::user_id_t traceid, lldb::tid_t thread, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 This API provides the trace data collected in the form of raw data. More...
 
virtual Status GetMetaData (lldb::user_id_t traceid, lldb::tid_t thread, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 Similar API as above except it aims to provide any extra data useful for decoding the actual trace data. More...
 
virtual Status GetTraceConfig (lldb::user_id_t traceid, TraceOptions &config)
 API to query the TraceOptions for a given user id. More...
 

Protected Member Functions

 NativeProcessProtocol (lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate)
 
void SetID (lldb::pid_t pid)
 
void SetState (lldb::StateType state, bool notify_delegates=true)
 
virtual void DoStopIDBumped (uint32_t newBumpId)
 
Status SetSoftwareBreakpoint (lldb::addr_t addr, uint32_t size_hint)
 
Status RemoveSoftwareBreakpoint (lldb::addr_t addr)
 
virtual llvm::Expected< llvm::ArrayRef< uint8_t > > GetSoftwareBreakpointTrapOpcode (size_t size_hint)
 
virtual size_t GetSoftwareBreakpointPCOffset ()
 Return the offset of the PC relative to the software breakpoint that was hit. More...
 
void FixupBreakpointPCAsNeeded (NativeThreadProtocol &thread)
 
void NotifyDidExec ()
 Notify the delegate that an exec occurred. More...
 
NativeThreadProtocolGetThreadByIDUnlocked (lldb::tid_t tid)
 

Protected Attributes

std::unordered_map< lldb::addr_t, SoftwareBreakpointm_software_breakpoints
 
lldb::pid_t m_pid
 
std::vector< std::unique_ptr< NativeThreadProtocol > > m_threads
 
lldb::tid_t m_current_thread_id = LLDB_INVALID_THREAD_ID
 
std::recursive_mutex m_threads_mutex
 
lldb::StateType m_state = lldb::eStateInvalid
 
std::recursive_mutex m_state_mutex
 
llvm::Optional< WaitStatusm_exit_status
 
std::recursive_mutex m_delegates_mutex
 
std::vector< NativeDelegate * > m_delegates
 
NativeWatchpointList m_watchpoint_list
 
HardwareBreakpointMap m_hw_breakpoints_map
 
int m_terminal_fd
 
uint32_t m_stop_id = 0
 
llvm::DenseSet< int > m_signals_to_ignore
 

Private Member Functions

void SynchronouslyNotifyProcessStateChanged (lldb::StateType state)
 
llvm::Expected< SoftwareBreakpointEnableSoftwareBreakpoint (lldb::addr_t addr, uint32_t size_hint)
 

Detailed Description

Definition at line 44 of file NativeProcessProtocol.h.

Constructor & Destructor Documentation

◆ ~NativeProcessProtocol()

virtual lldb_private::NativeProcessProtocol::~NativeProcessProtocol ( )
inlinevirtual

Definition at line 46 of file NativeProcessProtocol.h.

References GetMemoryRegionInfo(), and ReadCStringFromMemory().

◆ NativeProcessProtocol()

NativeProcessProtocol::NativeProcessProtocol ( lldb::pid_t  pid,
int  terminal_fd,
NativeDelegate delegate 
)
protected

Definition at line 26 of file NativeProcessProtocol.cpp.

References RegisterNativeDelegate().

Member Function Documentation

◆ AllocateMemory()

virtual Status lldb_private::NativeProcessProtocol::AllocateMemory ( size_t  size,
uint32_t  permissions,
lldb::addr_t addr 
)
pure virtual

◆ CanResume()

bool lldb_private::NativeProcessProtocol::CanResume ( ) const
inline

Definition at line 169 of file NativeProcessProtocol.h.

References lldb::eStateStopped.

◆ DeallocateMemory()

virtual Status lldb_private::NativeProcessProtocol::DeallocateMemory ( lldb::addr_t  addr)
pure virtual

◆ Detach()

virtual Status lldb_private::NativeProcessProtocol::Detach ( )
pure virtual

◆ DoStopIDBumped()

void NativeProcessProtocol::DoStopIDBumped ( uint32_t  newBumpId)
protectedvirtual

◆ EnableSoftwareBreakpoint()

llvm::Expected< NativeProcessProtocol::SoftwareBreakpoint > NativeProcessProtocol::EnableSoftwareBreakpoint ( lldb::addr_t  addr,
uint32_t  size_hint 
)
private

◆ FixupBreakpointPCAsNeeded()

void NativeProcessProtocol::FixupBreakpointPCAsNeeded ( NativeThreadProtocol thread)
protected

◆ GetAddressByteSize()

uint32_t lldb_private::NativeProcessProtocol::GetAddressByteSize ( ) const
inline

◆ GetArchitecture()

virtual const ArchSpec& lldb_private::NativeProcessProtocol::GetArchitecture ( ) const
pure virtual

◆ GetAuxvData()

virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer> > lldb_private::NativeProcessProtocol::GetAuxvData ( ) const
pure virtual

◆ GetByteOrder()

lldb::ByteOrder lldb_private::NativeProcessProtocol::GetByteOrder ( ) const
inline

◆ GetCurrentThread()

NativeThreadProtocol* lldb_private::NativeProcessProtocol::GetCurrentThread ( )
inline

◆ GetCurrentThreadID()

lldb::tid_t lldb_private::NativeProcessProtocol::GetCurrentThreadID ( )
inline

Definition at line 194 of file NativeProcessProtocol.h.

◆ GetData()

virtual Status lldb_private::NativeProcessProtocol::GetData ( lldb::user_id_t  traceid,
lldb::tid_t  thread,
llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)
inlinevirtual

This API provides the trace data collected in the form of raw data.

Parameters
[in]traceidthread The traceid and thread provide the context for the trace instance.
[in]bufferThe buffer provides the destination buffer where the trace data would be read to. The buffer should be truncated to the filled length by this function.
[in]offsetThere is possibility to read partially the trace data from a specified offset where in such cases the buffer provided may be smaller than the internal trace collection container.
Returns
The size of the data actually read.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 363 of file NativeProcessProtocol.h.

References lldb_private::Status.

◆ GetExitStatus()

llvm::Optional< WaitStatus > NativeProcessProtocol::GetExitStatus ( )
virtual

◆ GetFileLoadAddress()

virtual Status lldb_private::NativeProcessProtocol::GetFileLoadAddress ( const llvm::StringRef &  file_name,
lldb::addr_t load_addr 
)
pure virtual

◆ GetHardwareBreakpointMap()

const HardwareBreakpointMap & NativeProcessProtocol::GetHardwareBreakpointMap ( ) const
virtual

◆ GetHardwareDebugSupportInfo()

llvm::Optional< std::pair< uint32_t, uint32_t > > NativeProcessProtocol::GetHardwareDebugSupportInfo ( ) const
virtual

◆ GetID()

lldb::pid_t lldb_private::NativeProcessProtocol::GetID ( ) const
inline

Definition at line 159 of file NativeProcessProtocol.h.

Referenced by lldb_private::process_netbsd::NativeProcessNetBSD::AddThread(), lldb_private::process_linux::NativeProcessLinux::AddThread(), lldb_private::NativeProcessWindows::CacheLoadedModules(), lldb_private::process_netbsd::NativeProcessNetBSD::Detach(), lldb_private::NativeProcessWindows::Detach(), lldb_private::process_linux::NativeProcessLinux::Detach(), FixupBreakpointPCAsNeeded(), lldb_private::process_netbsd::NativeProcessNetBSD::GetAuxvData(), lldb_private::process_linux::NativeProcessLinux::GetAuxvData(), lldb_private::NativeProcessWindows::GetFileLoadAddress(), GetJSONThreadsInfo(), lldb_private::process_linux::NativeProcessLinux::GetLoadedModuleFileSpec(), lldb_private::NativeProcessWindows::GetLoadedModuleFileSpec(), lldb_private::NativeThreadWindows::GetName(), lldb_private::process_netbsd::NativeThreadNetBSD::GetName(), lldb_private::process_linux::NativeThreadLinux::GetName(), lldb_private::process_netbsd::NativeRegisterContextNetBSD::GetProcessPid(), lldb_private::process_netbsd::NativeProcessNetBSD::Halt(), lldb_private::process_linux::NativeProcessLinux::Halt(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleInferiorState_Exited(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::InitializeDelegate(), lldb_private::process_netbsd::NativeProcessNetBSD::Interrupt(), lldb_private::process_linux::NativeProcessLinux::Interrupt(), lldb_private::process_netbsd::NativeProcessNetBSD::Kill(), lldb_private::process_linux::NativeProcessLinux::Kill(), lldb_private::process_linux::NativeThreadLinux::MaybeLogStateChange(), lldb_private::process_linux::NativeProcessLinux::MonitorCallback(), lldb_private::process_linux::NativeProcessLinux::MonitorSignal(), lldb_private::process_linux::NativeProcessLinux::MonitorSIGTRAP(), lldb_private::NativeProcessWindows::OnDebuggerConnected(), lldb_private::NativeProcessWindows::OnExitProcess(), lldb_private::process_netbsd::NativeProcessNetBSD::PopulateMemoryRegionCache(), lldb_private::process_linux::NativeProcessLinux::PopulateMemoryRegionCache(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::ProcessStateChanged(), lldb_private::process_netbsd::NativeProcessNetBSD::ReadMemory(), lldb_private::process_linux::NativeProcessLinux::ReadMemory(), lldb_private::process_netbsd::NativeProcessNetBSD::ReinitializeThreads(), lldb_private::process_netbsd::NativeProcessNetBSD::RemoveThread(), lldb_private::process_linux::NativeThreadLinux::RequestStop(), lldb_private::process_netbsd::NativeProcessNetBSD::Resume(), lldb_private::NativeProcessWindows::Resume(), lldb_private::process_linux::NativeProcessLinux::Resume(), lldb_private::process_netbsd::NativeThreadNetBSD::Resume(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendWResponse(), SetHardwareBreakpoint(), SetWatchpoint(), lldb_private::process_netbsd::NativeProcessNetBSD::SigchldHandler(), lldb_private::process_linux::NativeProcessLinux::SigchldHandler(), lldb_private::process_netbsd::NativeProcessNetBSD::Signal(), lldb_private::process_linux::NativeProcessLinux::Signal(), lldb_private::process_netbsd::NativeThreadNetBSD::SingleStep(), lldb_private::process_linux::NativeProcessLinux::StartTrace(), lldb_private::process_linux::NativeProcessLinux::StartTraceGroup(), lldb_private::process_netbsd::NativeThreadNetBSD::Suspend(), SynchronouslyNotifyProcessStateChanged(), lldb_private::process_linux::NativeProcessLinux::WaitForNewThread(), lldb_private::process_netbsd::NativeProcessNetBSD::WriteMemory(), and lldb_private::process_linux::NativeProcessLinux::WriteMemory().

◆ GetLoadedModuleFileSpec()

virtual Status lldb_private::NativeProcessProtocol::GetLoadedModuleFileSpec ( const char *  module_path,
FileSpec file_spec 
)
pure virtual

◆ GetLoadedSVR4Libraries()

virtual llvm::Expected<std::vector<SVR4LibraryInfo> > lldb_private::NativeProcessProtocol::GetLoadedSVR4Libraries ( )
inlinevirtual

Reimplemented in lldb_private::NativeProcessELF.

Definition at line 123 of file NativeProcessProtocol.h.

◆ GetMemoryRegionInfo()

lldb_private::Status NativeProcessProtocol::GetMemoryRegionInfo ( lldb::addr_t  load_addr,
MemoryRegionInfo range_info 
)
virtual

◆ GetMetaData()

virtual Status lldb_private::NativeProcessProtocol::GetMetaData ( lldb::user_id_t  traceid,
lldb::tid_t  thread,
llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)
inlinevirtual

Similar API as above except it aims to provide any extra data useful for decoding the actual trace data.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 371 of file NativeProcessProtocol.h.

References lldb_private::Status.

◆ GetSharedLibraryInfoAddress()

virtual lldb::addr_t lldb_private::NativeProcessProtocol::GetSharedLibraryInfoAddress ( )
pure virtual

◆ GetSoftwareBreakpointPCOffset()

size_t NativeProcessProtocol::GetSoftwareBreakpointPCOffset ( )
protectedvirtual

Return the offset of the PC relative to the software breakpoint that was hit.

If an architecture (e.g. arm) reports breakpoint hits before incrementing the PC, this offset will be 0. If an architecture (e.g. intel) reports breakpoints hits after incrementing the PC, this offset will be the size of the breakpoint opcode.

Definition at line 557 of file NativeProcessProtocol.cpp.

References GetArchitecture(), and GetSoftwareBreakpointTrapOpcode().

Referenced by FixupBreakpointPCAsNeeded().

◆ GetSoftwareBreakpointTrapOpcode()

llvm::Expected< llvm::ArrayRef< uint8_t > > NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode ( size_t  size_hint)
protectedvirtual

◆ GetState()

lldb::StateType NativeProcessProtocol::GetState ( ) const

◆ GetStopID()

uint32_t NativeProcessProtocol::GetStopID ( ) const

Definition at line 748 of file NativeProcessProtocol.cpp.

References m_state_mutex, and m_stop_id.

◆ GetTerminalFileDescriptor()

virtual int lldb_private::NativeProcessProtocol::GetTerminalFileDescriptor ( )
inlinevirtual

Definition at line 201 of file NativeProcessProtocol.h.

◆ GetThreadAtIndex()

NativeThreadProtocol * NativeProcessProtocol::GetThreadAtIndex ( uint32_t  idx)

Definition at line 87 of file NativeProcessProtocol.cpp.

References m_threads, and m_threads_mutex.

Referenced by GetHardwareDebugSupportInfo(), and GetJSONThreadsInfo().

◆ GetThreadByID()

NativeThreadProtocol * NativeProcessProtocol::GetThreadByID ( lldb::tid_t  tid)

◆ GetThreadByIDUnlocked()

NativeThreadProtocol * NativeProcessProtocol::GetThreadByIDUnlocked ( lldb::tid_t  tid)
protected

Definition at line 95 of file NativeProcessProtocol.cpp.

References m_threads.

Referenced by GetThreadByID().

◆ GetTraceConfig()

virtual Status lldb_private::NativeProcessProtocol::GetTraceConfig ( lldb::user_id_t  traceid,
TraceOptions config 
)
inlinevirtual

API to query the TraceOptions for a given user id.

Parameters
[in]traceidThe user id of the tracing instance.
[out]configThe configuration being used for tracing.
Returns
A status indicating what went wrong.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 386 of file NativeProcessProtocol.h.

References lldb_private::Status.

◆ GetWatchpointMap()

const NativeWatchpointList::WatchpointMap & NativeProcessProtocol::GetWatchpointMap ( ) const
virtual

◆ Halt()

virtual Status lldb_private::NativeProcessProtocol::Halt ( )
pure virtual

◆ IgnoreSignals()

Status NativeProcessProtocol::IgnoreSignals ( llvm::ArrayRef< int >  signals)
virtual

Reimplemented in lldb_private::NativeProcessWindows.

Definition at line 44 of file NativeProcessProtocol.cpp.

References m_signals_to_ignore, and lldb_private::Status.

◆ Interrupt()

lldb_private::Status NativeProcessProtocol::Interrupt ( )
virtual

Tells a process to interrupt all operations as if by a Ctrl-C.

The default implementation will send a local host's equivalent of a SIGSTOP to the process via the NativeProcessProtocol::Signal() operation.

Returns
Returns an error object.

Reimplemented in lldb_private::process_linux::NativeProcessLinux, lldb_private::NativeProcessWindows, and lldb_private::process_netbsd::NativeProcessNetBSD.

Definition at line 34 of file NativeProcessProtocol.cpp.

References error(), lldb_private::Status::SetErrorString(), Signal(), and SIGSTOP.

◆ IsAlive()

bool NativeProcessProtocol::IsAlive ( ) const
virtual

◆ IsRunning()

bool lldb_private::NativeProcessProtocol::IsRunning ( ) const
inline

Definition at line 163 of file NativeProcessProtocol.h.

References lldb::eStateRunning.

◆ IsStepping()

bool lldb_private::NativeProcessProtocol::IsStepping ( ) const
inline

Definition at line 167 of file NativeProcessProtocol.h.

References lldb::eStateStepping.

◆ Kill()

virtual Status lldb_private::NativeProcessProtocol::Kill ( )
pure virtual

◆ NotifyDidExec()

void NativeProcessProtocol::NotifyDidExec ( )
protected

Notify the delegate that an exec occurred.

Provide a mechanism for a delegate to clear out any exec- sensitive data.

Definition at line 347 of file NativeProcessProtocol.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, LLDB_LOGF, m_delegates, and m_delegates_mutex.

Referenced by lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGTRAP(), and lldb_private::process_linux::NativeProcessLinux::MonitorSIGTRAP().

◆ ReadCStringFromMemory()

llvm::Expected< llvm::StringRef > NativeProcessProtocol::ReadCStringFromMemory ( lldb::addr_t  addr,
char *  buffer,
size_t  max_size,
size_t &  total_bytes_read 
)

Reads a null terminated string from memory.

Reads up to max_size bytes of memory until it finds a '\0'. If a '\0' is not found then it reads max_size-1 bytes as a string and a '\0' is added as the last character of the buffer.

Parameters
[in]addrThe address in memory to read from.
[in]bufferAn allocated buffer with at least max_size size.
[in]max_sizeThe maximum number of bytes to read from memory until it reads the string.
[out]total_bytes_readThe number of bytes read from memory into buffer.
Returns
Returns a StringRef backed up by the buffer passed in.

Definition at line 668 of file NativeProcessProtocol.cpp.

References ReadMemory(), lldb_private::Status::Success(), and lldb_private::Status::ToError().

Referenced by lldb_private::NativeProcessELF::ReadSVR4LibraryInfo().

◆ ReadMemory()

virtual Status lldb_private::NativeProcessProtocol::ReadMemory ( lldb::addr_t  addr,
void *  buf,
size_t  size,
size_t &  bytes_read 
)
pure virtual

◆ ReadMemoryWithoutTrap()

Status NativeProcessProtocol::ReadMemoryWithoutTrap ( lldb::addr_t  addr,
void *  buf,
size_t  size,
size_t &  bytes_read 
)

◆ RegisterNativeDelegate()

bool NativeProcessProtocol::RegisterNativeDelegate ( NativeDelegate native_delegate)

Register a native delegate.

Clients can register nofication callbacks by passing in a NativeDelegate impl and passing it into this function.

Note: it is required that the lifetime of the native_delegate outlive the NativeProcessProtocol.

Parameters
[in]native_delegateA NativeDelegate impl to be called when certain events happen within the NativeProcessProtocol or related threads.
Returns
true if the delegate was registered successfully; false if the delegate was already registered.
See also
NativeProcessProtocol::NativeDelegate.

Definition at line 298 of file NativeProcessProtocol.cpp.

References lldb_private::NativeProcessProtocol::NativeDelegate::InitializeDelegate(), m_delegates, and m_delegates_mutex.

Referenced by NativeProcessProtocol().

◆ RemoveBreakpoint()

Status NativeProcessProtocol::RemoveBreakpoint ( lldb::addr_t  addr,
bool  hardware = false 
)
virtual

◆ RemoveHardwareBreakpoint()

Status NativeProcessProtocol::RemoveHardwareBreakpoint ( lldb::addr_t  addr)
virtual

◆ RemoveSoftwareBreakpoint()

Status NativeProcessProtocol::RemoveSoftwareBreakpoint ( lldb::addr_t  addr)
protected

◆ RemoveWatchpoint()

Status NativeProcessProtocol::RemoveWatchpoint ( lldb::addr_t  addr)
virtual

◆ Resume()

virtual Status lldb_private::NativeProcessProtocol::Resume ( const ResumeActionList resume_actions)
pure virtual

◆ SetBreakpoint()

virtual Status lldb_private::NativeProcessProtocol::SetBreakpoint ( lldb::addr_t  addr,
uint32_t  size,
bool  hardware 
)
pure virtual

◆ SetCurrentThreadID()

void lldb_private::NativeProcessProtocol::SetCurrentThreadID ( lldb::tid_t  tid)
inline

◆ SetExitStatus()

bool NativeProcessProtocol::SetExitStatus ( WaitStatus  status,
bool  bNotifyStateChange 
)
virtual

◆ SetHardwareBreakpoint()

Status NativeProcessProtocol::SetHardwareBreakpoint ( lldb::addr_t  addr,
size_t  size 
)
virtual

◆ SetID()

void lldb_private::NativeProcessProtocol::SetID ( lldb::pid_t  pid)
inlineprotected

◆ SetSoftwareBreakpoint()

Status NativeProcessProtocol::SetSoftwareBreakpoint ( lldb::addr_t  addr,
uint32_t  size_hint 
)
protected

◆ SetState()

void NativeProcessProtocol::SetState ( lldb::StateType  state,
bool  notify_delegates = true 
)
protected

◆ SetWatchpoint()

Status NativeProcessProtocol::SetWatchpoint ( lldb::addr_t  addr,
size_t  size,
uint32_t  watch_flags,
bool  hardware 
)
virtual

◆ Signal()

virtual Status lldb_private::NativeProcessProtocol::Signal ( int  signo)
pure virtual

Sends a process a UNIX signal signal.

Returns
Returns an error object.

Implemented in lldb_private::process_linux::NativeProcessLinux, lldb_private::NativeProcessWindows, and lldb_private::process_netbsd::NativeProcessNetBSD.

Referenced by Interrupt().

◆ StartTrace()

virtual lldb::user_id_t lldb_private::NativeProcessProtocol::StartTrace ( const TraceOptions config,
Status error 
)
inlinevirtual

StartTracing API for starting a tracing instance with the TraceOptions on a specific thread or process.

Parameters
[in]configThe configuration to use when starting tracing.
[out]errorStatus indicates what went wrong.
Returns
The API returns a user_id which can be used to get trace data, trace configuration or stopping the trace instance. The user_id is a key to identify and operate with a tracing instance. It may refer to the complete process or a single thread.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 319 of file NativeProcessProtocol.h.

References LLDB_INVALID_UID, and lldb_private::Status::SetErrorString().

Referenced by lldb_private::process_linux::NativeProcessLinux::StartTrace().

◆ StopTrace()

virtual Status lldb_private::NativeProcessProtocol::StopTrace ( lldb::user_id_t  traceid,
lldb::tid_t  thread = LLDB_INVALID_THREAD_ID 
)
inlinevirtual

StopTracing API as the name suggests stops a tracing instance.

Parameters
[in]traceidThe user id of the trace intended to be stopped. Now a user_id may map to multiple threads in which case this API could be used to stop the tracing for a specific thread by supplying its thread id.
[in]threadThread is needed when the complete process is being traced and the user wishes to stop tracing on a particular thread.
Returns
Status indicating what went wrong.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 339 of file NativeProcessProtocol.h.

References lldb_private::Status.

◆ SynchronouslyNotifyProcessStateChanged()

void NativeProcessProtocol::SynchronouslyNotifyProcessStateChanged ( lldb::StateType  state)
private

◆ UnregisterNativeDelegate()

bool NativeProcessProtocol::UnregisterNativeDelegate ( NativeDelegate native_delegate)

Unregister a native delegate previously registered.

Parameters
[in]native_delegateA NativeDelegate impl previously registered with this process.
Returns
Returns true if the NativeDelegate was successfully removed from the process, false otherwise.
See also
NativeProcessProtocol::NativeDelegate

Definition at line 310 of file NativeProcessProtocol.cpp.

References m_delegates, and m_delegates_mutex.

◆ UpdateThreads()

virtual size_t lldb_private::NativeProcessProtocol::UpdateThreads ( )
pure virtual

◆ WriteMemory()

virtual Status lldb_private::NativeProcessProtocol::WriteMemory ( lldb::addr_t  addr,
const void *  buf,
size_t  size,
size_t &  bytes_written 
)
pure virtual

Member Data Documentation

◆ m_current_thread_id

lldb::tid_t lldb_private::NativeProcessProtocol::m_current_thread_id = LLDB_INVALID_THREAD_ID
protected

Definition at line 401 of file NativeProcessProtocol.h.

◆ m_delegates

std::vector<NativeDelegate *> lldb_private::NativeProcessProtocol::m_delegates
protected

◆ m_delegates_mutex

std::recursive_mutex lldb_private::NativeProcessProtocol::m_delegates_mutex
protected

◆ m_exit_status

llvm::Optional<WaitStatus> lldb_private::NativeProcessProtocol::m_exit_status
protected

Definition at line 407 of file NativeProcessProtocol.h.

Referenced by GetExitStatus(), and SetExitStatus().

◆ m_hw_breakpoints_map

HardwareBreakpointMap lldb_private::NativeProcessProtocol::m_hw_breakpoints_map
protected

◆ m_pid

lldb::pid_t lldb_private::NativeProcessProtocol::m_pid
protected

◆ m_signals_to_ignore

llvm::DenseSet<int> lldb_private::NativeProcessProtocol::m_signals_to_ignore
protected

◆ m_software_breakpoints

std::unordered_map<lldb::addr_t, SoftwareBreakpoint> lldb_private::NativeProcessProtocol::m_software_breakpoints
protected

◆ m_state

lldb::StateType lldb_private::NativeProcessProtocol::m_state = lldb::eStateInvalid
protected

◆ m_state_mutex

std::recursive_mutex lldb_private::NativeProcessProtocol::m_state_mutex
mutableprotected

Definition at line 405 of file NativeProcessProtocol.h.

Referenced by GetState(), GetStopID(), and SetState().

◆ m_stop_id

uint32_t lldb_private::NativeProcessProtocol::m_stop_id = 0
protected

Definition at line 414 of file NativeProcessProtocol.h.

Referenced by GetStopID(), and SetState().

◆ m_terminal_fd

int lldb_private::NativeProcessProtocol::m_terminal_fd
protected

◆ m_threads

std::vector<std::unique_ptr<NativeThreadProtocol> > lldb_private::NativeProcessProtocol::m_threads
protected

Definition at line 400 of file NativeProcessProtocol.h.

Referenced by lldb_private::process_netbsd::NativeProcessNetBSD::AddThread(), lldb_private::process_linux::NativeProcessLinux::AddThread(), lldb_private::process_netbsd::NativeProcessNetBSD::Attach(), lldb_private::process_linux::NativeProcessLinux::Detach(), GetThreadAtIndex(), GetThreadByIDUnlocked(), lldb_private::process_netbsd::NativeProcessNetBSD::HasThreadNoLock(), lldb_private::process_linux::NativeProcessLinux::HasThreadNoLock(), lldb_private::process_linux::NativeProcessLinux::Interrupt(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorExited(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSignal(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGSTOP(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGTRAP(), lldb_private::process_linux::NativeProcessLinux::MonitorSIGTRAP(), lldb_private::NativeProcessWindows::OnCreateThread(), lldb_private::NativeProcessWindows::OnDebuggerConnected(), lldb_private::NativeProcessWindows::OnExitThread(), lldb_private::process_netbsd::NativeProcessNetBSD::ReinitializeThreads(), RemoveHardwareBreakpoint(), lldb_private::process_netbsd::NativeProcessNetBSD::RemoveThread(), RemoveWatchpoint(), lldb_private::process_netbsd::NativeProcessNetBSD::Resume(), lldb_private::NativeProcessWindows::Resume(), lldb_private::process_linux::NativeProcessLinux::Resume(), SetHardwareBreakpoint(), SetWatchpoint(), lldb_private::process_linux::NativeProcessLinux::SignalIfAllThreadsStopped(), lldb_private::process_linux::NativeProcessLinux::StartTraceGroup(), lldb_private::process_linux::NativeProcessLinux::StopRunningThreads(), lldb_private::NativeProcessWindows::StopThread(), lldb_private::process_linux::NativeProcessLinux::StopTrackingThread(), lldb_private::process_netbsd::NativeProcessNetBSD::UpdateThreads(), lldb_private::NativeProcessWindows::UpdateThreads(), and lldb_private::process_linux::NativeProcessLinux::UpdateThreads().

◆ m_threads_mutex

std::recursive_mutex lldb_private::NativeProcessProtocol::m_threads_mutex
mutableprotected

◆ m_watchpoint_list

NativeWatchpointList lldb_private::NativeProcessProtocol::m_watchpoint_list
protected

Definition at line 411 of file NativeProcessProtocol.h.

Referenced by GetWatchpointMap(), RemoveWatchpoint(), and SetWatchpoint().


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