LLDB mainline
Classes | Public Member Functions | List of all members
lldb_private::process_linux::NativeProcessLinux Class Reference

Manages communication with the inferior (debugee) process. More...

#include <NativeProcessLinux.h>

Inheritance diagram for lldb_private::process_linux::NativeProcessLinux:
Inheritance graph
[legend]

Classes

class  Manager
 

Public Member Functions

 ~NativeProcessLinux () override
 
Status Resume (const ResumeActionList &resume_actions) override
 
Status Halt () override
 
Status Detach () override
 
Status Signal (int signo) override
 Sends a process a UNIX signal signal.
 
Status Interrupt () override
 Tells a process to interrupt all operations as if by a Ctrl-C.
 
Status Kill () override
 
Status GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info) override
 
Status ReadMemory (lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read) override
 
Status WriteMemory (lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written) override
 
llvm::Expected< lldb::addr_tAllocateMemory (size_t size, uint32_t permissions) override
 
llvm::Error DeallocateMemory (lldb::addr_t addr) override
 
Status ReadMemoryTags (int32_t type, lldb::addr_t addr, size_t len, std::vector< uint8_t > &tags) override
 
Status WriteMemoryTags (int32_t type, lldb::addr_t addr, size_t len, const std::vector< uint8_t > &tags) override
 
size_t UpdateThreads () override
 
const ArchSpecGetArchitecture () const override
 
Status SetBreakpoint (lldb::addr_t addr, uint32_t size, bool hardware) override
 
Status RemoveBreakpoint (lldb::addr_t addr, bool hardware=false) override
 
void DoStopIDBumped (uint32_t newBumpId) override
 
Status GetLoadedModuleFileSpec (const char *module_path, FileSpec &file_spec) override
 
Status GetFileLoadAddress (const llvm::StringRef &file_name, lldb::addr_t &load_addr) override
 
NativeThreadLinuxGetThreadByID (lldb::tid_t id)
 
NativeThreadLinuxGetCurrentThread ()
 
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > GetAuxvData () const override
 
- Public Member Functions inherited from lldb_private::NativeProcessELF
std::optional< uint64_t > GetAuxValue (enum AuxVector::EntryType type)
 
- Public Member Functions inherited from lldb_private::NativeProcessProtocol
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).
 
Managerm_manager
 
ArchSpec m_arch
 
LazyBool m_supports_mem_region = eLazyBoolCalculate
 
std::vector< std::pair< MemoryRegionInfo, FileSpec > > m_mem_region_cache
 
lldb::tid_t m_pending_notification_tid = LLDB_INVALID_THREAD_ID
 
llvm::DenseMap< lldb::addr_t, lldb::addr_tm_allocated_memory
 Inferior memory (allocated by us) and its size.
 
IntelPTCollector m_intel_pt_collector
 Manages Intel PT process and thread traces.
 
llvm::Error TraceStart (llvm::StringRef json_request, llvm::StringRef type) override
 Tracing These methods implement the jLLDBTrace packets.
 
llvm::Error TraceStop (const TraceStopRequest &request) override
 Stop tracing a live process or its threads.
 
llvm::Expected< llvm::json::Value > TraceGetState (llvm::StringRef type) override
 Get the current tracing state of the process and its threads.
 
llvm::Expected< std::vector< uint8_t > > TraceGetBinaryData (const TraceGetBinaryDataRequest &request) override
 Get binary data given a trace technology and a data identifier.
 
llvm::Expected< TraceSupportedResponseTraceSupported () override
 Get the processor tracing type supported for this process.
 
bool SupportHardwareSingleStepping () const
 
Status GetSignalInfo (lldb::tid_t tid, void *siginfo) const
 Writes a siginfo_t structure corresponding to the given thread ID to the memory region pointed to by siginfo.
 
static Status PtraceWrapper (int req, lldb::pid_t pid, void *addr=nullptr, void *data=nullptr, size_t data_size=0, long *result=nullptr)
 }
 
llvm::Expected< llvm::ArrayRef< uint8_t > > GetSoftwareBreakpointTrapOpcode (size_t size_hint) override
 
llvm::Expected< uint64_t > Syscall (llvm::ArrayRef< uint64_t > args)
 
 NativeProcessLinux (::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, Manager &manager, llvm::ArrayRef<::pid_t > tids)
 
bool TryHandleWaitStatus (lldb::pid_t pid, WaitStatus status)
 
void MonitorCallback (NativeThreadLinux &thread, WaitStatus status)
 
void MonitorSIGTRAP (const siginfo_t &info, NativeThreadLinux &thread)
 
void MonitorTrace (NativeThreadLinux &thread)
 
void MonitorBreakpoint (NativeThreadLinux &thread)
 
void MonitorWatchpoint (NativeThreadLinux &thread, uint32_t wp_index)
 
void MonitorSignal (const siginfo_t &info, NativeThreadLinux &thread)
 
bool HasThreadNoLock (lldb::tid_t thread_id)
 
void StopTrackingThread (NativeThreadLinux &thread)
 
NativeThreadLinuxAddThread (lldb::tid_t thread_id, bool resume)
 Create a new thread.
 
Status NotifyTracersOfNewThread (lldb::tid_t tid)
 Start tracing a new thread if process tracing is enabled.
 
Status NotifyTracersOfThreadDestroyed (lldb::tid_t tid)
 Stop tracing threads upon a destroy event.
 
void NotifyTracersProcessWillResume () override
 Notify tracers that the target process will resume.
 
void NotifyTracersProcessDidStop () override
 Notify tracers that the target process just stopped.
 
Status GetEventMessage (lldb::tid_t tid, unsigned long *message)
 Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG) corresponding to the given thread ID to the memory pointed to by message.
 
void NotifyThreadDeath (lldb::tid_t tid)
 
Status Detach (lldb::tid_t tid)
 
void StopRunningThreads (lldb::tid_t triggering_tid)
 
void SignalIfAllThreadsStopped ()
 
Status ResumeThread (NativeThreadLinux &thread, lldb::StateType state, int signo)
 
void ThreadWasCreated (NativeThreadLinux &thread)
 
void SigchldHandler ()
 
Status PopulateMemoryRegionCache ()
 
bool MonitorClone (NativeThreadLinux &parent, lldb::pid_t child_pid, int event)
 
static llvm::Expected< std::vector<::pid_t > > Attach (::pid_t pid)
 
static Status SetDefaultPtraceOpts (const lldb::pid_t)
 

Additional Inherited Members

- Public Types inherited from lldb_private::NativeProcessProtocol
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< thread_collection, NativeThreadProtocol &, thread_list_adapter, std::recursive_mutex > ThreadIterable
 
- Static Public Member Functions inherited from lldb_private::NativeProcessProtocol
template<typename I >
static NativeThreadProtocolthread_list_adapter (I &iter)
 
- Protected Member Functions inherited from lldb_private::NativeProcessELF
lldb::addr_t GetSharedLibraryInfoAddress () override
 
template<typename ELF_EHDR , typename ELF_PHDR , typename ELF_DYN >
lldb::addr_t GetELFImageInfoAddress ()
 
llvm::Expected< std::vector< SVR4LibraryInfo > > GetLoadedSVR4Libraries () override
 
template<typename T >
llvm::Expected< SVR4LibraryInfoReadSVR4LibraryInfo (lldb::addr_t link_map_addr)
 
void NotifyDidExec () override
 Notify the delegate that an exec occurred.
 
- Protected Member Functions inherited from lldb_private::NativeProcessProtocol
 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 inherited from lldb_private::NativeProcessELF
std::unique_ptr< AuxVectorm_aux_vector
 
std::optional< lldb::addr_tm_shared_library_info_addr
 
- Protected Attributes inherited from lldb_private::NativeProcessProtocol
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 inherited from lldb_private::NativeProcessSoftwareSingleStep
Status SetupSoftwareSingleStepping (NativeThreadProtocol &thread)
 
- Private Attributes inherited from lldb_private::NativeProcessSoftwareSingleStep
std::map< lldb::tid_t, lldb::addr_tm_threads_stepping_with_breakpoint
 

Detailed Description

