LLDB mainline
lldb_private::NativeProcessProtocol Class Referenceabstract

#include <NativeProcessProtocol.h>

Inheritance diagram for lldb_private::NativeProcessProtocol:
[legend]

Classes

class  Manager
class  NativeDelegate
struct  SoftwareBreakpoint

Public Types

enum class  Extension {
  multiprocess = (1u << 0) , fork = (1u << 1) , vfork = (1u << 2) , pass_signals = (1u << 3) ,
  auxv = (1u << 4) , libraries_svr4 = (1u << 5) , memory_tagging = (1u << 6) , savecore = (1u << 7) ,
  siginfo_read = (1u << 8)
}
 Extension flag constants, returned by Manager::GetSupportedExtensions() and passed to SetEnabledExtension() More...
typedef std::vector< std::unique_ptr< NativeThreadProtocol > > thread_collection
typedef LockingAdaptedIterable< std::recursive_mutex, thread_collection, llvm::pointee_iterator< thread_collection::const_iterator > > ThreadIterable

Public Member Functions

virtual ~NativeProcessProtocol ()=default
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.
virtual Status Interrupt ()
 Tells a process to interrupt all operations as if by a Ctrl-C.
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)
virtual Status ReadMemoryTags (int32_t type, lldb::addr_t addr, size_t len, std::vector< uint8_t > &tags)
virtual Status WriteMemoryTags (int32_t type, lldb::addr_t addr, size_t len, const std::vector< uint8_t > &tags)
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.
virtual Status WriteMemory (lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written)=0
virtual llvm::Expected< lldb::addr_tAllocateMemory (size_t size, uint32_t permissions)
virtual llvm::Error DeallocateMemory (lldb::addr_t addr)
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 std::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 std::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 () const
NativeThreadProtocolGetCurrentThread ()
ThreadIterable Threads () const
virtual int GetTerminalFileDescriptor ()
uint32_t GetStopID () const
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 void NotifyTracersProcessWillResume ()
 Notify tracers that the target process will resume.
virtual void NotifyTracersProcessDidStop ()
 Notify tracers that the target process just stopped.
virtual llvm::Error TraceStart (llvm::StringRef json_params, llvm::StringRef type)
 Start tracing a process or its threads.
virtual llvm::Error TraceStop (const TraceStopRequest &request)
 Stop tracing a live process or its threads.
virtual llvm::Expected< llvm::json::Value > TraceGetState (llvm::StringRef type)
 Get the current tracing state of the process and its threads.
virtual llvm::Expected< std::vector< uint8_t > > TraceGetBinaryData (const TraceGetBinaryDataRequest &request)
 Get binary data given a trace technology and a data identifier.
virtual llvm::Expected< TraceSupportedResponseTraceSupported ()
 Get the processor tracing type supported for this process.
virtual void SetEnabledExtensions (Extension flags)
 Method called in order to propagate the bitmap of protocol extensions supported by the client.
virtual llvm::Expected< std::string > SaveCore (llvm::StringRef path_hint)
 Write a core dump (without crashing the program).
virtual std::vector< std::string > GetStructuredDataPlugins ()
 Get the list of structured data plugins supported by this process.

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.
void FixupBreakpointPCAsNeeded (NativeThreadProtocol &thread)
virtual void NotifyDidExec ()
 Notify the delegate that an exec occurred.
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
std::optional< WaitStatusm_exit_status
NativeDelegatem_delegate
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
Extension m_enabled_extensions

Private Member Functions

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

Detailed Description

Definition at line 49 of file NativeProcessProtocol.h.

Member Typedef Documentation

◆ thread_collection

Definition at line 53 of file NativeProcessProtocol.h.

◆ ThreadIterable

typedef LockingAdaptedIterable< std::recursive_mutex, thread_collection, llvm::pointee_iterator<thread_collection::const_iterator> > lldb_private::NativeProcessProtocol::ThreadIterable

Definition at line 57 of file NativeProcessProtocol.h.

Member Enumeration Documentation

◆ Extension

Extension flag constants, returned by Manager::GetSupportedExtensions() and passed to SetEnabledExtension()

