|
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 (const ProcessAddress &addr, void *buf, size_t size, size_t &bytes_read) override |
| Plugins without address spaces should error on a non-default one. | |
| Status | DoWriteMemory (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 |
| 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) |
| void | DoStopIDBumped (uint32_t newBumpId) override |
| Public Member Functions inherited from lldb_private::NativeProcessProtocol | |
| virtual | ~NativeProcessProtocol ()=default |
| virtual Status | IgnoreSignals (llvm::ArrayRef< int > signals) |
| virtual std::vector< AddressSpaceInfo > | GetAddressSpaces () |
| Served over the "jAddressSpacesInfo" packet. | |
| Status | ReadMemoryWithoutTrap (const ProcessAddress &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. | |
| Status | WriteMemory (lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written) |
| Write memory while not overwriting breakpoints in memory. | |
| virtual llvm::Expected< std::vector< LoadedLibraryInfo > > | GetLoadedLibraries () |
| Return the currently loaded libraries of the target in the qXfer:libraries:read form (generic name + base address pairs; used on Windows, where the inferior is not SVR4 and the module list comes from the PE loader). | |
| virtual bool | HasPendingLibraryEvents () |
| virtual bool | IsAlive () const |
| bool | HasSoftwareBreakpoint (lldb::addr_t addr) |
| 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 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 () |
| virtual size_t | WriteStdin (const void *buf, size_t len, Status &error) |
Write up to len bytes from buf to the inferior's stdin. | |
| uint32_t | GetStopID () const |
| virtual void | SetEnabledExtensions (Extension flags) |
| Method called in order to propagate the bitmap of protocol extensions supported by the client. | |
| virtual llvm::Expected< std::string > | SaveCore (llvm::StringRef path_hint) |
| Write a core dump (without crashing the program). | |
| virtual std::vector< std::string > | GetStructuredDataPlugins () |
| Get the list of structured data plugins supported by this process. | |
| Manager & | m_manager |
| ArchSpec | m_arch |
| LazyBool | m_supports_mem_region = eLazyBoolCalculate |
| 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.
|
private |
Definition at line 446 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::NativeProcessLinux::Manager::AddProcess(), AddThread(), EnsureFDFlags(), lldb::eStateStopped, m_arch, m_intel_pt_collector, m_manager, lldb_private::NativeProcessProtocol::m_terminal_fd, O_NONBLOCK, lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::NativeProcessProtocol::SetState(), lldb_private::Status::Success(), and ThreadWasCreated().
Referenced by lldb_private::process_linux::NativeProcessLinux::Manager::AddProcess(), lldb_private::process_linux::NativeProcessLinux::Manager::Attach(), lldb_private::process_linux::NativeProcessLinux::Manager::Launch(), MonitorClone(), lldb_private::process_linux::NativeProcessLinux::Manager::RemoveProcess(), and lldb_private::process_linux::NativeProcessLinux::Manager::SigchldHandler().
|
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 1808 of file NativeProcessLinux.cpp.
References lldb_private::Status::AsCString(), lldb::eStateRunning, lldb_private::Status::Fail(), 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(), SIGSTOP, StopRunningThreads(), and lldb_private::Thread.
Referenced by MonitorClone(), and NativeProcessLinux().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1422 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 468 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 1448 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 1089 of file NativeProcessLinux.cpp.
References lldb_private::Status::Clone(), 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 1746 of file NativeProcessLinux.cpp.
References LLDB_INVALID_THREAD_ID, PtraceWrapper(), and lldb_private::Status.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1691 of file NativeProcessLinux.cpp.
References DoWriteMemory(), error(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::GetLog(), k_ptrace_word_size, LLDB_LOG, lldb_private::Memory, PtraceWrapper(), and ReadMemory().
Referenced by DoWriteMemory(), and Syscall().
|
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 134 of file NativeProcessLinux.h.
References lldb_private::NativeProcessProtocol::GetID(), and lldb_private::getProcFile().
| NativeThreadLinux * NativeProcessLinux::GetCurrentThread | ( | ) |
Definition at line 1879 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 1741 of file NativeProcessLinux.cpp.
References PtraceWrapper().
Referenced by MonitorSIGTRAP().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1857 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromErrorString(), LLDB_INVALID_ADDRESS, lldb_private::NativeProcessELF::m_mem_region_cache, PopulateMemoryRegionCache(), and lldb_private::Status.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1836 of file NativeProcessLinux.cpp.
References lldb_private::FileSpec::Clear(), error(), lldb_private::Status::FromErrorStringWithFormatv(), lldb_private::FileSpec::GetFilename(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::FileSystem::Instance(), lldb_private::NativeProcessELF::m_mem_region_cache, PopulateMemoryRegionCache(), lldb_private::FileSystem::Resolve(), and lldb_private::Status.
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1204 of file NativeProcessLinux.cpp.
References lldb_private::Range< B, S >::Contains(), lldb_private::eLazyBoolNo, error(), lldb_private::Status::FromErrorString(), lldb_private::MemoryRegionInfo::GetRange(), lldb_private::Range< B, S >::GetRangeBase(), LLDB_INVALID_ADDRESS, lldb_private::NativeProcessELF::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 1737 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 1616 of file NativeProcessLinux.cpp.
References GetArchitecture(), and lldb_private::NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode().
| NativeThreadLinux * NativeProcessLinux::GetThreadByID | ( | lldb::tid_t | id | ) |
Definition at line 1874 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::GetThreadByID().
Referenced by TryHandleWaitStatus().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1080 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromErrno(), lldb_private::NativeProcessProtocol::GetID(), and SIGSTOP.
|
private |
Definition at line 1753 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 1125 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(), lldb_private::Status, and StopRunningThreads().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1168 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::Status::FromErrno(), 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::GetLog(), lldb_private::NativeRegisterContext::GetPC(), LLDB_LOG, lldb_private::NativeProcessSoftwareSingleStep::m_threads_stepping_with_breakpoint, lldb_private::Process, and StopRunningThreads().
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 578 of file NativeProcessLinux.cpp.
References lldb_private::WaitStatus::Exit, lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), GetSignalInfo(), 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 TryHandleWaitStatus().
|
private |
Definition at line 944 of file NativeProcessLinux.cpp.
References AddThread(), 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, NativeProcessLinux(), lldb_private::Process, ResumeThread(), lldb_private::process_linux::NativeThreadLinux::SetStoppedByFork(), StopRunningThreads(), ThreadWasCreated(), and lldb_private::NativeProcessProtocol::vfork.
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 857 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::Host::GetSignalAsCString(), 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(), SignalIfAllThreadsStopped(), SIGSTOP, lldb_private::StateIsStoppedState(), and StopRunningThreads().
Referenced by MonitorCallback(), and MonitorSIGTRAP().
|
private |
Definition at line 645 of file NativeProcessLinux.cpp.
References error(), lldb::eStateRunning, lldb_private::Status::Fail(), GetEventMessage(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), 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(), 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::GetLog(), LLDB_LOG, lldb_private::Process, and StopRunningThreads().
Referenced by MonitorSIGTRAP().
|
private |
Definition at line 842 of file NativeProcessLinux.cpp.
References lldb_private::GetLog(), LLDB_LOG, lldb_private::Process, 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 1789 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromError(), lldb_private::GetLog(), LLDB_LOG, m_intel_pt_collector, 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 1798 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromError(), lldb_private::GetLog(), LLDB_LOG, m_intel_pt_collector, and lldb_private::Thread.
Referenced by StopTrackingThread().
|
overrideprivatevirtual |
Notify tracers that the target process just stopped.
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1781 of file NativeProcessLinux.cpp.
References m_intel_pt_collector.
|
overrideprivatevirtual |
Notify tracers that the target process will resume.
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1785 of file NativeProcessLinux.cpp.
References m_intel_pt_collector.
Referenced by Resume().
|
private |
Definition at line 1273 of file NativeProcessLinux.cpp.
References lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::Status::Fail(), lldb_private::Status::FromError(), lldb_private::Status::FromErrorString(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::getProcFile(), lldb_private::FileSystem::Instance(), LLDB_LOG, lldb_private::NativeProcessELF::m_mem_region_cache, m_supports_mem_region, lldb_private::ParseLinuxMapRegions(), lldb_private::ParseLinuxSMapRegions(), lldb_private::Process, lldb_private::FileSystem::Resolve(), and lldb_private::Status.
Referenced by GetFileLoadAddress(), GetLoadedModuleFileSpec(), GetMemoryRegionInfo(), and Syscall().
|
static |
}
Definition at line 1986 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromErrno(), 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(), DoWriteMemory(), 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(), WriteMemoryTags(), and lldb_private::process_linux::NativeRegisterContextLinux::WriteRegisterSet().
|
overridevirtual |
Plugins without address spaces should error on a non-default one.
Implements lldb_private::NativeProcessProtocol.
Definition at line 1638 of file NativeProcessLinux.cpp.
References error(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::GetLog(), lldb_private::ProcessAddress::GetValue(), k_ptrace_word_size, LLDB_LOG, lldb_private::Memory, process_vm_readv(), ProcessVmReadvSupported(), PtraceWrapper(), and lldb_private::Status.
Referenced by DoWriteMemory(), and Syscall().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1468 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromError(), 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(), PtraceWrapper(), and lldb_private::Status.
Referenced by lldb_private::process_linux::NativeThreadLinux::AnnotateSyncTagCheckFault().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1608 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 1007 of file NativeProcessLinux.cpp.
References error(), lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb_private::Status::FromErrorStringWithFormat(), 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(), lldb_private::Status, and SupportHardwareSingleStepping().
|
private |
Definition at line 1884 of file NativeProcessLinux.cpp.
References lldb::eStateRunning, lldb::eStateStepping, lldb_private::GetLog(), LLDB_INVALID_THREAD_ID, LLDB_LOG, m_pending_notification_tid, lldb_private::NativeProcessProtocol::SetState(), lldb_private::Status::Success(), and lldb_private::Thread.
Referenced by AddThread(), MonitorCallback(), MonitorClone(), MonitorSignal(), MonitorSIGTRAP(), and Resume().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 1600 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::SetHardwareBreakpoint(), and lldb_private::NativeProcessProtocol::SetSoftwareBreakpoint().
|
staticprivate |
Definition at line 536 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 1112 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromErrno(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::Host::GetSignalAsCString(), LLDB_LOG, and lldb_private::Process.
|
private |
Definition at line 1943 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::NativeProcessSoftwareSingleStep::m_step_breakpoints, 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 1925 of file NativeProcessLinux.cpp.
References lldb_private::GetLog(), LLDB_LOG, m_pending_notification_tid, lldb_private::NativeProcessProtocol::m_threads, lldb_private::process_linux::NativeThreadLinux::RequestStop(), SignalIfAllThreadsStopped(), lldb_private::StateIsRunningState(), and lldb_private::Thread.
Referenced by AddThread(), Interrupt(), MonitorBreakpoint(), MonitorClone(), MonitorSignal(), MonitorSIGTRAP(), MonitorTrace(), and MonitorWatchpoint().
|
private |
Definition at line 1766 of file NativeProcessLinux.cpp.
References 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 1000 of file NativeProcessLinux.cpp.
References m_arch.
|
protected |
Definition at line 1337 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::NativeRegisterContextLinux::SyscallData::Args, DoWriteMemory(), lldb_private::eLazyBoolYes, lldb::eStateStopped, GetCurrentThread(), lldb_private::process_linux::NativeRegisterContextLinux::GetSyscallData(), lldb_private::process_linux::NativeRegisterContextLinux::SyscallData::Insn, m_arch, lldb_private::NativeProcessELF::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(), and lldb_private::NativeRegisterContext::WriteAllRegisterValues().
Referenced by AllocateMemory(), and DeallocateMemory().
|
private |
Definition at line 1972 of file NativeProcessLinux.cpp.
References lldb_private::GetLog(), LLDB_INVALID_THREAD_ID, LLDB_LOG, m_pending_notification_tid, 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 2052 of file NativeProcessLinux.cpp.
References 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 2046 of file NativeProcessLinux.cpp.
References 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 2027 of file NativeProcessLinux.cpp.
References m_intel_pt_collector, 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 2040 of file NativeProcessLinux.cpp.
References m_intel_pt_collector, 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 2021 of file NativeProcessLinux.cpp.
References lldb_private::process_linux::IntelPTCollector::IsSupported(), and lldb_private::NativeProcessProtocol::TraceSupported().
|
private |
Definition at line 563 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 1593 of file NativeProcessLinux.cpp.
References lldb_private::NativeProcessProtocol::m_threads.
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 1523 of file NativeProcessLinux.cpp.
References error(), lldb_private::Status::FromError(), GetCurrentThread(), lldb_private::NativeProcessProtocol::GetCurrentThreadID(), lldb_private::process_linux::NativeRegisterContextLinux::GetMemoryTaggingDetails(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::process_linux::NativeThreadLinux::GetRegisterContext(), PtraceWrapper(), and lldb_private::Status.
|
private |
Inferior memory (allocated by us) and its size.
Definition at line 181 of file NativeProcessLinux.h.
Referenced by AllocateMemory(), and DeallocateMemory().
|
private |
Definition at line 174 of file NativeProcessLinux.h.
Referenced by GetArchitecture(), MonitorClone(), NativeProcessLinux(), SupportHardwareSingleStepping(), and Syscall().
|
private |
Manages Intel PT process and thread traces.
Definition at line 270 of file NativeProcessLinux.h.
Referenced by Detach(), NativeProcessLinux(), NotifyTracersOfNewThread(), NotifyTracersOfThreadDestroyed(), NotifyTracersProcessDidStop(), NotifyTracersProcessWillResume(), TraceGetBinaryData(), TraceGetState(), TraceStart(), and TraceStop().
|
private |
Definition at line 173 of file NativeProcessLinux.h.
Referenced by MonitorClone(), NativeProcessLinux(), and ~NativeProcessLinux().
|
private |
Definition at line 178 of file NativeProcessLinux.h.
Referenced by MonitorSignal(), MonitorSIGTRAP(), ResumeThread(), SignalIfAllThreadsStopped(), StopRunningThreads(), and ThreadWasCreated().
|
private |
Definition at line 176 of file NativeProcessLinux.h.
Referenced by GetMemoryRegionInfo(), and PopulateMemoryRegionCache().