Manages communication with the inferior (debugee) process.

Upon construction, this class prepares and launches an inferior process for debugging.

Changes in the inferior process state are broadcasted.

Definition at line 41 of file NativeProcessLinux.h.

Constructor & Destructor Documentation

◆ ~NativeProcessLinux()

lldb_private::process_linux::NativeProcessLinux::~NativeProcessLinux ( )
inlineoverride

◆ NativeProcessLinux()

NativeProcessLinux::NativeProcessLinux ( ::pid_t  pid,
int  terminal_fd,
NativeDelegate delegate,
const ArchSpec arch,
Manager manager,
llvm::ArrayRef<::pid_t tids 
)
private

Member Function Documentation

◆ AddThread()

NativeThreadLinux & NativeProcessLinux::AddThread ( lldb::tid_t  thread_id,
bool  resume 
)
private

Create a new thread.

If process tracing is enabled and the thread can't be traced, then the thread is left stopped with a eStopReasonProcessorTrace status, and then the process is stopped.

Parameters
[in]resumeIf a tracing error didn't happen, then resume the thread after creation if true, or leave it stopped with SIGSTOP if false.

Definition at line 1812 of file NativeProcessLinux.cpp.

References lldb_private::Status::AsCString(), lldb::eStateRunning, lldb_private::Status::Fail(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), HasThreadNoLock(), LLDB_INVALID_SIGNAL_NUMBER, LLDB_LOG, lldb_private::NativeProcessProtocol::m_threads, NotifyTracersOfNewThread(), ResumeThread(), lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::process_linux::NativeThreadLinux::SetStoppedByProcessorTrace(), lldb_private::process_linux::NativeThreadLinux::SetStoppedBySignal(), SIGSTOP, StopRunningThreads(), and lldb_private::Thread.

Referenced by MonitorClone(), and NativeProcessLinux().

◆ AllocateMemory()

llvm::Expected< addr_t > NativeProcessLinux::AllocateMemory ( size_t  size,
uint32_t  permissions 
)
overridevirtual

◆ Attach()

llvm::Expected< std::vector<::pid_t > > NativeProcessLinux::Attach ( ::pid_t  pid)
staticprivate

◆ DeallocateMemory()

llvm::Error NativeProcessLinux::DeallocateMemory ( lldb::addr_t  addr)
overridevirtual

◆ Detach() [1/2]

Status NativeProcessLinux::Detach ( )
overridevirtual

◆ Detach() [2/2]

Status NativeProcessLinux::Detach ( lldb::tid_t  tid)
private

Definition at line 1750 of file NativeProcessLinux.cpp.

References LLDB_INVALID_THREAD_ID, and PtraceWrapper().

◆ DoStopIDBumped()

void NativeProcessLinux::DoStopIDBumped ( uint32_t  newBumpId)
overridevirtual

◆ GetArchitecture()

const ArchSpec & lldb_private::process_linux::NativeProcessLinux::GetArchitecture ( ) const
inlineoverridevirtual

Implements lldb_private::NativeProcessProtocol.

Definition at line 117 of file NativeProcessLinux.h.

References m_arch.

Referenced by GetSoftwareBreakpointTrapOpcode().

◆ GetAuxvData()

llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > lldb_private::process_linux::NativeProcessLinux::GetAuxvData ( ) const
inlineoverridevirtual

◆ GetCurrentThread()

NativeThreadLinux * NativeProcessLinux::GetCurrentThread ( )

◆ GetEventMessage()

Status NativeProcessLinux::GetEventMessage ( lldb::tid_t  tid,
unsigned long *  message 
)
private

Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG) corresponding to the given thread ID to the memory pointed to by message.

Definition at line 1745 of file NativeProcessLinux.cpp.

References PtraceWrapper().

Referenced by MonitorSIGTRAP().

◆ GetFileLoadAddress()

Status NativeProcessLinux::GetFileLoadAddress ( const llvm::StringRef &  file_name,
lldb::addr_t load_addr 
)
overridevirtual

◆ GetLoadedModuleFileSpec()

Status NativeProcessLinux::GetLoadedModuleFileSpec ( const char *  module_path,
FileSpec file_spec 
)
overridevirtual

