LLDB mainline
DebuggerThread.cpp File Reference
#include "DebuggerThread.h"
#include "ExceptionRecord.h"
#include "IDebugDelegate.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/ProcessLaunchInfo.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Host/windows/AutoHandle.h"
#include "lldb/Host/windows/HostProcessWindows.h"
#include "lldb/Host/windows/HostThreadWindows.h"
#include "lldb/Host/windows/ProcessLauncherWindows.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Predicate.h"
#include "lldb/Utility/Status.h"
#include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
#include "lldb/Utility/LLDBLog.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <pathcch.h>
#include <psapi.h>

Go to the source code of this file.

Macros

#define STATUS_WX86_BREAKPOINT   0x4000001FL

Typedefs

typedef BOOL WINAPI WaitForDebugEventFn(LPDEBUG_EVENT, DWORD)

Functions

static WaitForDebugEventFnGetWaitForDebugEventEx ()
static void InitializeWaitForDebugEvent ()
 WaitForDebugEventEx is only available on Windows 10+.
static std::optional< std::string > ConvertNtDevicePathToDosPath (llvm::ArrayRef< wchar_t > nt_path)
static std::optional< std::string > GetFileNameFromHandleFallback (HANDLE hFile)
static std::optional< std::string > GetFileNameByLoadAddress (HANDLE hProcess, LPVOID base_addr)
static std::optional< std::string > GetFileNameFromImageNameField (HANDLE hProcess, const LOAD_DLL_DEBUG_INFO &info)

Variables

static WaitForDebugEventFng_wait_for_debug_event = nullptr

Macro Definition Documentation

◆ STATUS_WX86_BREAKPOINT

Typedef Documentation

◆ WaitForDebugEventFn

typedef BOOL WINAPI WaitForDebugEventFn(LPDEBUG_EVENT, DWORD)

Definition at line 45 of file DebuggerThread.cpp.

Function Documentation

◆ ConvertNtDevicePathToDosPath()

std::optional< std::string > ConvertNtDevicePathToDosPath ( llvm::ArrayRef< wchar_t > nt_path)
static

◆ GetFileNameByLoadAddress()

std::optional< std::string > GetFileNameByLoadAddress ( HANDLE hProcess,
LPVOID base_addr )
static

◆ GetFileNameFromHandleFallback()

std::optional< std::string > GetFileNameFromHandleFallback ( HANDLE hFile)
static

◆ GetFileNameFromImageNameField()

std::optional< std::string > GetFileNameFromImageNameField ( HANDLE hProcess,
const LOAD_DLL_DEBUG_INFO & info )
static

Definition at line 619 of file DebuggerThread.cpp.

References ReadProcessMemory().

Referenced by lldb_private::DebuggerThread::HandleLoadDllEvent().

◆ GetWaitForDebugEventEx()

WaitForDebugEventFn * GetWaitForDebugEventEx ( )
static

◆ InitializeWaitForDebugEvent()

void InitializeWaitForDebugEvent ( )
static

WaitForDebugEventEx is only available on Windows 10+.

This lazily checks if the function is available and falls back to WaitForDebugEvent if unavailable. The -Ex version ensures correct forwarding of OutputDebugStringW events.

Definition at line 66 of file DebuggerThread.cpp.

References g_wait_for_debug_event, lldb_private::GetLog(), GetWaitForDebugEventEx(), lldb_private::Host, and LLDB_LOG.

Referenced by lldb_private::DebuggerThread::DebuggerThread().

Variable Documentation

◆ g_wait_for_debug_event

WaitForDebugEventFn* g_wait_for_debug_event = nullptr
static