Enumerator
multiprocess 
fork 
vfork 
pass_signals 
auxv 
libraries_svr4 
memory_tagging 
savecore 
siginfo_read 

Definition at line 257 of file NativeProcessProtocol.h.

Constructor & Destructor Documentation

◆ ~NativeProcessProtocol()

virtual lldb_private::NativeProcessProtocol::~NativeProcessProtocol ( )
virtualdefault

◆ NativeProcessProtocol()

Member Function Documentation

◆ AllocateMemory()

virtual llvm::Expected< lldb::addr_t > lldb_private::NativeProcessProtocol::AllocateMemory ( size_t size,
uint32_t permissions )
inlinevirtual

◆ CanResume()

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

◆ DeallocateMemory()

virtual llvm::Error lldb_private::NativeProcessProtocol::DeallocateMemory ( lldb::addr_t addr)
inlinevirtual

◆ Detach()

◆ DoStopIDBumped()

void NativeProcessProtocol::DoStopIDBumped ( uint32_t newBumpId)
protectedvirtual

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 771 of file NativeProcessProtocol.cpp.

Referenced by SetState().

◆ EnableSoftwareBreakpoint()

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

◆ FixupBreakpointPCAsNeeded()

◆ GetAddressByteSize()

◆ GetArchitecture()

◆ GetAuxvData()

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

◆ GetByteOrder()

◆ GetCurrentThread()

◆ GetCurrentThreadID()

◆ GetExitStatus()

std::optional< WaitStatus > NativeProcessProtocol::GetExitStatus ( )
virtual

◆ GetFileLoadAddress()

◆ GetHardwareBreakpointMap()

const HardwareBreakpointMap & NativeProcessProtocol::GetHardwareBreakpointMap ( ) const
virtual

◆ GetHardwareDebugSupportInfo()

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

◆ GetID()

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

Definition at line 180 of file NativeProcessProtocol.h.

