LLDB
mainline
|
#include <NativeProcessLinux.h>
Classes | |
class | Factory |
Public Member Functions | |
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. More... | |
Status | Interrupt () override |
Tells a process to interrupt all operations as if by a Ctrl-C. More... | |
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 |
![]() | |
llvm::Optional< uint64_t > | GetAuxValue (enum AuxVector::EntryType type) |
![]() | |
virtual | ~NativeProcessProtocol ()=default |
virtual Status | IgnoreSignals (llvm::ArrayRef< int > signals) |
Status | ReadMemoryWithoutTrap (lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read) |
llvm::Expected< llvm::StringRef > | ReadCStringFromMemory (lldb::addr_t addr, char *buffer, size_t max_size, size_t &total_bytes_read) |
Reads a null terminated string from memory. More... | |
virtual bool | IsAlive () const |
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 llvm::Optional< std::pair< uint32_t, uint32_t > > | GetHardwareDebugSupportInfo () const |
virtual Status | SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) |
virtual Status | RemoveWatchpoint (lldb::addr_t addr) |
lldb::pid_t | GetID () const |
lldb::StateType | GetState () const |
bool | IsRunning () const |
bool | IsStepping () const |
bool | CanResume () const |
lldb::ByteOrder | GetByteOrder () const |
uint32_t | GetAddressByteSize () const |
virtual llvm::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 void | SetEnabledExtensions (Extension flags) |
Method called in order to propagate the bitmap of protocol extensions supported by the client. More... | |
virtual llvm::Expected< std::string > | SaveCore (llvm::StringRef path_hint) |
Write a core dump (without crashing the program). More... | |
MainLoop::SignalHandleUP | m_sigchld_handle |
ArchSpec | m_arch |
MainLoop & | m_main_loop |
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. More... | |
IntelPTCollector | m_intel_pt_collector |
Manages Intel PT process and thread traces. More... | |
llvm::Error | TraceStart (llvm::StringRef json_request, llvm::StringRef type) override |
Tracing These methods implement the jLLDBTrace packets. More... | |
llvm::Error | TraceStop (const TraceStopRequest &request) override |
Stop tracing a live process or its threads. More... | |
llvm::Expected< llvm::json::Value > | TraceGetState (llvm::StringRef type) override |
Get the current tracing state of the process and its threads. More... | |
llvm::Expected< std::vector< uint8_t > > | TraceGetBinaryData (const TraceGetBinaryDataRequest &request) override |
Get binary data given a trace technology and a data identifier. More... | |
llvm::Expected< TraceSupportedResponse > | TraceSupported () override |
Get the processor tracing type supported for this process. More... | |
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 . More... | |
static Status | PtraceWrapper (int req, lldb::pid_t pid, void *addr=nullptr, void *data=nullptr, size_t data_size=0, long *result=nullptr) |
} More... | |
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, MainLoop &mainloop, llvm::ArrayRef<::pid_t > tids) | |
void | MonitorCallback (NativeThreadLinux &thread, WaitStatus status) |
void | WaitForCloneNotification (::pid_t pid) |
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. More... | |
Status | NotifyTracersOfNewThread (lldb::tid_t tid) |
Start tracing a new thread if process tracing is enabled. More... | |
Status | NotifyTracersOfThreadDestroyed (lldb::tid_t tid) |
Stop tracing threads upon a destroy event. More... | |
void | NotifyTracersProcessWillResume () override |
Notify tracers that the target process will resume. More... | |
void | NotifyTracersProcessDidStop () override |
Notify tracers that the target process just stopped. More... | |
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 . More... | |
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 40 of file NativeProcessLinux.h.
|
private |
Definition at line 310 of file NativeProcessLinux.cpp.
References AddThread(), EnsureFDFlags(), lldb::eStateStopped, m_sigchld_handle, lldb_private::NativeProcessProtocol::m_terminal_fd, O_NONBLOCK, lldb_private::MainLoop::RegisterSignal(), lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::NativeProcessProtocol::SetState(), SigchldHandler(), lldb_private::Status::Success(), and ThreadWasCreated().
Referenced by MonitorClone().
|
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 1698 of file NativeProcessLinux.cpp.
References lldb_private::Status::AsCString(), lldb::eStateRunning, lldb_private::Status::Fail(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::NativeProcessProtocol::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 1311 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 339 of file NativeProcessLinux.cpp.
References lldb_private::Host::FindProcessThreads(), lldb_private::Status::GetError(), lldb_private::GetLog(), LLDB_LOG, lldb_private::Process, PtraceWrapper(), SetDefaultPtraceOpts(), and lldb_private::Status::ToError().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1337 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 972 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::IntelPTCollector::Clear(), error(), lldb_private::Status::Fail(), lldb_private::NativeProcessProtocol::GetID(), LLDB_INVALID_PROCESS_ID, m_intel_pt_collector, m_sigchld_handle, and lldb_private::NativeProcessProtocol::m_threads.
|
private |
Definition at line 1636 of file NativeProcessLinux.cpp.
References LLDB_INVALID_THREAD_ID, and PtraceWrapper().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1218 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 91 of file NativeProcessLinux.h.
References m_arch.
Referenced by GetSoftwareBreakpointTrapOpcode().
|
inlineoverridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 110 of file NativeProcessLinux.h.
References lldb_private::NativeProcessProtocol::GetID(), and lldb_private::getProcFile().
NativeThreadLinux * NativeProcessLinux::GetCurrentThread | ( | ) |
Definition at line 1768 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 1631 of file NativeProcessLinux.cpp.
References message(), and PtraceWrapper().
Referenced by MonitorSIGTRAP().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1746 of file NativeProcessLinux.cpp.
References error(), LLDB_INVALID_ADDRESS, m_mem_region_cache, and PopulateMemoryRegionCache().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1726 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 1086 of file NativeProcessLinux.cpp.
References lldb_private::Range< B, S >::Contains(), lldb_private::eLazyBoolNo, 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 1627 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 1505 of file NativeProcessLinux.cpp.
References GetArchitecture(), and lldb_private::NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode().
NativeThreadLinux * NativeProcessLinux::GetThreadByID | ( | lldb::tid_t | id | ) |
Definition at line 1763 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::GetThreadByID().
Referenced by SigchldHandler().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 963 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetID(), and SIGSTOP.
|
private |
Definition at line 1643 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 1007 of file NativeProcessLinux.cpp.
References error(), lldb::eStateRunning, lldb::eStateStepping, lldb_private::NativeThreadProtocol::GetID(), lldb_private::NativeProcessProtocol::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 1050 of file NativeProcessLinux.cpp.
References error(), lldb::eStateAttaching, lldb::eStateConnected, lldb::eStateCrashed, lldb::eStateDetached, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateLaunching, lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb::eStateUnloaded, lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeProcessProtocol::m_state, lldb_private::Process, and SIGKILL.
|
private |
Definition at line 718 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 431 of file NativeProcessLinux.cpp.
References lldb_private::WaitStatus::Exit, lldb_private::NativeThreadProtocol::GetID(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), GetSignalInfo(), lldb_private::process_linux::NativeThreadLinux::GetState(), lldb_private::NativeProcessProtocol::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 SigchldHandler().
|
private |
Definition at line 835 of file NativeProcessLinux.cpp.
References AddThread(), lldb_private::NativeProcessProtocol::fork, lldb_private::NativeThreadProtocol::GetID(), lldb_private::NativeProcessProtocol::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_main_loop, lldb_private::NativeProcessProtocol::m_software_breakpoints, lldb_private::NativeProcessProtocol::m_terminal_fd, NativeProcessLinux(), lldb_private::NativeProcessProtocol::NativeDelegate::NewSubprocess(), lldb_private::Process, ResumeThread(), lldb_private::process_linux::NativeThreadLinux::SetStoppedByFork(), StopRunningThreads(), ThreadWasCreated(), lldb_private::NativeProcessProtocol::vfork, and WaitForCloneNotification().
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 748 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::NativeProcessProtocol::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 519 of file NativeProcessLinux.cpp.
References error(), lldb::eStateRunning, lldb_private::Status::Fail(), GetEventMessage(), lldb_private::NativeRegisterContext::GetHardwareBreakHitIndex(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::NativeProcessProtocol::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 708 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 733 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 1679 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 1688 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 1671 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 1675 of file NativeProcessLinux.cpp.
References m_intel_pt_collector, and lldb_private::process_linux::IntelPTCollector::ProcessWillResume().
Referenced by Resume().
|
private |
Definition at line 1155 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 1935 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::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 1527 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 1357 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 1497 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 897 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 1773 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 1489 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::SetHardwareBreakpoint(), and lldb_private::NativeProcessProtocol::SetSoftwareBreakpoint().
|
staticprivate |
Definition at line 403 of file NativeProcessLinux.cpp.
References PtraceWrapper().
Referenced by Attach().
|
private |
Definition at line 1897 of file NativeProcessLinux.cpp.
References lldb_private::WaitStatus::Exit, lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), GetThreadByID(), HandlePid(), LLDB_LOG, lldb_private::NativeProcessProtocol::m_threads, MonitorCallback(), lldb_private::Process, lldb_private::NativeProcessProtocol::SetExitStatus(), and lldb_private::WaitStatus::Signal.
Referenced by NativeProcessLinux().
|
overridevirtual |
Sends a process a UNIX signal signal.
Implements lldb_private::NativeProcessProtocol.
Definition at line 994 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 1832 of file NativeProcessLinux.cpp.
References lldb_private::Breakpoints, error(), lldb::eStateStopped, 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 1814 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 1656 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 891 of file NativeProcessLinux.cpp.
References lldb_private::ArchSpec::GetMachine(), lldb_private::ArchSpec::IsMIPS(), and m_arch.
|
protected |
Definition at line 1227 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 1860 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 2001 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 1995 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 1976 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 1989 of file NativeProcessLinux.cpp.
References m_intel_pt_collector, lldb_private::process_linux::IntelPTCollector::TraceStop(), lldb_private::NativeProcessProtocol::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 1970 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::IntelPTCollector::IsSupported(), and lldb_private::NativeProcessProtocol::TraceSupported().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1482 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::m_threads.
|
private |
Definition at line 498 of file NativeProcessLinux.cpp.
References lldb_private::WaitStatus::Decode(), lldb_private::GetLog(), LLDB_LOG, and lldb_private::Process.
Referenced by MonitorClone().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1581 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::GetLog(), k_ptrace_word_size, LLDB_LOG, lldb_private::Memory, PtraceWrapper(), and ReadMemory().
Referenced by Syscall().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1412 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 159 of file NativeProcessLinux.h.
Referenced by AllocateMemory(), and DeallocateMemory().
|
private |
Definition at line 150 of file NativeProcessLinux.h.
Referenced by GetArchitecture(), MonitorClone(), SupportHardwareSingleStepping(), and Syscall().
|
private |
Manages Intel PT process and thread traces.
Definition at line 248 of file NativeProcessLinux.h.
Referenced by Detach(), NotifyTracersOfNewThread(), NotifyTracersOfThreadDestroyed(), NotifyTracersProcessDidStop(), NotifyTracersProcessWillResume(), TraceGetBinaryData(), TraceGetState(), TraceStart(), and TraceStop().
|
private |
Definition at line 151 of file NativeProcessLinux.h.
Referenced by MonitorClone().
|
private |
Definition at line 154 of file NativeProcessLinux.h.
Referenced by DoStopIDBumped(), GetFileLoadAddress(), GetLoadedModuleFileSpec(), GetMemoryRegionInfo(), PopulateMemoryRegionCache(), and Syscall().
|
private |
Definition at line 156 of file NativeProcessLinux.h.
Referenced by MonitorSignal(), MonitorSIGTRAP(), ResumeThread(), SignalIfAllThreadsStopped(), StopRunningThreads(), and ThreadWasCreated().
|
private |
Definition at line 149 of file NativeProcessLinux.h.
Referenced by Detach(), and NativeProcessLinux().
|
private |
Definition at line 153 of file NativeProcessLinux.h.
Referenced by GetMemoryRegionInfo(), and PopulateMemoryRegionCache().