|
LLDB mainline
|
#include <NativeProcessWindows.h>
Classes | |
| class | Manager |
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. | |
| Status | Interrupt () override |
| Tells a process to interrupt all operations as if by a Ctrl-C. | |
| Status | Kill () override |
| Status | IgnoreSignals (llvm::ArrayRef< int > signals) 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 |
| lldb::addr_t | GetSharedLibraryInfoAddress () override |
| bool | IsAlive () const override |
| size_t | UpdateThreads () override |
| const ArchSpec & | GetArchitecture () const override |
| void | SetArchitecture (const ArchSpec &arch_spec) |
| Status | SetBreakpoint (lldb::addr_t addr, uint32_t size, bool hardware) override |
| Status | RemoveBreakpoint (lldb::addr_t addr, bool hardware=false) override |
| llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > | GetAuxvData () const override |
| Status | GetLoadedModuleFileSpec (const char *module_path, FileSpec &file_spec) override |
| Status | GetFileLoadAddress (const llvm::StringRef &file_name, lldb::addr_t &load_addr) override |
| llvm::Expected< std::vector< LoadedLibraryInfo > > | GetLoadedLibraries () override |
| 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). | |
| bool | HasPendingLibraryEvents () override |
| void | OnExitProcess (uint32_t exit_code) override |
| void | OnDebuggerConnected (lldb::addr_t image_base) override |
| ExceptionResult | OnDebugException (bool first_chance, const ExceptionRecord &record) override |
| void | OnCreateThread (const HostThread &thread) override |
| void | OnExitThread (lldb::tid_t thread_id, uint32_t exit_code) override |
| void | OnLoadDll (const ModuleSpec &module_spec, lldb::addr_t module_addr) override |
| void | OnUnloadDll (lldb::addr_t module_addr) override |
| Public Member Functions inherited from lldb_private::NativeProcessProtocol | |
| virtual | ~NativeProcessProtocol ()=default |
| 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 llvm::Expected< std::vector< SVR4LibraryInfo > > | GetLoadedSVR4Libraries () |
| 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 () |
| uint32_t | GetStopID () const |
| 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). | |
| virtual std::vector< std::string > | GetStructuredDataPlugins () |
| Get the list of structured data plugins supported by this process. | |
| Public Member Functions inherited from lldb_private::ProcessDebugger | |
| virtual | ~ProcessDebugger () |
| virtual void | OnDebugString (const std::string &string) |
| virtual void | OnDebuggerError (const Status &error, uint32_t type) |
Private Member Functions | |
| NativeProcessWindows (ProcessLaunchInfo &launch_info, NativeDelegate &delegate, llvm::Error &E) | |
| NativeProcessWindows (lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate, llvm::Error &E) | |
| Status | CacheLoadedModules () |
Private Attributes | |
| ArchSpec | m_arch |
| std::map< lldb_private::FileSpec, lldb::addr_t > | m_loaded_modules |
| bool | m_pending_library_events = true |
| Set whenever an OS DLL load/unload event has been seen since the last stop reply. | |
Definition at line 30 of file NativeProcessWindows.h.
|
private |
Definition at line 48 of file NativeProcessWindows.cpp.
References GetArchitecture(), lldb_private::ProcessDebugger::GetDebuggedProcessId(), lldb_private::ProcessDebugger::LaunchProcess(), LLDB_INVALID_PROCESS_ID, m_arch, lldb_private::NativeProcessProtocol::NativeProcessProtocol(), lldb_private::NativeProcessProtocol::SetID(), and lldb_private::Status::ToError().
Referenced by lldb_private::NativeProcessWindows::Manager::Attach(), and lldb_private::NativeProcessWindows::Manager::Launch().
|
private |
Definition at line 65 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::AttachProcess(), lldb_private::ProcessInfo::GetArchitecture(), lldb_private::ProcessDebugger::GetDebuggedProcessId(), lldb_private::Host::GetProcessInfo(), m_arch, lldb_private::NativeProcessProtocol::NativeProcessProtocol(), lldb_private::NativeProcessProtocol::SetID(), lldb_private::ProcessInfo::SetProcessID(), and lldb_private::Status::ToError().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 227 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::AllocateMemory(), lldb_private::Status::Success(), and lldb_private::Status::ToError().
|
private |
Definition at line 343 of file NativeProcessWindows.cpp.
References lldb::eErrorTypeWin32, error(), lldb_private::AutoHandle::get(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::FileSystem::Instance(), lldb_private::AutoHandle::IsValid(), m_loaded_modules, lldb_private::FileSystem::Resolve(), and lldb_private::Status.
Referenced by GetFileLoadAddress(), GetLoadedLibraries(), and GetLoadedModuleFileSpec().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 235 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::DeallocateMemory(), and lldb_private::Status::ToError().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 173 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::DetachProcess(), error(), lldb::eStateDetached, lldb::eStateExited, lldb_private::Status::FromErrorStringWithFormatv(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::NativeProcessProtocol::GetState(), LLDB_LOG, lldb_private::Process, and lldb_private::NativeProcessProtocol::SetState().
|
protected |
Definition at line 322 of file NativeProcessWindows.cpp.
References lldb_private::NativeProcessProtocol::m_software_breakpoints.
Referenced by OnDebugException().
|
inlineoverridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 84 of file NativeProcessWindows.h.
References m_arch.
Referenced by GetSoftwareBreakpointTrapOpcode(), NativeProcessWindows(), lldb_private::NativeThreadWindows::NativeThreadWindows(), and OnDebuggerConnected().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 292 of file NativeProcessWindows.cpp.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 393 of file NativeProcessWindows.cpp.
References CacheLoadedModules(), error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::FileSpec::GetPath(), lldb_private::FileSystem::Instance(), LLDB_INVALID_ADDRESS, m_loaded_modules, lldb_private::FileSystem::Resolve(), and lldb_private::Status.
|
overridevirtual |
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).
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 414 of file NativeProcessWindows.cpp.
References lldb_private::LoadedLibraryInfo::base_addr, CacheLoadedModules(), error(), m_loaded_modules, and lldb_private::LoadedLibraryInfo::name.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 373 of file NativeProcessWindows.cpp.
References CacheLoadedModules(), error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::FileSpec::GetPath(), lldb_private::FileSystem::Instance(), m_loaded_modules, lldb_private::FileSystem::Resolve(), and lldb_private::Status.
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 211 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::GetMemoryRegionInfo().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 239 of file NativeProcessWindows.cpp.
|
overrideprotectedvirtual |
Return the offset of the PC relative to the software breakpoint that was hit.
If an architecture (e.g. arm) reports breakpoint hits before incrementing the PC, this offset will be 0. If an architecture (e.g. intel) reports breakpoints hits after incrementing the PC, this offset will be the size of the breakpoint opcode.
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 316 of file NativeProcessWindows.cpp.
References GetSoftwareBreakpointTrapOpcode().
Referenced by OnDebugException().
|
overrideprotectedvirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 298 of file NativeProcessWindows.cpp.
References GetArchitecture(), and lldb_private::NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode().
Referenced by GetSoftwareBreakpointPCOffset().
|
protected |
Definition at line 160 of file NativeProcessWindows.cpp.
References lldb_private::NativeProcessProtocol::GetThreadByID().
Referenced by OnDebugException(), OnExitThread(), and StopThread().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 165 of file NativeProcessWindows.cpp.
References lldb::eStateStopped, lldb_private::NativeProcessProtocol::GetState(), lldb_private::ProcessDebugger::HaltProcess(), and lldb_private::Status.
Referenced by Interrupt().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 429 of file NativeProcessWindows.cpp.
References m_pending_library_events.
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 207 of file NativeProcessWindows.cpp.
References lldb_private::Status.
|
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 200 of file NativeProcessWindows.cpp.
References Halt().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 241 of file NativeProcessWindows.cpp.
References lldb::eStateCrashed, lldb::eStateDetached, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateUnloaded, and lldb_private::NativeProcessProtocol::GetState().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 202 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::DestroyProcess(), and lldb_private::NativeProcessProtocol::GetState().
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 623 of file NativeProcessWindows.cpp.
References lldb_private::NativeProcessProtocol::GetWatchpointMap(), lldb_private::NativeWatchpoint::m_addr, lldb_private::NativeWatchpoint::m_hardware, lldb_private::ProcessDebugger::m_mutex, lldb_private::NativeWatchpoint::m_size, lldb_private::NativeProcessProtocol::m_threads, and lldb_private::NativeWatchpoint::m_watch_flags.
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 474 of file NativeProcessWindows.cpp.
References BreakInDebugger, error(), lldb::eStateStopped, lldb::eStopReasonBreakpoint, lldb::eStopReasonException, lldb::eStopReasonTrace, lldb::eStopReasonWatchpoint, lldb_private::Exception, FindSoftwareBreakpoint(), lldb_private::ExceptionRecord::GetExceptionAddress(), lldb_private::ExceptionRecord::GetExceptionArguments(), lldb_private::ExceptionRecord::GetExceptionCode(), lldb_private::GetLog(), GetSoftwareBreakpointPCOffset(), GetThreadByID(), lldb_private::ExceptionRecord::GetThreadID(), lldb_private::NativeRegisterContext::GetWatchpointAddress(), lldb_private::NativeRegisterContext::GetWatchpointHitAddress(), lldb_private::NativeRegisterContext::GetWatchpointHitIndex(), LLDB_INVALID_INDEX32, LLDB_LOG, lldb_private::ProcessDebugger::m_mutex, MaskException, lldb_private::ProcessDebugger::OnDebugException(), SendToApplication, lldb_private::NativeProcessProtocol::SetState(), SetStopReasonForThread(), STATUS_WX86_BREAKPOINT, and StopThread().
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 447 of file NativeProcessWindows.cpp.
References GetArchitecture(), lldb_private::ProcessInfo::GetArchitecture(), lldb_private::ProcessDebugger::GetDebuggedProcessId(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::Host::GetProcessInfo(), LLDB_INVALID_PROCESS_ID, LLDB_LOG, lldb_private::ProcessDebugger::m_session_data, lldb_private::NativeProcessProtocol::m_threads, lldb_private::Process, SetArchitecture(), and lldb_private::NativeProcessProtocol::SetID().
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 433 of file NativeProcessWindows.cpp.
References lldb::eStateExited, lldb_private::WaitStatus::Exit, lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::ProcessDebugger::OnExitProcess(), lldb_private::Process, lldb_private::NativeProcessProtocol::SetExitStatus(), and lldb_private::NativeProcessProtocol::SetState().
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 637 of file NativeProcessWindows.cpp.
References GetThreadByID(), lldb_private::ProcessDebugger::m_mutex, and lldb_private::NativeProcessProtocol::m_threads.
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 653 of file NativeProcessWindows.cpp.
References m_loaded_modules, and m_pending_library_events.
|
overridevirtual |
Reimplemented from lldb_private::ProcessDebugger.
Definition at line 659 of file NativeProcessWindows.cpp.
References m_loaded_modules, and m_pending_library_events.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 216 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::ReadMemory().
|
overridevirtual |
Reimplemented from lldb_private::NativeProcessProtocol.
Definition at line 336 of file NativeProcessWindows.cpp.
References lldb_private::NativeProcessProtocol::RemoveHardwareBreakpoint(), and lldb_private::NativeProcessProtocol::RemoveSoftwareBreakpoint().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 88 of file NativeProcessWindows.cpp.
References error(), lldb::eStateCrashed, lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb_private::Status::Fail(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::ResumeActionList::GetActionForThread(), lldb_private::ProcessDebugger::GetDebuggedProcessId(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::GetLog(), lldb_private::NativeProcessProtocol::GetState(), LLDB_LOG, lldb_private::ProcessDebugger::m_mutex, m_pending_library_events, lldb_private::ProcessDebugger::m_session_data, lldb_private::NativeProcessProtocol::m_threads, MaskException, lldb_private::Process, lldb_private::NativeProcessProtocol::SetState(), lldb_private::ResumeAction::state, and lldb_private::StateAsCString().
|
inline |
Definition at line 86 of file NativeProcessWindows.h.
References m_arch.
Referenced by OnDebuggerConnected().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 329 of file NativeProcessWindows.cpp.
References lldb_private::NativeProcessProtocol::SetHardwareBreakpoint(), and lldb_private::NativeProcessProtocol::SetSoftwareBreakpoint().
|
protected |
Definition at line 255 of file NativeProcessWindows.cpp.
References lldb_private::ThreadStopInfo::data_count, lldb_private::ThreadStopInfo::details, lldb::eStopReasonException, lldb_private::ThreadStopInfo::exception, lldb_private::ThreadStopInfo::reason, lldb_private::NativeProcessProtocol::SetCurrentThreadID(), lldb_private::ThreadStopInfo::signo, SIGTRAP, and lldb_private::ThreadStopInfo::type.
Referenced by OnDebugException(), and StopThread().
|
overridevirtual |
Sends a process a UNIX signal signal.
Implements lldb_private::NativeProcessProtocol.
Definition at line 193 of file NativeProcessWindows.cpp.
References error(), and lldb_private::Status::FromErrorString().
|
protected |
Definition at line 273 of file NativeProcessWindows.cpp.
References error(), GetThreadByID(), lldb_private::NativeProcessProtocol::m_threads, and SetStopReasonForThread().
Referenced by OnDebugException().
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 289 of file NativeProcessWindows.cpp.
References lldb_private::NativeProcessProtocol::m_threads.
|
overridevirtual |
Implements lldb_private::NativeProcessProtocol.
Definition at line 221 of file NativeProcessWindows.cpp.
References lldb_private::ProcessDebugger::WriteMemory().
|
private |
Definition at line 135 of file NativeProcessWindows.h.
Referenced by GetArchitecture(), NativeProcessWindows(), NativeProcessWindows(), and SetArchitecture().
|
private |
Definition at line 144 of file NativeProcessWindows.h.
Referenced by CacheLoadedModules(), GetFileLoadAddress(), GetLoadedLibraries(), GetLoadedModuleFileSpec(), OnLoadDll(), and OnUnloadDll().
|
private |
Set whenever an OS DLL load/unload event has been seen since the last stop reply.
Definition at line 148 of file NativeProcessWindows.h.
Referenced by HasPendingLibraryEvents(), OnLoadDll(), OnUnloadDll(), and Resume().