◆ GetMemoryRegionInfo()

Status NativeProcessLinux::GetMemoryRegionInfo ( lldb::addr_t  load_addr,
MemoryRegionInfo range_info 
)
overridevirtual

◆ GetSignalInfo()

Status NativeProcessLinux::GetSignalInfo ( lldb::tid_t  tid,
void *  siginfo 
) const

Writes a siginfo_t structure corresponding to the given thread ID to the memory region pointed to by siginfo.

Definition at line 1741 of file NativeProcessLinux.cpp.

References PtraceWrapper().

Referenced by lldb_private::process_linux::NativeThreadLinux::GetSiginfo(), and MonitorCallback().

◆ GetSoftwareBreakpointTrapOpcode()

llvm::Expected< llvm::ArrayRef< uint8_t > > NativeProcessLinux::GetSoftwareBreakpointTrapOpcode ( size_t  size_hint)
overrideprotectedvirtual

◆ GetThreadByID()

NativeThreadLinux * NativeProcessLinux::GetThreadByID ( lldb::tid_t  id)

◆ Halt()

Status NativeProcessLinux::Halt ( )
overridevirtual

◆ HasThreadNoLock()

bool NativeProcessLinux::HasThreadNoLock ( lldb::tid_t  thread_id)
private

Definition at line 1757 of file NativeProcessLinux.cpp.

References lldb_private::NativeProcessProtocol::m_threads.

Referenced by AddThread().

◆ Interrupt()

Status NativeProcessLinux::Interrupt ( )
overridevirtual

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 from lldb_private::NativeProcessProtocol.

Definition at line 1121 of file NativeProcessLinux.cpp.

References error(), lldb::eStateRunning, lldb::eStateStepping, lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeProcessProtocol::m_threads, lldb_private::Process, lldb_private::StateIsStoppedState(), and StopRunningThreads().

◆ Kill()

Status NativeProcessLinux::Kill ( )
overridevirtual

◆ MonitorBreakpoint()

void NativeProcessLinux::MonitorBreakpoint ( NativeThreadLinux thread)
private

◆ MonitorCallback()

void NativeProcessLinux::MonitorCallback ( NativeThreadLinux thread,
WaitStatus  status 
)
private

◆ MonitorClone()

bool NativeProcessLinux::MonitorClone ( NativeThreadLinux parent,
lldb::pid_t  child_pid,
int  event 
)
private

◆ MonitorSignal()

void NativeProcessLinux::MonitorSignal ( const siginfo_t &  info,
NativeThreadLinux thread 
)
private

◆ MonitorSIGTRAP()

void NativeProcessLinux::MonitorSIGTRAP ( const siginfo_t &  info,
NativeThreadLinux thread 
)
private

◆ MonitorTrace()

void NativeProcessLinux::MonitorTrace ( NativeThreadLinux thread)
private

◆ MonitorWatchpoint()

void NativeProcessLinux::MonitorWatchpoint ( NativeThreadLinux thread,
uint32_t  wp_index 
)
private

◆ NotifyThreadDeath()

void lldb_private::process_linux::NativeProcessLinux::NotifyThreadDeath ( lldb::tid_t  tid)
private

◆ NotifyTracersOfNewThread()

Status NativeProcessLinux::NotifyTracersOfNewThread ( lldb::tid_t  tid)
private

Start tracing a new thread if process tracing is enabled.

Trace mechanisms should modify this method to provide automatic tracing for new threads.

Definition at line 1793 of file NativeProcessLinux.cpp.

References error(), lldb_private::GetLog(), LLDB_LOG, m_intel_pt_collector, lldb_private::process_linux::IntelPTCollector::OnThreadCreated(), and lldb_private::Thread.

Referenced by AddThread().

◆ NotifyTracersOfThreadDestroyed()

Status NativeProcessLinux::NotifyTracersOfThreadDestroyed ( lldb::tid_t  tid)
private

Stop tracing threads upon a destroy event.

Trace mechanisms should modify this method to provide automatic trace stopping for threads being destroyed.

Definition at line 1802 of file NativeProcessLinux.cpp.

