|
LLDB mainline
|
#include <DebuggerThread.h>
Public Member Functions | |
| DebuggerThread (DebugDelegateSP debug_delegate) | |
| virtual | ~DebuggerThread () |
| Status | DebugLaunch (const ProcessLaunchInfo &launch_info) |
| Status | DebugAttach (lldb::pid_t pid, const ProcessAttachInfo &attach_info) |
| HostProcess | GetProcess () const |
| HostThread | GetMainThread () const |
| const std::string & | GetImagePath () const |
| The path the process was created with, as recorded in its process parameters, or an empty string if it could not be read. | |
| ExceptionRecordSP | GetActiveException () |
| Returns the exception the debug loop is currently reporting, or null if there is none. | |
| Status | StopDebugging (bool terminate) |
| void | ContinueAsyncException (ExceptionResult result) |
| void | ContinueAsyncDllEvent () |
| Release a HandleLoadDllEvent / HandleUnloadDllEvent that is parked on m_dll_event_pred. | |
Private Member Functions | |
| void | FreeProcessHandles () |
| void | DebugLoop () |
| ExceptionResult | HandleExceptionEvent (const EXCEPTION_DEBUG_INFO &info, DWORD thread_id, bool shutting_down) |
| DWORD | HandleCreateThreadEvent (const CREATE_THREAD_DEBUG_INFO &info, DWORD thread_id) |
| DWORD | HandleCreateProcessEvent (const CREATE_PROCESS_DEBUG_INFO &info, DWORD thread_id) |
| DWORD | HandleExitThreadEvent (const EXIT_THREAD_DEBUG_INFO &info, DWORD thread_id) |
| DWORD | HandleExitProcessEvent (const EXIT_PROCESS_DEBUG_INFO &info, DWORD thread_id) |
| DWORD | HandleLoadDllEvent (const LOAD_DLL_DEBUG_INFO &info, DWORD thread_id) |
| DWORD | HandleUnloadDllEvent (const UNLOAD_DLL_DEBUG_INFO &info, DWORD thread_id) |
| DWORD | HandleODSEvent (const OUTPUT_DEBUG_STRING_INFO &info, DWORD thread_id) |
| DWORD | HandleRipEvent (const RIP_INFO &info, DWORD thread_id) |
| lldb::thread_result_t | DebuggerThreadLaunchRoutine (const ProcessLaunchInfo &launch_info) |
| lldb::thread_result_t | DebuggerThreadAttachRoutine (lldb::pid_t pid, const ProcessAttachInfo &launch_info) |
Private Attributes | |
| DebugDelegateSP | m_debug_delegate |
| HostProcess | m_process |
| HostThread | m_main_thread |
| HANDLE | m_image_file = nullptr |
| std::string | m_image_path |
| ExceptionRecordSP | m_active_exception |
| std::mutex | m_active_exception_mutex |
| Predicate< ExceptionResult > | m_exception_pred |
| Predicate< bool > | m_dll_event_pred |
| HANDLE | m_debugging_ended_event = nullptr |
| std::atomic< DWORD > | m_pid_to_detach |
| std::atomic< bool > | m_is_shutting_down |
| bool | m_detached = false |
Definition at line 28 of file DebuggerThread.h.
| DebuggerThread::DebuggerThread | ( | DebugDelegateSP | debug_delegate | ) |
Definition at line 74 of file DebuggerThread.cpp.
References InitializeWaitForDebugEvent(), m_debug_delegate, m_debugging_ended_event, m_is_shutting_down, and m_pid_to_detach.
|
virtual |
Definition at line 81 of file DebuggerThread.cpp.
References m_debugging_ended_event.
| void DebuggerThread::ContinueAsyncDllEvent | ( | ) |
Release a HandleLoadDllEvent / HandleUnloadDllEvent that is parked on m_dll_event_pred.
The delegate's Resume() path calls this to let the debug loop issue ContinueDebugEvent. Mirrors ContinueAsyncException.
Definition at line 265 of file DebuggerThread.cpp.
References lldb_private::eBroadcastAlways, and m_dll_event_pred.
Referenced by StopDebugging().
| void DebuggerThread::ContinueAsyncException | ( | ExceptionResult | result | ) |
Definition at line 250 of file DebuggerThread.cpp.
References lldb_private::eBroadcastAlways, lldb_private::Exception, lldb_private::GetLog(), LLDB_LOG, m_active_exception, m_active_exception_mutex, m_exception_pred, m_process, and lldb_private::Process.
Referenced by HandleExceptionEvent(), and StopDebugging().
| Status DebuggerThread::DebugAttach | ( | lldb::pid_t | pid, |
| const ProcessAttachInfo & | attach_info ) |
Definition at line 99 of file DebuggerThread.cpp.
References DebuggerThreadAttachRoutine(), lldb_private::Status::FromError(), lldb_private::GetLog(), lldb_private::ThreadLauncher::LaunchThread(), LLDB_LOG, and lldb_private::Process.
|
private |
Definition at line 144 of file DebuggerThread.cpp.
References DebugLoop(), lldb::eErrorTypeWin32, error(), lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, and lldb_private::Process.
Referenced by DebugAttach().
|
private |
Definition at line 117 of file DebuggerThread.cpp.
References DebugLoop(), error(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::GetLog(), lldb_private::FileSpec::GetPath(), lldb_private::ProcessLauncherWindows::LaunchProcess(), LLDB_LOG, m_debug_delegate, and lldb_private::Process.
Referenced by DebugLaunch().
| Status DebuggerThread::DebugLaunch | ( | const ProcessLaunchInfo & | launch_info | ) |
Definition at line 83 of file DebuggerThread.cpp.
References DebuggerThreadLaunchRoutine(), lldb_private::Status::FromError(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::GetLog(), lldb_private::FileSpec::GetPath(), lldb_private::ThreadLauncher::LaunchThread(), LLDB_LOG, and lldb_private::Process.
|
private |
Definition at line 278 of file DebuggerThread.cpp.
References lldb_private::Event, FreeProcessHandles(), g_wait_for_debug_event, lldb_private::GetLog(), HandleCreateProcessEvent(), HandleCreateThreadEvent(), HandleExceptionEvent(), HandleExitProcessEvent(), HandleExitThreadEvent(), HandleLoadDllEvent(), HandleODSEvent(), HandleRipEvent(), HandleUnloadDllEvent(), LLDB_LOG, LLDB_LOG_VERBOSE, m_debugging_ended_event, m_detached, m_is_shutting_down, m_pid_to_detach, m_process, MaskException, SendToApplication, and STATUS_WX86_BREAKPOINT.
Referenced by DebuggerThreadAttachRoutine(), and DebuggerThreadLaunchRoutine().
|
private |
Definition at line 269 of file DebuggerThread.cpp.
References m_image_file, m_main_thread, and m_process.
Referenced by DebugLoop().
| ExceptionRecordSP DebuggerThread::GetActiveException | ( | ) |
Returns the exception the debug loop is currently reporting, or null if there is none.
Safe to call from any thread.
Definition at line 245 of file DebuggerThread.cpp.
References m_active_exception, and m_active_exception_mutex.
Referenced by StopDebugging().
|
inline |
The path the process was created with, as recorded in its process parameters, or an empty string if it could not be read.
Set by the create-process event.
Definition at line 42 of file DebuggerThread.h.
References m_image_path.
|
inline |
Definition at line 37 of file DebuggerThread.h.
References m_main_thread.
|
inline |
Definition at line 36 of file DebuggerThread.h.
References m_process.
Referenced by StopDebugging().
|
private |
Definition at line 515 of file DebuggerThread.cpp.
References lldb_private::Event, GetImagePathFromPEB(), lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, m_image_file, m_image_path, m_main_thread, m_process, lldb_private::Process, and lldb_private::HostProcessWindows::SetOwnsHandle().
Referenced by DebugLoop().
|
private |
Definition at line 460 of file DebuggerThread.cpp.
References lldb_private::Event, lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, m_process, and lldb_private::Thread.
Referenced by DebugLoop().
|
private |
Definition at line 410 of file DebuggerThread.cpp.
References BreakInDebugger, ContinueAsyncException(), lldb_private::eBroadcastNever, lldb_private::Event, lldb_private::Exception, lldb_private::GetLog(), LLDB_LOG, m_active_exception, m_active_exception_mutex, m_debug_delegate, m_exception_pred, MaskException, SendToApplication, and STATUS_WX86_BREAKPOINT.
Referenced by DebugLoop().
|
private |
Definition at line 554 of file DebuggerThread.cpp.
References lldb_private::Event, lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, m_process, and lldb_private::Thread.
Referenced by DebugLoop().
|
private |
Definition at line 544 of file DebuggerThread.cpp.
References lldb_private::Event, lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, m_process, and lldb_private::Thread.
Referenced by DebugLoop().
|
private |
Definition at line 792 of file DebuggerThread.cpp.
References ContinueDebugLoop, lldb_private::eBroadcastNever, lldb_private::Event, GetFileNameFromHandleFallback(), GetFileNameFromImageNameField(), GetLoaderModuleName(), lldb_private::GetLog(), GetMappedFileDosPath(), LLDB_LOG, m_debug_delegate, m_dll_event_pred, m_is_shutting_down, m_process, ParkDebugLoop, and lldb_private::StripExtendedLengthPrefix().
Referenced by DebugLoop().
|
private |
Definition at line 888 of file DebuggerThread.cpp.
References m_debug_delegate.
Referenced by DebugLoop().
|
private |
Definition at line 898 of file DebuggerThread.cpp.
References lldb::eErrorTypeWin32, error(), lldb_private::Event, lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, and m_process.
Referenced by DebugLoop().
|
private |
Definition at line 873 of file DebuggerThread.cpp.
References lldb_private::eBroadcastNever, lldb_private::Event, lldb_private::GetLog(), LLDB_LOG, m_debug_delegate, m_dll_event_pred, m_is_shutting_down, m_process, and ParkDebugLoop.
Referenced by DebugLoop().
Definition at line 168 of file DebuggerThread.cpp.
References ContinueAsyncDllEvent(), ContinueAsyncException(), lldb::eErrorTypeWin32, error(), GetActiveException(), lldb_private::GetLog(), GetProcess(), lldb_private::HostProcess::GetProcessId(), LLDB_INVALID_PROCESS, LLDB_LOG, m_debugging_ended_event, m_is_shutting_down, m_pid_to_detach, m_process, MaskException, lldb_private::Process, and lldb_private::Status.
|
private |
Definition at line 86 of file DebuggerThread.h.
Referenced by ContinueAsyncException(), GetActiveException(), and HandleExceptionEvent().
|
private |
Definition at line 87 of file DebuggerThread.h.
Referenced by ContinueAsyncException(), GetActiveException(), and HandleExceptionEvent().
|
private |
Definition at line 76 of file DebuggerThread.h.
Referenced by DebuggerThread(), DebuggerThreadAttachRoutine(), DebuggerThreadLaunchRoutine(), HandleCreateProcessEvent(), HandleCreateThreadEvent(), HandleExceptionEvent(), HandleExitProcessEvent(), HandleExitThreadEvent(), HandleLoadDllEvent(), HandleODSEvent(), HandleRipEvent(), and HandleUnloadDllEvent().
|
private |
Definition at line 99 of file DebuggerThread.h.
Referenced by DebuggerThread(), DebugLoop(), StopDebugging(), and ~DebuggerThread().
|
private |
Definition at line 110 of file DebuggerThread.h.
Referenced by DebugLoop().
Definition at line 95 of file DebuggerThread.h.
Referenced by ContinueAsyncDllEvent(), HandleLoadDllEvent(), and HandleUnloadDllEvent().
|
private |
Definition at line 91 of file DebuggerThread.h.
Referenced by ContinueAsyncException(), and HandleExceptionEvent().
|
private |
Definition at line 82 of file DebuggerThread.h.
Referenced by FreeProcessHandles(), and HandleCreateProcessEvent().
|
private |
Definition at line 83 of file DebuggerThread.h.
Referenced by GetImagePath(), and HandleCreateProcessEvent().
|
private |
Definition at line 106 of file DebuggerThread.h.
Referenced by DebuggerThread(), DebugLoop(), HandleLoadDllEvent(), HandleUnloadDllEvent(), and StopDebugging().
|
private |
Definition at line 79 of file DebuggerThread.h.
Referenced by FreeProcessHandles(), GetMainThread(), and HandleCreateProcessEvent().
|
private |
Definition at line 102 of file DebuggerThread.h.
Referenced by DebuggerThread(), DebugLoop(), and StopDebugging().
|
private |
Definition at line 78 of file DebuggerThread.h.
Referenced by ContinueAsyncException(), DebugLoop(), FreeProcessHandles(), GetProcess(), HandleCreateProcessEvent(), HandleCreateThreadEvent(), HandleExitProcessEvent(), HandleExitThreadEvent(), HandleLoadDllEvent(), HandleRipEvent(), HandleUnloadDllEvent(), and StopDebugging().