References m_pid.

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::AddProcessThreads(), lldb_private::process_freebsd::NativeProcessFreeBSD::AddThread(), lldb_private::process_linux::NativeProcessLinux::AddThread(), lldb_private::process_netbsd::NativeProcessNetBSD::AddThread(), lldb_private::NativeProcessWindows::CacheLoadedModules(), lldb_private::NativeProcessWindows::Detach(), lldb_private::process_freebsd::NativeProcessFreeBSD::Detach(), lldb_private::process_linux::NativeProcessLinux::Detach(), lldb_private::process_netbsd::NativeProcessNetBSD::Detach(), FixupBreakpointPCAsNeeded(), lldb_private::process_aix::NativeProcessAIX::GetAuxvData(), lldb_private::process_freebsd::NativeProcessFreeBSD::GetAuxvData(), lldb_private::process_linux::NativeProcessLinux::GetAuxvData(), lldb_private::process_netbsd::NativeProcessNetBSD::GetAuxvData(), lldb_private::NativeProcessWindows::GetFileLoadAddress(), GetJSONThreadsInfo(), lldb_private::NativeProcessWindows::GetLoadedModuleFileSpec(), lldb_private::process_linux::NativeProcessLinux::GetLoadedModuleFileSpec(), lldb_private::NativeThreadWindows::GetName(), lldb_private::process_freebsd::NativeThreadFreeBSD::GetName(), lldb_private::process_linux::NativeThreadLinux::GetName(), lldb_private::process_freebsd::NativeRegisterContextFreeBSD::GetProcessPid(), lldb_private::process_netbsd::NativeRegisterContextNetBSD::GetProcessPid(), lldb_private::process_freebsd::NativeProcessFreeBSD::Halt(), lldb_private::process_linux::NativeProcessLinux::Halt(), lldb_private::process_netbsd::NativeProcessNetBSD::Halt(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_H(), 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_linux::NativeProcessLinux::Interrupt(), lldb_private::process_netbsd::NativeProcessNetBSD::Interrupt(), lldb_private::process_freebsd::NativeProcessFreeBSD::Kill(), lldb_private::process_linux::NativeProcessLinux::Kill(), lldb_private::process_netbsd::NativeProcessNetBSD::Kill(), lldb_private::process_linux::NativeProcessLinux::MonitorCallback(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorClone(), lldb_private::process_linux::NativeProcessLinux::MonitorClone(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorClone(), lldb_private::process_linux::NativeProcessLinux::MonitorSignal(), lldb_private::process_linux::NativeProcessLinux::MonitorSIGTRAP(), NotifyDidExec(), lldb_private::NativeProcessWindows::OnDebuggerConnected(), lldb_private::NativeProcessWindows::OnExitProcess(), lldb_private::process_freebsd::NativeProcessFreeBSD::PopulateMemoryRegionCache(), lldb_private::process_linux::NativeProcessLinux::PopulateMemoryRegionCache(), lldb_private::process_netbsd::NativeProcessNetBSD::PopulateMemoryRegionCache(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::PrepareStopReplyPacketForThread(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::ProcessStateChanged(), lldb_private::process_freebsd::NativeProcessFreeBSD::ReadMemory(), lldb_private::process_netbsd::NativeProcessNetBSD::ReadMemory(), lldb_private::process_freebsd::NativeProcessFreeBSD::ReinitializeThreads(), lldb_private::process_netbsd::NativeProcessNetBSD::ReinitializeThreads(), lldb_private::process_freebsd::NativeProcessFreeBSD::RemoveThread(), lldb_private::process_netbsd::NativeProcessNetBSD::RemoveThread(), lldb_private::process_linux::NativeThreadLinux::RequestStop(), lldb_private::NativeProcessWindows::Resume(), lldb_private::process_freebsd::NativeProcessFreeBSD::Resume(), lldb_private::process_linux::NativeProcessLinux::Resume(), lldb_private::process_netbsd::NativeProcessNetBSD::Resume(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::ResumeProcess(), lldb_private::process_freebsd::NativeProcessFreeBSD::SaveCore(), lldb_private::process_netbsd::NativeProcessNetBSD::SaveCore(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendStopReasonForState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SendWResponse(), SetHardwareBreakpoint(), lldb_private::process_freebsd::NativeProcessFreeBSD::SetupTrace(), lldb_private::process_netbsd::NativeProcessNetBSD::SetupTrace(), SetWatchpoint(), lldb_private::process_freebsd::NativeProcessFreeBSD::SigchldHandler(), lldb_private::process_netbsd::NativeProcessNetBSD::SigchldHandler(), lldb_private::process_freebsd::NativeProcessFreeBSD::Signal(), lldb_private::process_linux::NativeProcessLinux::Signal(), lldb_private::process_netbsd::NativeProcessNetBSD::Signal(), SynchronouslyNotifyProcessStateChanged(), lldb_private::process_linux::NativeProcessLinux::TryHandleWaitStatus(), lldb_private::process_freebsd::NativeProcessFreeBSD::WriteMemory(), and lldb_private::process_netbsd::NativeProcessNetBSD::WriteMemory().

◆ GetLoadedModuleFileSpec()

◆ GetLoadedSVR4Libraries()

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

Reimplemented in lldb_private::NativeProcessELF.

Definition at line 144 of file NativeProcessProtocol.h.

◆ GetMemoryRegionInfo()

◆ 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.

Reimplemented in lldb_private::NativeProcessWindows.

Definition at line 570 of file NativeProcessProtocol.cpp.

References GetArchitecture(), and GetSoftwareBreakpointTrapOpcode().

Referenced by FixupBreakpointPCAsNeeded().

◆ GetSoftwareBreakpointTrapOpcode()

◆ GetState()

◆ GetStopID()

uint32_t NativeProcessProtocol::GetStopID ( ) const

Definition at line 766 of file NativeProcessProtocol.cpp.

References m_state_mutex, and m_stop_id.

◆ GetStructuredDataPlugins()

virtual std::vector< std::string > lldb_private::NativeProcessProtocol::GetStructuredDataPlugins ( )
inlinevirtual

Get the list of structured data plugins supported by this process.

They must match the type field used by the corresponding StructuredDataPlugins in the client.

Returns
A vector of structured data plugin names.

Definition at line 418 of file NativeProcessProtocol.h.

◆ GetTerminalFileDescriptor()

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

Definition at line 226 of file NativeProcessProtocol.h.

References m_terminal_fd.

◆ GetThreadAtIndex()

NativeThreadProtocol * NativeProcessProtocol::GetThreadAtIndex ( uint32_t idx)

Definition at line 100 of file NativeProcessProtocol.cpp.

References m_threads, and m_threads_mutex.

Referenced by GetHardwareDebugSupportInfo().

◆ GetThreadByID()

◆ GetThreadByIDUnlocked()

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

Definition at line 108 of file NativeProcessProtocol.cpp.

References m_threads.

Referenced by GetThreadByID().

◆ GetWatchpointMap()

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

◆ Halt()

◆ 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::NativeProcessWindows, lldb_private::process_aix::NativeProcessAIX, lldb_private::process_freebsd::NativeProcessFreeBSD, lldb_private::process_linux::NativeProcessLinux, and lldb_private::process_netbsd::NativeProcessNetBSD.

Definition at line 34 of file NativeProcessProtocol.cpp.

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

◆ IsAlive()

bool NativeProcessProtocol::IsAlive ( ) const
virtual

◆ IsRunning()

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

Definition at line 184 of file NativeProcessProtocol.h.

References lldb::eStateRunning, IsStepping(), and m_state.

◆ IsStepping()

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

Definition at line 188 of file NativeProcessProtocol.h.

References lldb::eStateStepping, and m_state.

Referenced by IsRunning().

◆ Kill()

◆ NotifyDidExec()

void NativeProcessProtocol::NotifyDidExec ( )
protectedvirtual

Notify the delegate that an exec occurred.

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

Reimplemented in lldb_private::NativeProcessELF.

Definition at line 332 of file NativeProcessProtocol.cpp.

References GetID(), lldb_private::GetLog(), LLDB_LOG, m_delegate, m_software_breakpoints, and lldb_private::Process.

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

◆ NotifyTracersProcessDidStop()

virtual void lldb_private::NativeProcessProtocol::NotifyTracersProcessDidStop ( )
inlinevirtual

Notify tracers that the target process just stopped.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 336 of file NativeProcessProtocol.h.

Referenced by SynchronouslyNotifyProcessStateChanged().

◆ NotifyTracersProcessWillResume()

virtual void lldb_private::NativeProcessProtocol::NotifyTracersProcessWillResume ( )
inlinevirtual

Notify tracers that the target process will resume.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 333 of file NativeProcessProtocol.h.

◆ 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 686 of file NativeProcessProtocol.cpp.

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

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

◆ ReadMemory()

◆ ReadMemoryTags()

lldb_private::Status NativeProcessProtocol::ReadMemoryTags ( int32_t type,
lldb::addr_t addr,
size_t len,
std::vector< uint8_t > & tags )
virtual

◆ ReadMemoryWithoutTrap()

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

◆ RemoveBreakpoint()

◆ RemoveHardwareBreakpoint()

◆ RemoveSoftwareBreakpoint()

◆ RemoveWatchpoint()

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

◆ Resume()

◆ SaveCore()

virtual llvm::Expected< std::string > lldb_private::NativeProcessProtocol::SaveCore ( llvm::StringRef path_hint)
inlinevirtual

Write a core dump (without crashing the program).

Parameters
[in]path_hintSuggested core dump path (optional, can be empty).
Returns
Path to the core dump if successfully written, an error otherwise.

Reimplemented in lldb_private::process_freebsd::NativeProcessFreeBSD, and lldb_private::process_netbsd::NativeProcessNetBSD.

Definition at line 407 of file NativeProcessProtocol.h.

◆ SetBreakpoint()

◆ SetCurrentThreadID()

◆ SetEnabledExtensions()

virtual void lldb_private::NativeProcessProtocol::SetEnabledExtensions ( Extension flags)
inlinevirtual

Method called in order to propagate the bitmap of protocol extensions supported by the client.

Parameters
[in]flagsThe bitmap of enabled extensions.

Definition at line 395 of file NativeProcessProtocol.h.

References m_enabled_extensions.

Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::SetEnabledExtensions().

◆ SetExitStatus()

◆ SetHardwareBreakpoint()

◆ SetID()

◆ SetSoftwareBreakpoint()

◆ SetState()

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

Definition at line 742 of file NativeProcessProtocol.cpp.

References DoStopIDBumped(), m_state, m_state_mutex, m_stop_id, lldb_private::StateIsStoppedState(), and SynchronouslyNotifyProcessStateChanged().

Referenced by lldb_private::process_freebsd::NativeProcessFreeBSD::Attach(), lldb_private::process_netbsd::NativeProcessNetBSD::Attach(), lldb_private::NativeProcessWindows::Detach(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorClone(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorClone(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorExited(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorExited(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSignal(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSignal(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSIGSTOP(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGSTOP(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSIGTRAP(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGTRAP(), lldb_private::process_aix::NativeProcessAIX::NativeProcessAIX(), lldb_private::process_linux::NativeProcessLinux::NativeProcessLinux(), lldb_private::NativeProcessWindows::OnDebugException(), lldb_private::NativeProcessWindows::OnExitProcess(), lldb_private::NativeProcessWindows::Resume(), lldb_private::process_freebsd::NativeProcessFreeBSD::Resume(), lldb_private::process_netbsd::NativeProcessNetBSD::Resume(), lldb_private::process_linux::NativeProcessLinux::ResumeThread(), and lldb_private::process_linux::NativeProcessLinux::SignalIfAllThreadsStopped().

◆ 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

◆ SynchronouslyNotifyProcessStateChanged()

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

◆ Threads()

◆ TraceGetBinaryData()

virtual llvm::Expected< std::vector< uint8_t > > lldb_private::NativeProcessProtocol::TraceGetBinaryData ( const TraceGetBinaryDataRequest & request)
inlinevirtual

Get binary data given a trace technology and a data identifier.

Parameters
[in]requestObject with the params of the requested data.
Returns
A vector of bytes with the requested data, or an llvm::Error in case of failures.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 378 of file NativeProcessProtocol.h.

References lldb_private::TraceGetBinaryDataRequest::kind, and lldb_private::TraceGetBinaryDataRequest::type.

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

◆ TraceGetState()

virtual llvm::Expected< llvm::json::Value > lldb_private::NativeProcessProtocol::TraceGetState ( llvm::StringRef type)
inlinevirtual

Get the current tracing state of the process and its threads.

Parameters
[in]typeTracing technology type to consider.
Returns
A JSON object string with custom data depending on the trace technology, or an llvm::Error in case of errors.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 370 of file NativeProcessProtocol.h.

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

◆ TraceStart()

virtual llvm::Error lldb_private::NativeProcessProtocol::TraceStart ( llvm::StringRef json_params,
llvm::StringRef type )
inlinevirtual

Start tracing a process or its threads.

Parameters
[in]json_paramsJSON object with the information of what and how to trace. In the case of gdb-remote, this object should conform to the jLLDBTraceStart packet.

This object should have a string entry called "type", which is the tracing technology name.

Parameters
[in]typeTracing technology type, as described in the json_params.
Returns
llvm::Error::success if the operation was successful, or an llvm::Error otherwise.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 354 of file NativeProcessProtocol.h.

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

◆ TraceStop()

virtual llvm::Error lldb_private::NativeProcessProtocol::TraceStop ( const TraceStopRequest & request)
inlinevirtual

Stop tracing a live process or its threads.

Parameters
[in]requestThe information determining which threads or process to stop tracing.
Returns
llvm::Error::success if the operation was successful, or llvm::Error otherwise.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 362 of file NativeProcessProtocol.h.

References lldb_private::TraceStopRequest::type.

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

◆ TraceSupported()

virtual llvm::Expected< TraceSupportedResponse > lldb_private::NativeProcessProtocol::TraceSupported ( )
inlinevirtual

Get the processor tracing type supported for this process.

Responses might be different depending on the architecture and capabilities of the underlying OS.

Returns
The supported trace type or an llvm::Error if tracing is not supported for the inferior.

Reimplemented in lldb_private::process_linux::NativeProcessLinux.

Definition at line 386 of file NativeProcessProtocol.h.

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

◆ UpdateThreads()

◆ WriteMemory()

◆ WriteMemoryTags()

lldb_private::Status NativeProcessProtocol::WriteMemoryTags ( int32_t type,
lldb::addr_t addr,
size_t len,
const std::vector< uint8_t > & tags )
virtual

Member Data Documentation

◆ m_current_thread_id

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

◆ m_delegate

◆ m_enabled_extensions

◆ m_exit_status

std::optional<WaitStatus> lldb_private::NativeProcessProtocol::m_exit_status
protected

Definition at line 437 of file NativeProcessProtocol.h.

Referenced by GetExitStatus(), and SetExitStatus().

◆ m_hw_breakpoints_map

HardwareBreakpointMap lldb_private::NativeProcessProtocol::m_hw_breakpoints_map
protected

◆ m_pid

◆ m_signals_to_ignore

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

◆ m_software_breakpoints

◆ m_state

◆ m_state_mutex

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

Definition at line 435 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 443 of file NativeProcessProtocol.h.

Referenced by GetStopID(), and SetState().

◆ m_terminal_fd

◆ m_threads

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

Definition at line 430 of file NativeProcessProtocol.h.

Referenced by lldb_private::process_freebsd::NativeProcessFreeBSD::AddThread(), lldb_private::process_linux::NativeProcessLinux::AddThread(), lldb_private::process_netbsd::NativeProcessNetBSD::AddThread(), lldb_private::process_freebsd::NativeProcessFreeBSD::Attach(), lldb_private::process_netbsd::NativeProcessNetBSD::Attach(), lldb_private::process_linux::NativeProcessLinux::Detach(), GetThreadAtIndex(), GetThreadByIDUnlocked(), lldb_private::process_freebsd::NativeProcessFreeBSD::HasThreadNoLock(), lldb_private::process_linux::NativeProcessLinux::HasThreadNoLock(), lldb_private::process_netbsd::NativeProcessNetBSD::HasThreadNoLock(), lldb_private::process_linux::NativeProcessLinux::Interrupt(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorExited(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorExited(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSignal(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSignal(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSIGSTOP(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGSTOP(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSIGTRAP(), lldb_private::process_linux::NativeProcessLinux::MonitorSIGTRAP(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorSIGTRAP(), lldb_private::NativeProcessWindows::OnCreateThread(), lldb_private::NativeProcessWindows::OnDebuggerConnected(), lldb_private::NativeProcessWindows::OnExitThread(), lldb_private::process_freebsd::NativeProcessFreeBSD::ReinitializeThreads(), lldb_private::process_netbsd::NativeProcessNetBSD::ReinitializeThreads(), RemoveHardwareBreakpoint(), lldb_private::process_freebsd::NativeProcessFreeBSD::RemoveThread(), lldb_private::process_netbsd::NativeProcessNetBSD::RemoveThread(), RemoveWatchpoint(), lldb_private::NativeProcessWindows::Resume(), lldb_private::process_freebsd::NativeProcessFreeBSD::Resume(), lldb_private::process_linux::NativeProcessLinux::Resume(), lldb_private::process_netbsd::NativeProcessNetBSD::Resume(), SetHardwareBreakpoint(), SetWatchpoint(), lldb_private::process_linux::NativeProcessLinux::SignalIfAllThreadsStopped(), lldb_private::process_linux::NativeProcessLinux::StopRunningThreads(), lldb_private::NativeProcessWindows::StopThread(), lldb_private::process_linux::NativeProcessLinux::StopTrackingThread(), Threads(), lldb_private::NativeProcessWindows::UpdateThreads(), lldb_private::process_aix::NativeProcessAIX::UpdateThreads(), lldb_private::process_freebsd::NativeProcessFreeBSD::UpdateThreads(), lldb_private::process_linux::NativeProcessLinux::UpdateThreads(), and lldb_private::process_netbsd::NativeProcessNetBSD::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 440 of file NativeProcessProtocol.h.

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


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