LLDB mainline
|
Manages communication with the inferior (debugee) process. More...
#include <NativeProcessLinux.h>
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_t > | AllocateMemory (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 ArchSpec & | GetArchitecture () 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 |
NativeThreadLinux * | GetThreadByID (lldb::tid_t id) |
NativeThreadLinux * | GetCurrentThread () |
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_t > | AllocateMemory (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 ArchSpec & | GetArchitecture () 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 HardwareBreakpointMap & | GetHardwareBreakpointMap () const |
virtual Status | SetHardwareBreakpoint (lldb::addr_t addr, size_t size) |
virtual Status | RemoveHardwareBreakpoint (lldb::addr_t addr) |
virtual const NativeWatchpointList::WatchpointMap & | GetWatchpointMap () 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< WaitStatus > | GetExitStatus () |
virtual bool | SetExitStatus (WaitStatus status, bool bNotifyStateChange) |
NativeThreadProtocol * | GetThreadAtIndex (uint32_t idx) |
NativeThreadProtocol * | GetThreadByID (lldb::tid_t tid) |
void | SetCurrentThreadID (lldb::tid_t tid) |
lldb::tid_t | GetCurrentThreadID () const |
NativeThreadProtocol * | GetCurrentThread () |
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< TraceSupportedResponse > | TraceSupported () |
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). | |
Manager & | m_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_t > | m_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< TraceSupportedResponse > | TraceSupported () 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) |
NativeThreadLinux & | AddThread (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) |
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.
|
inlineoverride |
Definition at line 81 of file NativeProcessLinux.h.
References m_manager, and lldb_private::process_linux::NativeProcessLinux::Manager::RemoveProcess().
|
private |
Definition at line 425 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::NativeProcessLinux::Manager::AddProcess(), AddThread(), EnsureFDFlags(), lldb_private::NativeProcessProtocol::m_terminal_fd, O_NONBLOCK, lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::NativeProcessProtocol::SetState(), lldb_private::Status::Success(), and ThreadWasCreated().
|
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.
[in] | resume | If 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().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1425 of file NativeProcessLinux.cpp.
References GetCurrentThread(), lldb_private::process_linux::NativeRegisterContextLinux::GetMmapData(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), m_allocated_memory, MAP_PRIVATE, PROT_EXEC, PROT_NONE, PROT_READ, PROT_WRITE, and Syscall().
Definition at line 447 of file NativeProcessLinux.cpp.
References AddPtraceScopeNote(), lldb_private::Host::FindProcessThreads(), lldb_private::Status::GetError(), lldb_private::GetLog(), LLDB_LOG, lldb_private::Process, PtraceWrapper(), SetDefaultPtraceOpts(), and lldb_private::Status::ToError().
Referenced by lldb_private::process_linux::NativeProcessLinux::Manager::Attach().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1451 of file NativeProcessLinux.cpp.
References GetCurrentThread(), lldb_private::process_linux::NativeRegisterContextLinux::GetMmapData(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), m_allocated_memory, and Syscall().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1085 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::IntelPTCollector::Clear(), Detach(), error(), lldb_private::Status::Fail(), lldb_private::NativeProcessProtocol::GetID(), LLDB_INVALID_PROCESS_ID, m_intel_pt_collector, and lldb_private::NativeProcessProtocol::m_threads.
Referenced by Detach().
|
private |
Definition at line 1750 of file NativeProcessLinux.cpp.
References LLDB_INVALID_THREAD_ID, and PtraceWrapper().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1332 of file NativeProcessLinux.cpp.
References lldb_private::GetLog(), LLDB_LOG, m_mem_region_cache, and lldb_private::Process.
|
inlineoverridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 117 of file NativeProcessLinux.h.
References m_arch.
Referenced by GetSoftwareBreakpointTrapOpcode().
|
inlineoverridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 136 of file NativeProcessLinux.h.
References lldb_private::NativeProcessProtocol::GetID(), and lldb_private::getProcFile().
NativeThreadLinux * NativeProcessLinux::GetCurrentThread | ( | ) |
Definition at line 1882 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::GetCurrentThread().
Referenced by AllocateMemory(), DeallocateMemory(), ReadMemoryTags(), Syscall(), and WriteMemoryTags().
|
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().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1860 of file NativeProcessLinux.cpp.
References error(), LLDB_INVALID_ADDRESS, m_mem_region_cache, and PopulateMemoryRegionCache().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1840 of file NativeProcessLinux.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::FileSpec::Clear(), error(), lldb_private::FileSpec::GetFilename(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::FileSystem::Instance(), m_mem_region_cache, PopulateMemoryRegionCache(), and lldb_private::FileSystem::Resolve().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1200 of file NativeProcessLinux.cpp.
References lldb_private::Range< B, S >::Contains(), lldb_private::eLazyBoolNo, lldb_private::MemoryRegionInfo::eNo, error(), lldb_private::MemoryRegionInfo::GetRange(), lldb_private::Range< B, S >::GetRangeBase(), LLDB_INVALID_ADDRESS, m_mem_region_cache, m_supports_mem_region, PopulateMemoryRegionCache(), lldb_private::Range< B, S >::SetByteSize(), lldb_private::MemoryRegionInfo::SetExecutable(), lldb_private::MemoryRegionInfo::SetMapped(), lldb_private::Range< B, S >::SetRangeBase(), lldb_private::Range< B, S >::SetRangeEnd(), lldb_private::MemoryRegionInfo::SetReadable(), lldb_private::MemoryRegionInfo::SetWritable(), and UNUSED_IF_ASSERT_DISABLED.
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().
|
overrideprotectedvirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1619 of file NativeProcessLinux.cpp.
References GetArchitecture(), and lldb_private::NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode().
NativeThreadLinux * NativeProcessLinux::GetThreadByID | ( | lldb::tid_t | id | ) |
Definition at line 1877 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::GetThreadByID().
Referenced by TryHandleWaitStatus().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1076 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetID(), and SIGSTOP.
|
private |
Definition at line 1757 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::m_threads.
Referenced by AddThread().
|
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.
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().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1164 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeProcessProtocol::m_state, lldb_private::Process, and SIGKILL.
|
private |
Definition at line 824 of file NativeProcessLinux.cpp.
References lldb_private::Breakpoints, lldb_private::NativeProcessProtocol::FixupBreakpointPCAsNeeded(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeProcessSoftwareSingleStep::m_threads_stepping_with_breakpoint, lldb_private::Process, lldb_private::process_linux::NativeThreadLinux::SetStoppedByBreakpoint(), lldb_private::process_linux::NativeThreadLinux::SetStoppedByTrace(), and StopRunningThreads().
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 558 of file NativeProcessLinux.cpp.
References lldb_private::WaitStatus::Exit, lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), GetSignalInfo(), lldb_private::NativeProcessProtocol::GetState(), lldb_private::process_linux::NativeThreadLinux::GetState(), LLDB_INVALID_SIGNAL_NUMBER, LLDB_LOG, MonitorSignal(), MonitorSIGTRAP(), lldb_private::Process, ResumeThread(), lldb_private::WaitStatus::Signal, SIGTRAP, StopTrackingThread(), and lldb_private::WaitStatus::type.
Referenced by TryHandleWaitStatus().
|
private |
Definition at line 941 of file NativeProcessLinux.cpp.
References AddThread(), lldb_private::process_linux::NativeProcessLinux::Manager::CollectThread(), lldb_private::NativeProcessProtocol::fork, lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), lldb_private::getPIDForTID(), lldb_private::process_linux::NativeThreadLinux::GetState(), LLDB_INVALID_SIGNAL_NUMBER, LLDB_LOG, m_arch, lldb_private::NativeProcessProtocol::m_delegate, lldb_private::NativeProcessProtocol::m_enabled_extensions, m_manager, lldb_private::NativeProcessProtocol::m_software_breakpoints, lldb_private::NativeProcessProtocol::m_terminal_fd, lldb_private::NativeProcessProtocol::NativeDelegate::NewSubprocess(), lldb_private::Process, ResumeThread(), lldb_private::process_linux::NativeThreadLinux::SetStoppedByFork(), StopRunningThreads(), ThreadWasCreated(), and lldb_private::NativeProcessProtocol::vfork.
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 854 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), lldb_private::Host::GetSignalAsCString(), lldb_private::process_linux::NativeThreadLinux::GetState(), LLDB_INVALID_THREAD_ID, LLDB_LOG, m_pending_notification_tid, lldb_private::NativeProcessProtocol::m_signals_to_ignore, lldb_private::Process, ResumeThread(), lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::process_linux::NativeThreadLinux::SetStoppedBySignal(), lldb_private::process_linux::NativeThreadLinux::SetStoppedWithNoReason(), SignalIfAllThreadsStopped(), SIGSTOP, lldb_private::StateIsStoppedState(), and StopRunningThreads().
Referenced by MonitorCallback(), and MonitorSIGTRAP().
|
private |
Definition at line 625 of file NativeProcessLinux.cpp.
References error(), lldb::eStateRunning, lldb_private::Status::Fail(), GetEventMessage(), lldb_private::NativeRegisterContext::GetHardwareBreakHitIndex(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), lldb_private::process_linux::NativeThreadLinux::GetState(), lldb_private::NativeRegisterContext::GetWatchpointHitIndex(), LLDB_INVALID_ADDRESS, LLDB_INVALID_INDEX32, LLDB_INVALID_SIGNAL_NUMBER, LLDB_INVALID_THREAD_ID, LLDB_LOG, lldb_private::NativeProcessProtocol::m_enabled_extensions, m_pending_notification_tid, lldb_private::NativeProcessProtocol::m_threads, MonitorBreakpoint(), MonitorClone(), MonitorSignal(), MonitorTrace(), MonitorWatchpoint(), lldb_private::NativeProcessELF::NotifyDidExec(), lldb_private::Process, ResumeThread(), lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::process_linux::NativeThreadLinux::SetStoppedByVForkDone(), SIGTRAP, lldb_private::StateIsRunningState(), StopRunningThreads(), StopTrackingThread(), ThreadWasCreated(), TRAP_HWBKPT, and lldb_private::NativeProcessProtocol::vfork.
Referenced by MonitorCallback().
|
private |
Definition at line 814 of file NativeProcessLinux.cpp.
References lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::Process, lldb_private::process_linux::NativeThreadLinux::SetStoppedByTrace(), and StopRunningThreads().
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 839 of file NativeProcessLinux.cpp.
References lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::Process, lldb_private::process_linux::NativeThreadLinux::SetStoppedByWatchpoint(), StopRunningThreads(), and lldb_private::Watchpoints.
Referenced by MonitorSIGTRAP().
|
private |
|
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().
|
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().
|
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().
|
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().
|
private |
Definition at line 1269 of file NativeProcessLinux.cpp.
References lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::Status::Fail(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::getProcFile(), lldb_private::FileSystem::Instance(), LLDB_LOG, m_mem_region_cache, m_supports_mem_region, lldb_private::ParseLinuxMapRegions(), lldb_private::ParseLinuxSMapRegions(), lldb_private::Process, and lldb_private::FileSystem::Resolve().
Referenced by GetFileLoadAddress(), GetLoadedModuleFileSpec(), GetMemoryRegionInfo(), and Syscall().
|
static |
}
Definition at line 1988 of file NativeProcessLinux.cpp.
References error(), lldb_private::GetLog(), LLDB_LOG, lldb_private::Ptrace, PTRACE_GETREGSET, PTRACE_SETREGSET, and PtraceDisplayBytes().
Referenced by Attach(), Detach(), lldb_private::process_linux::NativeRegisterContextLinux::DetermineArchitectureViaGPR(), lldb_private::process_linux::NativeRegisterContextLinux::DoReadRegisterValue(), lldb_private::process_linux::NativeRegisterContextLinux::DoWriteRegisterValue(), GetEventMessage(), GetSignalInfo(), lldb_private::process_linux::NativeRegisterContextLinux::ReadFPR(), lldb_private::process_linux::NativeRegisterContextLinux::ReadGPR(), ReadMemory(), ReadMemoryTags(), lldb_private::process_linux::NativeRegisterContextLinux::ReadRegisterSet(), lldb_private::process_linux::NativeThreadLinux::Resume(), SetDefaultPtraceOpts(), lldb_private::process_linux::NativeThreadLinux::SingleStep(), Syscall(), lldb_private::process_linux::NativeRegisterContextLinux::WriteFPR(), lldb_private::process_linux::NativeRegisterContextLinux::WriteGPR(), WriteMemory(), WriteMemoryTags(), and lldb_private::process_linux::NativeRegisterContextLinux::WriteRegisterSet().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1641 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::GetLog(), k_ptrace_word_size, LLDB_LOG, lldb_private::Memory, lldb_private::Process, process_vm_readv(), ProcessVmReadvSupported(), and PtraceWrapper().
Referenced by Syscall(), and WriteMemory().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1471 of file NativeProcessLinux.cpp.
References error(), lldb_private::Range< B, S >::GetByteSize(), GetCurrentThread(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::process_linux::NativeRegisterContextLinux::GetMemoryTaggingDetails(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), and PtraceWrapper().
Referenced by lldb_private::process_linux::NativeThreadLinux::AnnotateSyncTagCheckFault().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1611 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::RemoveBreakpoint(), and lldb_private::NativeProcessProtocol::RemoveHardwareBreakpoint().
Referenced by SignalIfAllThreadsStopped().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1004 of file NativeProcessLinux.cpp.
References error(), lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb_private::ResumeActionList::GetActionForThread(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeProcessProtocol::m_threads, NotifyTracersProcessWillResume(), lldb_private::Process, ResumeThread(), lldb_private::NativeProcessSoftwareSingleStep::SetupSoftwareSingleStepping(), lldb_private::ResumeAction::signal, lldb_private::ResumeAction::state, lldb_private::StateAsCString(), and SupportHardwareSingleStepping().
|
private |
Definition at line 1887 of file NativeProcessLinux.cpp.
References lldb::eStateRunning, lldb::eStateStepping, lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_INVALID_THREAD_ID, LLDB_LOG, m_pending_notification_tid, lldb_private::process_linux::NativeThreadLinux::Resume(), lldb_private::NativeProcessProtocol::SetState(), lldb_private::process_linux::NativeThreadLinux::SingleStep(), and lldb_private::Thread.
Referenced by AddThread(), MonitorCallback(), MonitorClone(), MonitorSignal(), MonitorSIGTRAP(), and Resume().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1603 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::SetHardwareBreakpoint(), and lldb_private::NativeProcessProtocol::SetSoftwareBreakpoint().
|
staticprivate |
Definition at line 516 of file NativeProcessLinux.cpp.
References PtraceWrapper().
Referenced by Attach(), and lldb_private::process_linux::NativeProcessLinux::Manager::Launch().
|
private |
|
overridevirtual |
Sends a process a UNIX signal signal.
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.
|
private |
Definition at line 1946 of file NativeProcessLinux.cpp.
References lldb_private::Breakpoints, error(), lldb_private::GetLog(), LLDB_INVALID_THREAD_ID, LLDB_LOG, m_pending_notification_tid, lldb_private::NativeProcessProtocol::m_threads, lldb_private::NativeProcessSoftwareSingleStep::m_threads_stepping_with_breakpoint, lldb_private::Process, RemoveBreakpoint(), lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::NativeProcessProtocol::SetState(), and lldb_private::StateIsRunningState().
Referenced by MonitorSignal(), StopRunningThreads(), and StopTrackingThread().
|
private |
Definition at line 1928 of file NativeProcessLinux.cpp.
References lldb_private::GetLog(), LLDB_LOG, m_pending_notification_tid, lldb_private::NativeProcessProtocol::m_threads, SignalIfAllThreadsStopped(), lldb_private::StateIsRunningState(), and lldb_private::Thread.
Referenced by AddThread(), Interrupt(), MonitorBreakpoint(), MonitorClone(), MonitorSignal(), MonitorSIGTRAP(), MonitorTrace(), and MonitorWatchpoint().
|
private |
Definition at line 1770 of file NativeProcessLinux.cpp.
References lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeProcessProtocol::m_threads, NotifyTracersOfThreadDestroyed(), SignalIfAllThreadsStopped(), and lldb_private::Thread.
Referenced by MonitorCallback(), and MonitorSIGTRAP().
bool NativeProcessLinux::SupportHardwareSingleStepping | ( | ) | const |
Definition at line 997 of file NativeProcessLinux.cpp.
References lldb_private::ArchSpec::GetMachine(), lldb_private::ArchSpec::GetTriple(), lldb_private::ArchSpec::IsMIPS(), and m_arch.
|
protected |
Definition at line 1341 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::NativeRegisterContextLinux::SyscallData::Args, lldb::eStateStopped, lldb_private::MemoryRegionInfo::eYes, lldb_private::ArchSpec::GetAddressByteSize(), GetCurrentThread(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), lldb_private::process_linux::NativeThreadLinux::GetState(), lldb_private::process_linux::NativeRegisterContextLinux::GetSyscallData(), lldb_private::process_linux::NativeRegisterContextLinux::SyscallData::Insn, m_arch, m_mem_region_cache, PopulateMemoryRegionCache(), PtraceWrapper(), lldb_private::NativeRegisterContext::ReadAllRegisterValues(), ReadMemory(), lldb_private::NativeRegisterContext::ReadRegisterAsUnsigned(), lldb_private::process_linux::NativeRegisterContextLinux::SyscallData::Result, lldb_private::NativeRegisterContext::SetPC(), SupportHardwareSingleStepping(), lldb_private::Status::ToError(), lldb_private::NativeRegisterContext::WriteAllRegisterValues(), and WriteMemory().
Referenced by AllocateMemory(), and DeallocateMemory().
|
private |
Definition at line 1974 of file NativeProcessLinux.cpp.
References lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), lldb_private::process_linux::NativeThreadLinux::GetState(), LLDB_INVALID_THREAD_ID, LLDB_LOG, m_pending_notification_tid, lldb_private::process_linux::NativeThreadLinux::RequestStop(), lldb_private::StateIsRunningState(), and lldb_private::Thread.
Referenced by MonitorClone(), MonitorSIGTRAP(), and NativeProcessLinux().
|
overridevirtual |
Get binary data given a trace technology and a data identifier.
[in] | request | Object with the params of the requested data. |
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.
|
overridevirtual |
Get the current tracing state of the process and its threads.
[in] | type | Tracing technology type to consider. |
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().
|
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().
|
overridevirtual |
Stop tracing a live process or its threads.
[in] | request | The information determining which threads or process to stop tracing. |
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.
|
overridevirtual |
Get the processor tracing type supported for this process.
Responses might be different depending on the architecture and capabilities of the underlying OS.
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().
|
private |
Definition at line 543 of file NativeProcessLinux.cpp.
References lldb_private::WaitStatus::Exit, lldb_private::NativeProcessProtocol::GetID(), GetThreadByID(), MonitorCallback(), lldb_private::NativeProcessProtocol::SetExitStatus(), lldb_private::WaitStatus::Signal, and lldb_private::WaitStatus::type.
Referenced by lldb_private::process_linux::NativeProcessLinux::Manager::SigchldHandler().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1596 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::m_threads.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1695 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::GetLog(), k_ptrace_word_size, LLDB_LOG, lldb_private::Memory, PtraceWrapper(), ReadMemory(), and WriteMemory().
Referenced by Syscall(), and WriteMemory().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1526 of file NativeProcessLinux.cpp.
References error(), GetCurrentThread(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::process_linux::NativeRegisterContextLinux::GetMemoryTaggingDetails(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), and PtraceWrapper().
|
private |
Inferior memory (allocated by us) and its size.
Definition at line 184 of file NativeProcessLinux.h.
Referenced by AllocateMemory(), and DeallocateMemory().
|
private |
Definition at line 176 of file NativeProcessLinux.h.
Referenced by GetArchitecture(), MonitorClone(), SupportHardwareSingleStepping(), and Syscall().
|
private |
Manages Intel PT process and thread traces.
Definition at line 273 of file NativeProcessLinux.h.
Referenced by Detach(), NotifyTracersOfNewThread(), NotifyTracersOfThreadDestroyed(), NotifyTracersProcessDidStop(), NotifyTracersProcessWillResume(), TraceGetBinaryData(), TraceGetState(), TraceStart(), and TraceStop().
|
private |
Definition at line 175 of file NativeProcessLinux.h.
Referenced by MonitorClone(), and ~NativeProcessLinux().
|
private |
Definition at line 179 of file NativeProcessLinux.h.
Referenced by DoStopIDBumped(), GetFileLoadAddress(), GetLoadedModuleFileSpec(), GetMemoryRegionInfo(), PopulateMemoryRegionCache(), and Syscall().
|
private |
Definition at line 181 of file NativeProcessLinux.h.
Referenced by MonitorSignal(), MonitorSIGTRAP(), ResumeThread(), SignalIfAllThreadsStopped(), StopRunningThreads(), and ThreadWasCreated().
|
private |
Definition at line 178 of file NativeProcessLinux.h.
Referenced by GetMemoryRegionInfo(), and PopulateMemoryRegionCache().