References error(), lldb_private::GetLog(), LLDB_LOG, m_intel_pt_collector, lldb_private::process_linux::IntelPTCollector::OnThreadDestroyed(), and lldb_private::Thread.

Referenced by StopTrackingThread().

◆ NotifyTracersProcessDidStop()

void NativeProcessLinux::NotifyTracersProcessDidStop ( )
overrideprivatevirtual

Notify tracers that the target process just stopped.

Reimplemented from lldb_private::NativeProcessProtocol.

Definition at line 1785 of file NativeProcessLinux.cpp.

References m_intel_pt_collector, and lldb_private::process_linux::IntelPTCollector::ProcessDidStop().

◆ NotifyTracersProcessWillResume()

void NativeProcessLinux::NotifyTracersProcessWillResume ( )
overrideprivatevirtual

Notify tracers that the target process will resume.

Reimplemented from lldb_private::NativeProcessProtocol.

Definition at line 1789 of file NativeProcessLinux.cpp.

References m_intel_pt_collector, and lldb_private::process_linux::IntelPTCollector::ProcessWillResume().

Referenced by Resume().

◆ PopulateMemoryRegionCache()

Status NativeProcessLinux::PopulateMemoryRegionCache ( )
private

◆ PtraceWrapper()

Status NativeProcessLinux::PtraceWrapper ( int  req,
lldb::pid_t  pid,
void *  addr = nullptr,
void *  data = nullptr,
size_t  data_size = 0,
long *  result = nullptr 
)
static

◆ ReadMemory()

Status NativeProcessLinux::ReadMemory ( lldb::addr_t  addr,
void *  buf,
size_t  size,
size_t &  bytes_read 
)
overridevirtual

◆ ReadMemoryTags()

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

◆ RemoveBreakpoint()

Status NativeProcessLinux::RemoveBreakpoint ( lldb::addr_t  addr,
bool  hardware = false 
)
overridevirtual

◆ Resume()

Status NativeProcessLinux::Resume ( const ResumeActionList resume_actions)
overridevirtual

◆ ResumeThread()

Status NativeProcessLinux::ResumeThread ( NativeThreadLinux thread,
lldb::StateType  state,
int  signo 
)
private

◆ SetBreakpoint()

Status NativeProcessLinux::SetBreakpoint ( lldb::addr_t  addr,
uint32_t  size,
bool  hardware 
)
overridevirtual

◆ SetDefaultPtraceOpts()

Status NativeProcessLinux::SetDefaultPtraceOpts ( const lldb::pid_t  pid)
staticprivate

◆ SigchldHandler()

void lldb_private::process_linux::NativeProcessLinux::SigchldHandler ( )
private

◆ Signal()

Status NativeProcessLinux::Signal ( int  signo)
overridevirtual

Sends a process a UNIX signal signal.

Returns
Returns an error object.

Implements lldb_private::NativeProcessProtocol.

Definition at line 1108 of file NativeProcessLinux.cpp.

