19#ifndef NAT_WINDOWS_NAT_H
20#define NAT_WINDOWS_NAT_H
26#include "gdbsupport/gdb_optional.h"
27#include "target/waitstatus.h"
29#define STATUS_WX86_BREAKPOINT 0x4000001F
30#define STATUS_WX86_SINGLE_STEP 0x4000001E
79 WOW64_CONTEXT wow64_context;
101 gdb::unique_xmalloc_ptr<char>
name;
175 bool wow64_process =
false;
177 bool ignore_first_breakpoint =
false;
228 (
struct target_waitstatus *ourstatus,
bool debug_exceptions);
270 void add_dll (LPVOID load_addr);
302 DWORD flags,
void *environment,
304 bool no_randomization,
305 STARTUPINFOA *startup_info,
306 PROCESS_INFORMATION *process_info);
308extern BOOL
create_process (
const wchar_t *image,
wchar_t *command_line,
309 DWORD flags,
void *environment,
310 const wchar_t *cur_dir,
311 bool no_randomization,
312 STARTUPINFOW *startup_info,
313 PROCESS_INFORMATION *process_info);
316#define AdjustTokenPrivileges dyn_AdjustTokenPrivileges
317#define DebugActiveProcessStop dyn_DebugActiveProcessStop
318#define DebugBreakProcess dyn_DebugBreakProcess
319#define DebugSetProcessKillOnExit dyn_DebugSetProcessKillOnExit
320#undef EnumProcessModules
321#define EnumProcessModules dyn_EnumProcessModules
322#undef EnumProcessModulesEx
323#define EnumProcessModulesEx dyn_EnumProcessModulesEx
324#undef GetModuleInformation
325#define GetModuleInformation dyn_GetModuleInformation
326#undef GetModuleFileNameExA
327#define GetModuleFileNameExA dyn_GetModuleFileNameExA
328#undef GetModuleFileNameExW
329#define GetModuleFileNameExW dyn_GetModuleFileNameExW
330#define LookupPrivilegeValueA dyn_LookupPrivilegeValueA
331#define OpenProcessToken dyn_OpenProcessToken
332#define GetConsoleFontSize dyn_GetConsoleFontSize
333#define GetCurrentConsoleFont dyn_GetCurrentConsoleFont
334#define Wow64SuspendThread dyn_Wow64SuspendThread
335#define Wow64GetThreadContext dyn_Wow64GetThreadContext
336#define Wow64SetThreadContext dyn_Wow64SetThreadContext
337#define Wow64GetThreadSelectorEntry dyn_Wow64GetThreadSelectorEntry
338#define GenerateConsoleCtrlEvent dyn_GenerateConsoleCtrlEvent
339#define InitializeProcThreadAttributeList dyn_InitializeProcThreadAttributeList
340#define UpdateProcThreadAttribute dyn_UpdateProcThreadAttribute
341#define DeleteProcThreadAttributeList dyn_DeleteProcThreadAttributeList
345 DWORD, PTOKEN_PRIVILEGES,
363typedef BOOL WINAPI (EnumProcessModulesEx_ftype) (HANDLE, HMODULE *, DWORD,
369 LPMODULEINFO, DWORD);
387 CONSOLE_FONT_INFO *);
394typedef DWORD WINAPI (Wow64SuspendThread_ftype) (HANDLE);
397typedef BOOL WINAPI (Wow64GetThreadContext_ftype) (HANDLE, PWOW64_CONTEXT);
400typedef BOOL WINAPI (Wow64SetThreadContext_ftype) (HANDLE,
401 const WOW64_CONTEXT *);
404typedef BOOL WINAPI (Wow64GetThreadSelectorEntry_ftype) (HANDLE, DWORD,
418 DWORD dwAttributeCount, DWORD dwFlags, PSIZE_T lpSize);
423 DWORD dwFlags, DWORD_PTR Attribute, PVOID lpValue, SIZE_T cbSize,
424 PVOID lpPreviousValue, PSIZE_T lpReturnSize);
GenerateConsoleCtrlEvent_ftype * GenerateConsoleCtrlEvent
DeleteProcThreadAttributeList_ftype * DeleteProcThreadAttributeList
GetCurrentConsoleFont_ftype * GetCurrentConsoleFont
GetModuleFileNameExA_ftype * GetModuleFileNameExA
BOOL WINAPI GetModuleInformation_ftype(HANDLE, HMODULE, LPMODULEINFO, DWORD)
BOOL WINAPI OpenProcessToken_ftype(HANDLE, DWORD, PHANDLE)
DWORD WINAPI GetModuleFileNameExW_ftype(HANDLE, HMODULE, LPWSTR, DWORD)
BOOL WINAPI GenerateConsoleCtrlEvent_ftype(DWORD, DWORD)
BOOL WINAPI UpdateProcThreadAttribute_ftype(gdb_lpproc_thread_attribute_list lpAttributeList, DWORD dwFlags, DWORD_PTR Attribute, PVOID lpValue, SIZE_T cbSize, PVOID lpPreviousValue, PSIZE_T lpReturnSize)
BOOL WINAPI LookupPrivilegeValueA_ftype(LPCSTR, LPCSTR, PLUID)
BOOL create_process(const char *image, char *command_line, DWORD flags, void *environment, const char *cur_dir, bool no_randomization, STARTUPINFOA *startup_info, PROCESS_INFORMATION *process_info)
DebugActiveProcessStop_ftype * DebugActiveProcessStop
BOOL WINAPI DebugBreakProcess_ftype(HANDLE)
bool initialize_loadable()
BOOL WINAPI GetCurrentConsoleFont_ftype(HANDLE, BOOL, CONSOLE_FONT_INFO *)
InitializeProcThreadAttributeList_ftype * InitializeProcThreadAttributeList
DebugBreakProcess_ftype * DebugBreakProcess
BOOL wait_for_debug_event(DEBUG_EVENT *event, DWORD timeout)
BOOL WINAPI AdjustTokenPrivileges_ftype(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD)
LookupPrivilegeValueA_ftype * LookupPrivilegeValueA
UpdateProcThreadAttribute_ftype * UpdateProcThreadAttribute
OpenProcessToken_ftype * OpenProcessToken
BOOL WINAPI DebugActiveProcessStop_ftype(DWORD)
GetConsoleFontSize_ftype * GetConsoleFontSize
DWORD WINAPI GetModuleFileNameExA_ftype(HANDLE, HMODULE, LPSTR, DWORD)
BOOL WINAPI EnumProcessModules_ftype(HANDLE, HMODULE *, DWORD, LPDWORD)
AdjustTokenPrivileges_ftype * AdjustTokenPrivileges
DebugSetProcessKillOnExit_ftype * DebugSetProcessKillOnExit
GetModuleFileNameExW_ftype * GetModuleFileNameExW
void * gdb_lpproc_thread_attribute_list
BOOL WINAPI InitializeProcThreadAttributeList_ftype(gdb_lpproc_thread_attribute_list lpAttributeList, DWORD dwAttributeCount, DWORD dwFlags, PSIZE_T lpSize)
@ HANDLE_EXCEPTION_IGNORED
@ HANDLE_EXCEPTION_HANDLED
@ HANDLE_EXCEPTION_UNHANDLED
void WINAPI DeleteProcThreadAttributeList_ftype(gdb_lpproc_thread_attribute_list lpAttributeList)
BOOL WINAPI DebugSetProcessKillOnExit_ftype(BOOL)
EnumProcessModules_ftype * EnumProcessModules
@ DONT_INVALIDATE_CONTEXT
BOOL continue_last_debug_event(DWORD continue_status, bool debug_events)
GetModuleInformation_ftype * GetModuleInformation
bool disable_randomization_available()
COORD WINAPI GetConsoleFontSize_ftype(HANDLE, DWORD)
bool matching_pending_stop(bool debug_events)
virtual windows_thread_info * thread_rec(ptid_t ptid, thread_disposition_type disposition)=0
gdb::optional< pending_stop > fetch_pending_stop(bool debug_events)
virtual void handle_load_dll(const char *dll_name, LPVOID base)=0
DWORD desired_stop_thread_id
void add_dll(LPVOID load_addr)
EXCEPTION_RECORD siginfo_er
virtual int handle_output_debug_string(struct target_waitstatus *ourstatus)=0
handle_exception_result handle_exception(struct target_waitstatus *ourstatus, bool debug_exceptions)
const char * pid_to_exec_file(int)
virtual void handle_unload_dll()=0
DEBUG_EVENT current_event
std::vector< pending_stop > pending_stops
bool handle_ms_vc_exception(const EXCEPTION_RECORD *rec)
virtual bool handle_access_violation(const EXCEPTION_RECORD *rec)=0
int get_exec_module_filename(char *exe_name_ret, size_t exe_name_max_len)
gdb::unique_xmalloc_ptr< char > name
DISABLE_COPY_AND_ASSIGN(windows_thread_info)
CORE_ADDR thread_local_base
const char * thread_name()
bool debug_registers_changed
windows_thread_info(DWORD tid_, HANDLE h_, CORE_ADDR tlb)
bool stopped_at_software_breakpoint
#define Wow64GetThreadSelectorEntry
#define Wow64SetThreadContext
#define EnumProcessModulesEx
#define Wow64GetThreadContext
#define Wow64SuspendThread