|
LLDB mainline
|
#include <ProcessDebugger.h>
Public Member Functions | |
| virtual | ~ProcessDebugger () |
| virtual void | OnExitProcess (uint32_t exit_code) |
| virtual void | OnDebuggerConnected (lldb::addr_t image_base) |
| virtual ExceptionResult | OnDebugException (bool first_chance, const ExceptionRecord &record) |
| virtual void | OnCreateThread (const HostThread &thread) |
| virtual void | OnExitThread (lldb::tid_t thread_id, uint32_t exit_code) |
| virtual DllEventAction | OnLoadDll (const ModuleSpec &module_spec, lldb::addr_t module_addr, lldb::tid_t thread_id) |
| virtual DllEventAction | OnUnloadDll (lldb::addr_t module_addr, lldb::tid_t thread_id) |
| virtual void | OnDebugString (lldb::addr_t debug_string_addr, bool is_unicode, uint16_t length_lower_word) |
| virtual void | OnDebuggerError (const Status &error, uint32_t type) |
| bool | IsSystemModuleAddress (lldb::addr_t addr) |
Static Public Member Functions | |
| static bool | IsSystemDLL (llvm::StringRef path) |
Protected Member Functions | |
| Status | DetachProcess () |
| Status | LaunchProcess (ProcessLaunchInfo &launch_info, DebugDelegateSP delegate) |
| Status | AttachProcess (lldb::pid_t pid, const ProcessAttachInfo &attach_info, DebugDelegateSP delegate) |
| Status | DestroyProcess (lldb::StateType process_state) |
| void | EndDebugSession () |
| End the debug session, terminating the inferior if it still runs, and wait for the debugger thread to stop calling back into the delegate. | |
| Status | HaltProcess (bool &caused_stop) |
| Status | GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info) |
| Status | ReadMemory (lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read) |
| llvm::Error | ReadDebugString (lldb::addr_t debug_string_addr, bool is_unicode, uint16_t length_lower_word, llvm::SmallVectorImpl< char > &output) |
| Read an OUTPUT_DEBUG_STRING_INFO payload from the inferior. | |
| Status | WriteMemory (lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written) |
| Status | AllocateMemory (size_t size, uint32_t permissions, lldb::addr_t &addr) |
| Status | DeallocateMemory (lldb::addr_t addr) |
| lldb::pid_t | GetDebuggedProcessId () const |
| Status | WaitForDebuggerConnection (DebuggerThreadSP debugger, HostProcess &process) |
Protected Attributes | |
| llvm::sys::Mutex | m_mutex |
| std::unique_ptr< ProcessWindowsData > | m_session_data |
Definition at line 52 of file ProcessDebugger.h.
|
virtualdefault |
References error().
|
protected |
Definition at line 421 of file ProcessDebugger.cpp.
References ConvertLldbToWinApiProtect(), lldb::eErrorTypeWin32, error(), lldb_private::Status::FromErrorString(), lldb_private::GetLog(), lldb_private::HostProcess::GetNativeProcess(), lldb_private::HostNativeProcessBase::GetSystemHandle(), LLDB_INVALID_ADDRESS, LLDB_LOG, m_mutex, m_session_data, lldb_private::Memory, and lldb_private::Status.
Referenced by lldb_private::NativeProcessWindows::AllocateMemory(), and lldb_private::ProcessWindows::DoAllocateMemory().
|
protected |
Definition at line 239 of file ProcessDebugger.cpp.
References error(), lldb_private::ProcessAttachInfo::GetContinueOnceAttached(), lldb_private::GetLog(), LLDB_LOG, m_session_data, lldb_private::Process, and WaitForDebuggerConnection().
Referenced by lldb_private::ProcessWindows::DoAttachToProcessWithID(), and lldb_private::NativeProcessWindows::NativeProcessWindows().
|
protected |
Definition at line 450 of file ProcessDebugger.cpp.
References lldb::eErrorTypeWin32, lldb_private::Status::FromErrorString(), lldb_private::GetLog(), lldb_private::HostProcess::GetNativeProcess(), lldb_private::HostNativeProcessBase::GetSystemHandle(), LLDB_LOG, m_mutex, m_session_data, lldb_private::Memory, and lldb_private::Status.
Referenced by lldb_private::NativeProcessWindows::DeallocateMemory(), and lldb_private::ProcessWindows::DoDeallocateMemory().
|
protected |
Definition at line 279 of file ProcessDebugger.cpp.
References error(), lldb::eStateDetached, lldb::eStateExited, GetDebuggedProcessId(), lldb_private::GetLog(), LLDB_LOG, m_mutex, m_session_data, lldb_private::Process, and lldb_private::Status.
Referenced by lldb_private::ProcessWindows::DoDestroy(), and lldb_private::NativeProcessWindows::Kill().
|
protected |
Definition at line 142 of file ProcessDebugger.cpp.
References error(), lldb_private::GetLog(), LLDB_LOG, m_mutex, m_session_data, lldb_private::Process, and lldb_private::Status.
Referenced by lldb_private::NativeProcessWindows::Detach(), and lldb_private::ProcessWindows::DoDetach().
|
protected |
End the debug session, terminating the inferior if it still runs, and wait for the debugger thread to stop calling back into the delegate.
Definition at line 315 of file ProcessDebugger.cpp.
References m_mutex, and m_session_data.
Referenced by lldb_private::NativeProcessWindows::~NativeProcessWindows().
|
protected |
Definition at line 136 of file ProcessDebugger.cpp.
References LLDB_INVALID_PROCESS_ID, and m_session_data.
Referenced by DestroyProcess(), lldb_private::ProcessWindows::DoAttachToProcessWithID(), lldb_private::NativeProcessWindows::NativeProcessWindows(), lldb_private::NativeProcessWindows::NativeProcessWindows(), lldb_private::NativeProcessWindows::OnDebuggerConnected(), and lldb_private::NativeProcessWindows::Resume().
|
protected |
Definition at line 475 of file ProcessDebugger.cpp.
References lldb_private::MemoryRegionInfo::Clear(), lldb::eErrorTypeWin32, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, error(), lldb_private::Status::FromErrorString(), lldb_private::MemoryRegionInfo::GetExecutable(), lldb_private::GetLog(), lldb_private::HostProcess::GetNativeProcess(), lldb_private::MemoryRegionInfo::GetRange(), lldb_private::MemoryRegionInfo::GetReadable(), lldb_private::HostNativeProcessBase::GetSystemHandle(), lldb_private::MemoryRegionInfo::GetWritable(), IsPageExecutable(), IsPageReadable(), IsPageWritable(), LLDB_INVALID_ADDRESS, LLDB_INVALID_PROCESS, LLDB_LOG, LLDB_LOG_VERBOSE, m_mutex, m_session_data, lldb_private::Memory, 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 lldb_private::Status.
Referenced by lldb_private::ProcessWindows::DoGetMemoryRegionInfo(), lldb_private::NativeProcessWindows::GetMemoryRegionInfo(), and ReadMemory().
Definition at line 327 of file ProcessDebugger.cpp.
References lldb::eErrorTypeWin32, error(), lldb_private::Status::FromErrorString(), lldb_private::GetLog(), LLDB_LOG, m_mutex, m_session_data, lldb_private::Process, and lldb_private::Status.
Referenced by lldb_private::ProcessWindows::DoHalt(), and lldb_private::NativeProcessWindows::Halt().
|
static |
Definition at line 43 of file ProcessDebugger.cpp.
References MAX_PATH, NormalizeWindowsPathSeparators(), and lldb_private::StripExtendedLengthPrefix().
Referenced by IsSystemModuleAddress(), lldb_private::NativeProcessWindows::OnLoadDll(), and lldb_private::NativeProcessWindows::OnUnloadDll().
| bool ProcessDebugger::IsSystemModuleAddress | ( | lldb::addr_t | addr | ) |
Definition at line 70 of file ProcessDebugger.cpp.
References IsSystemDLL(), LLDB_INVALID_PROCESS, m_session_data, and MAX_PATH.
Referenced by lldb_private::NativeProcessWindows::HandleBreakpointException(), and lldb_private::ProcessWindows::OnDebugException().
|
protected |
Definition at line 173 of file ProcessDebugger.cpp.
References error(), lldb_private::Status::Fail(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::ProcessLaunchInfo::GetFlags(), lldb_private::GetLog(), lldb_private::FileSpec::GetPath(), lldb_private::HostProcess::GetProcessId(), lldb_private::StreamString::GetString(), lldb_private::ProcessLaunchInfo::GetWorkingDirectory(), lldb_private::FileSystem::Instance(), LLDB_LOG, m_session_data, lldb_private::Stream::Printf(), lldb_private::Process, lldb_private::FileSystem::Resolve(), lldb_private::ProcessInfo::SetProcessID(), lldb_private::Flags::Test(), and WaitForDebuggerConnection().
Referenced by lldb_private::ProcessWindows::DoLaunch(), and lldb_private::NativeProcessWindows::NativeProcessWindows().
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 615 of file ProcessDebugger.cpp.
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 580 of file ProcessDebugger.cpp.
References BreakInDebugger, lldb_private::Exception, lldb_private::ExceptionRecord::GetExceptionAddress(), lldb_private::ExceptionRecord::GetExceptionValue(), lldb_private::GetLog(), LLDB_LOG, m_mutex, m_session_data, and SendToApplication.
Referenced by lldb_private::NativeProcessWindows::OnDebugException().
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 577 of file ProcessDebugger.cpp.
|
virtual |
Reimplemented in lldb_private::ProcessWindows.
Definition at line 691 of file ProcessDebugger.cpp.
References error(), lldb_private::GetLog(), LLDB_LOG, m_mutex, m_session_data, and lldb_private::Process.
Referenced by OnExitProcess().
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 634 of file ProcessDebugger.cpp.
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 566 of file ProcessDebugger.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormatv(), m_session_data, and OnDebuggerError().
Referenced by lldb_private::NativeProcessWindows::OnExitProcess(), and lldb_private::ProcessWindows::OnExitProcess().
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 619 of file ProcessDebugger.cpp.
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 623 of file ProcessDebugger.cpp.
References ContinueDebugLoop.
|
virtual |
Reimplemented in lldb_private::NativeProcessWindows, and lldb_private::ProcessWindows.
Definition at line 629 of file ProcessDebugger.cpp.
References ContinueDebugLoop.
|
protected |
Read an OUTPUT_DEBUG_STRING_INFO payload from the inferior.
length_lower_word is the OS-supplied low 16 bits of the string length; the helper walks 64 KiB chunks (up to 1 MiB) until it finds the NUL terminator, then strips it. Shared between ProcessWindows (in-process) and NativeProcessWindows (lldb-server).
Definition at line 641 of file ProcessDebugger.cpp.
References error(), and ReadMemory().
Referenced by lldb_private::NativeProcessWindows::OnDebugString(), and lldb_private::ProcessWindows::OnDebugString().
|
protected |
Definition at line 348 of file ProcessDebugger.cpp.
References lldb::eErrorTypeWin32, lldb_private::eLazyBoolYes, error(), lldb_private::Status::FromErrorString(), lldb_private::GetLog(), lldb_private::MemoryRegionInfo::GetMapped(), GetMemoryRegionInfo(), lldb_private::MemoryRegionInfo::GetRange(), lldb_private::Range< B, S >::GetRangeEnd(), LLDB_LOG, m_mutex, m_session_data, lldb_private::Memory, ReadProcessMemory(), and lldb_private::Status.
Referenced by lldb_private::ProcessWindows::DoReadMemory(), ReadDebugString(), lldb_private::NativeProcessWindows::ReadMemory(), and lldb_private::NativeProcessWindows::RewindTrapOfRemovedBreakpoint().
|
protected |
Definition at line 723 of file ProcessDebugger.cpp.
References lldb_private::Breakpoints, lldb::eErrorTypeWin32, lldb_private::GetLog(), LLDB_LOG, m_session_data, lldb_private::Process, and lldb_private::Status.
Referenced by AttachProcess(), and LaunchProcess().
|
protected |
Definition at line 391 of file ProcessDebugger.cpp.
References lldb::eErrorTypeWin32, error(), lldb_private::Status::FromErrorString(), lldb_private::GetLog(), lldb_private::HostProcess::GetNativeProcess(), lldb_private::HostNativeProcessBase::GetSystemHandle(), LLDB_LOG, m_mutex, m_session_data, lldb_private::Memory, and lldb_private::Status.
Referenced by lldb_private::NativeProcessWindows::DoWriteMemory(), and lldb_private::ProcessWindows::DoWriteMemory().
|
protected |
Definition at line 121 of file ProcessDebugger.h.
Referenced by AllocateMemory(), DeallocateMemory(), DestroyProcess(), DetachProcess(), lldb_private::ProcessWindows::DidAttach(), lldb_private::ProcessWindows::DoResume(), EndDebugSession(), GetMemoryRegionInfo(), HaltProcess(), lldb_private::NativeProcessWindows::OnCreateThread(), lldb_private::ProcessWindows::OnCreateThread(), lldb_private::NativeProcessWindows::OnDebugException(), OnDebugException(), lldb_private::ProcessWindows::OnDebugException(), lldb_private::ProcessWindows::OnDebuggerConnected(), OnDebuggerError(), lldb_private::ProcessWindows::OnDebuggerError(), lldb_private::NativeProcessWindows::OnExitThread(), lldb_private::ProcessWindows::OnExitThread(), lldb_private::NativeProcessWindows::OnLoadDll(), lldb_private::NativeProcessWindows::OnUnloadDll(), ReadMemory(), lldb_private::ProcessWindows::RefreshStateAfterStop(), lldb_private::NativeProcessWindows::Resume(), and WriteMemory().
|
protected |
Definition at line 122 of file ProcessDebugger.h.
Referenced by AllocateMemory(), AttachProcess(), DeallocateMemory(), DestroyProcess(), DetachProcess(), lldb_private::ProcessWindows::DidAttach(), lldb_private::ProcessWindows::DoDetach(), lldb_private::ProcessWindows::DoResume(), lldb_private::ProcessWindows::DoUpdateThreadList(), EndDebugSession(), lldb_private::ProcessWindows::GetActiveExceptionCode(), GetDebuggedProcessId(), GetMemoryRegionInfo(), HaltProcess(), IsSystemModuleAddress(), LaunchProcess(), lldb_private::ProcessWindows::OnCreateThread(), OnDebugException(), lldb_private::ProcessWindows::OnDebugException(), lldb_private::NativeProcessWindows::OnDebuggerConnected(), lldb_private::ProcessWindows::OnDebuggerConnected(), OnDebuggerError(), lldb_private::ProcessWindows::OnDebuggerError(), lldb_private::NativeProcessWindows::OnExitProcess(), OnExitProcess(), lldb_private::ProcessWindows::OnExitThread(), ReadMemory(), lldb_private::ProcessWindows::RefreshStateAfterStop(), lldb_private::NativeProcessWindows::Resume(), WaitForDebuggerConnection(), and WriteMemory().