References error(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::Host::GetSignalAsCString(), LLDB_LOG, and lldb_private::Process.

◆ SignalIfAllThreadsStopped()

void NativeProcessLinux::SignalIfAllThreadsStopped ( )
private

◆ StopRunningThreads()

void NativeProcessLinux::StopRunningThreads ( lldb::tid_t  triggering_tid)
private

◆ StopTrackingThread()

void NativeProcessLinux::StopTrackingThread ( NativeThreadLinux thread)
private

◆ SupportHardwareSingleStepping()

bool NativeProcessLinux::SupportHardwareSingleStepping ( ) const

◆ Syscall()

llvm::Expected< uint64_t > NativeProcessLinux::Syscall ( llvm::ArrayRef< uint64_t >  args)
protected

◆ ThreadWasCreated()

void NativeProcessLinux::ThreadWasCreated ( NativeThreadLinux thread)
private

◆ TraceGetBinaryData()

Expected< std::vector< uint8_t > > NativeProcessLinux::TraceGetBinaryData ( const TraceGetBinaryDataRequest request)
overridevirtual

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 from lldb_private::NativeProcessProtocol.

Definition at line 2054 of file NativeProcessLinux.cpp.

References lldb_private::process_linux::IntelPTCollector::GetBinaryData(), m_intel_pt_collector, lldb_private::NativeProcessProtocol::TraceGetBinaryData(), and lldb_private::TraceGetBinaryDataRequest::type.

◆ TraceGetState()

Expected< json::Value > NativeProcessLinux::TraceGetState ( llvm::StringRef  type)
overridevirtual

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 from lldb_private::NativeProcessProtocol.

Definition at line 2048 of file NativeProcessLinux.cpp.

References lldb_private::process_linux::IntelPTCollector::GetState(), m_intel_pt_collector, and lldb_private::NativeProcessProtocol::TraceGetState().

◆ TraceStart()

Error NativeProcessLinux::TraceStart ( llvm::StringRef  json_request,
llvm::StringRef  type 
)
overridevirtual

Tracing These methods implement the jLLDBTrace packets.

Reimplemented from lldb_private::NativeProcessProtocol.

Definition at line 2029 of file NativeProcessLinux.cpp.

References m_intel_pt_collector, lldb_private::process_linux::IntelPTCollector::TraceStart(), and lldb_private::NativeProcessProtocol::TraceStart().

◆ TraceStop()

Error NativeProcessLinux::TraceStop ( const TraceStopRequest request)
overridevirtual

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 from lldb_private::NativeProcessProtocol.

Definition at line 2042 of file NativeProcessLinux.cpp.

References m_intel_pt_collector, lldb_private::NativeProcessProtocol::TraceStop(), lldb_private::process_linux::IntelPTCollector::TraceStop(), and lldb_private::TraceStopRequest::type.

◆ TraceSupported()

llvm::Expected< TraceSupportedResponse > NativeProcessLinux::TraceSupported ( )
overridevirtual

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 from lldb_private::NativeProcessProtocol.

Definition at line 2023 of file NativeProcessLinux.cpp.

References lldb_private::process_linux::IntelPTCollector::IsSupported(), and lldb_private::NativeProcessProtocol::TraceSupported().

◆ TryHandleWaitStatus()

bool NativeProcessLinux::TryHandleWaitStatus ( lldb::pid_t  pid,
WaitStatus  status 
)
private

◆ UpdateThreads()

size_t NativeProcessLinux::UpdateThreads ( )
overridevirtual

◆ WriteMemory()

Status NativeProcessLinux::WriteMemory ( lldb::addr_t  addr,
const void *  buf,
size_t  size,
size_t &  bytes_written 
)
overridevirtual

◆ WriteMemoryTags()

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

Member Data Documentation

◆ m_allocated_memory

llvm::DenseMap<lldb::addr_t, lldb::addr_t> lldb_private::process_linux::NativeProcessLinux::m_allocated_memory
private

Inferior memory (allocated by us) and its size.

Definition at line 184 of file NativeProcessLinux.h.

Referenced by AllocateMemory(), and DeallocateMemory().

◆ m_arch

ArchSpec lldb_private::process_linux::NativeProcessLinux::m_arch
private

◆ m_intel_pt_collector

IntelPTCollector lldb_private::process_linux::NativeProcessLinux::m_intel_pt_collector
private

◆ m_manager

Manager& lldb_private::process_linux::NativeProcessLinux::m_manager
private

Definition at line 175 of file NativeProcessLinux.h.

Referenced by MonitorClone(), and ~NativeProcessLinux().

◆ m_mem_region_cache

std::vector<std::pair<MemoryRegionInfo, FileSpec> > lldb_private::process_linux::NativeProcessLinux::m_mem_region_cache
private

◆ m_pending_notification_tid

lldb::tid_t lldb_private::process_linux::NativeProcessLinux::m_pending_notification_tid = LLDB_INVALID_THREAD_ID
private

◆ m_supports_mem_region

LazyBool lldb_private::process_linux::NativeProcessLinux::m_supports_mem_region = eLazyBoolCalculate
private

Definition at line 178 of file NativeProcessLinux.h.

Referenced by GetMemoryRegionInfo(), and PopulateMemoryRegionCache().


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