LLDB mainline
lldb_private::DebuggerThread Class Reference

#include <DebuggerThread.h>

Inheritance diagram for lldb_private::DebuggerThread:
[legend]

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 ReportDeferredStopAndWaitForResume ()
 Have the delegate report the stop it collected, then wait until the client resumes before taking the next debug event.
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
Guarded< 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

Detailed Description

Definition at line 29 of file DebuggerThread.h.

Constructor & Destructor Documentation

◆ DebuggerThread()

DebuggerThread::DebuggerThread ( DebugDelegateSP debug_delegate)

◆ ~DebuggerThread()

DebuggerThread::~DebuggerThread ( )
virtual

Definition at line 81 of file DebuggerThread.cpp.

References m_debugging_ended_event.

Member Function Documentation

◆ ContinueAsyncDllEvent()

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 271 of file DebuggerThread.cpp.

References lldb_private::eBroadcastAlways, and m_dll_event_pred.

Referenced by StopDebugging().

◆ ContinueAsyncException()

◆ DebugAttach()

◆ DebuggerThreadAttachRoutine()

lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine ( lldb::pid_t pid,
const ProcessAttachInfo & launch_info )
private

◆ DebuggerThreadLaunchRoutine()

◆ DebugLaunch()

◆ DebugLoop()

◆ FreeProcessHandles()

void DebuggerThread::FreeProcessHandles ( )
private

Definition at line 275 of file DebuggerThread.cpp.

References m_image_file, m_main_thread, and m_process.

Referenced by DebugLoop().

◆ GetActiveException()

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 244 of file DebuggerThread.cpp.

References m_active_exception, and m_active_exception_mutex.

Referenced by StopDebugging().

◆ GetImagePath()

const std::string & lldb_private::DebuggerThread::GetImagePath ( ) const
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 43 of file DebuggerThread.h.

References m_image_path.

◆ GetMainThread()

HostThread lldb_private::DebuggerThread::GetMainThread ( ) const
inline

Definition at line 38 of file DebuggerThread.h.

References m_main_thread.

◆ GetProcess()

◆ HandleCreateProcessEvent()

DWORD DebuggerThread::HandleCreateProcessEvent ( const CREATE_PROCESS_DEBUG_INFO & info,
DWORD thread_id )
private

◆ HandleCreateThreadEvent()

DWORD DebuggerThread::HandleCreateThreadEvent ( const CREATE_THREAD_DEBUG_INFO & info,
DWORD thread_id )
private

◆ HandleExceptionEvent()

◆ HandleExitProcessEvent()

DWORD DebuggerThread::HandleExitProcessEvent ( const EXIT_PROCESS_DEBUG_INFO & info,
DWORD thread_id )
private

◆ HandleExitThreadEvent()

DWORD DebuggerThread::HandleExitThreadEvent ( const EXIT_THREAD_DEBUG_INFO & info,
DWORD thread_id )
private

◆ HandleLoadDllEvent()

◆ HandleODSEvent()

DWORD DebuggerThread::HandleODSEvent ( const OUTPUT_DEBUG_STRING_INFO & info,
DWORD thread_id )
private

Definition at line 926 of file DebuggerThread.cpp.

References m_debug_delegate.

Referenced by DebugLoop().

◆ HandleRipEvent()

DWORD DebuggerThread::HandleRipEvent ( const RIP_INFO & info,
DWORD thread_id )
private

◆ HandleUnloadDllEvent()

DWORD DebuggerThread::HandleUnloadDllEvent ( const UNLOAD_DLL_DEBUG_INFO & info,
DWORD thread_id )
private

◆ ReportDeferredStopAndWaitForResume()

void DebuggerThread::ReportDeferredStopAndWaitForResume ( )
private

Have the delegate report the stop it collected, then wait until the client resumes before taking the next debug event.

Definition at line 264 of file DebuggerThread.cpp.

References lldb_private::eBroadcastNever, m_debug_delegate, m_dll_event_pred, and m_is_shutting_down.

Referenced by DebugLoop().

◆ StopDebugging()

Member Data Documentation

◆ m_active_exception

ExceptionRecordSP lldb_private::DebuggerThread::m_active_exception
private

◆ m_active_exception_mutex

std::mutex lldb_private::DebuggerThread::m_active_exception_mutex
private

◆ m_debug_delegate

◆ m_debugging_ended_event

HANDLE lldb_private::DebuggerThread::m_debugging_ended_event = nullptr
private

Definition at line 104 of file DebuggerThread.h.

Referenced by DebuggerThread(), DebugLoop(), StopDebugging(), and ~DebuggerThread().

◆ m_detached

bool lldb_private::DebuggerThread::m_detached = false
private

Definition at line 115 of file DebuggerThread.h.

Referenced by DebugLoop().

◆ m_dll_event_pred

Predicate<bool> lldb_private::DebuggerThread::m_dll_event_pred
private

◆ m_exception_pred

Predicate<ExceptionResult> lldb_private::DebuggerThread::m_exception_pred
private

Definition at line 96 of file DebuggerThread.h.

Referenced by ContinueAsyncException(), and HandleExceptionEvent().

◆ m_image_file

HANDLE lldb_private::DebuggerThread::m_image_file = nullptr
private

Definition at line 87 of file DebuggerThread.h.

Referenced by FreeProcessHandles(), and HandleCreateProcessEvent().

◆ m_image_path

std::string lldb_private::DebuggerThread::m_image_path
private

Definition at line 88 of file DebuggerThread.h.

Referenced by GetImagePath(), and HandleCreateProcessEvent().

◆ m_is_shutting_down

std::atomic<bool> lldb_private::DebuggerThread::m_is_shutting_down
private

◆ m_main_thread

HostThread lldb_private::DebuggerThread::m_main_thread
private

Definition at line 84 of file DebuggerThread.h.

Referenced by FreeProcessHandles(), GetMainThread(), and HandleCreateProcessEvent().

◆ m_pid_to_detach

std::atomic<DWORD> lldb_private::DebuggerThread::m_pid_to_detach
private

Definition at line 107 of file DebuggerThread.h.

Referenced by DebuggerThread(), DebugLoop(), and StopDebugging().

◆ m_process

Guarded<HostProcess> lldb_private::DebuggerThread::m_process
private

Definition at line 83 of file DebuggerThread.h.

Referenced by FreeProcessHandles(), GetProcess(), and HandleCreateProcessEvent().


The documentation for this class was generated from the following files: