GDB (xrefs)
Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/windows-nat.c File Reference
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "infrun.h"
#include "target.h"
#include "gdbcore.h"
#include "command.h"
#include "completer.h"
#include "regcache.h"
#include "top.h"
#include <signal.h>
#include <sys/types.h>
#include <fcntl.h>
#include <windows.h>
#include <imagehlp.h>
#include <psapi.h>
#include <algorithm>
#include "buildsym.h"
#include "filenames.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdb_bfd.h"
#include "gdb_obstack.h"
#include "gdbthread.h"
#include "gdbcmd.h"
#include <unistd.h>
#include "exec.h"
#include "solist.h"
#include "solib.h"
#include "xml-support.h"
#include "inttypes.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "windows-tdep.h"
#include "windows-nat.h"
#include "x86-nat.h"
#include "complaints.h"
#include "inf-child.h"
#include "gdb_tilde_expand.h"

Go to the source code of this file.

Classes

struct  windows_thread_info_struct
 
struct  xlate_exception
 
struct  safe_symbol_file_add_args
 
struct  lm_info_windows
 

Macros

#define AdjustTokenPrivileges   dyn_AdjustTokenPrivileges
 
#define DebugActiveProcessStop   dyn_DebugActiveProcessStop
 
#define DebugBreakProcess   dyn_DebugBreakProcess
 
#define DebugSetProcessKillOnExit   dyn_DebugSetProcessKillOnExit
 
#define EnumProcessModules   dyn_EnumProcessModules
 
#define GetModuleInformation   dyn_GetModuleInformation
 
#define LookupPrivilegeValueA   dyn_LookupPrivilegeValueA
 
#define OpenProcessToken   dyn_OpenProcessToken
 
#define GetConsoleFontSize   dyn_GetConsoleFontSize
 
#define GetCurrentConsoleFont   dyn_GetCurrentConsoleFont
 
#define __PMAX   (MAX_PATH + 1)
 
#define STARTUPINFO   STARTUPINFOA
 
#define CreateProcess   CreateProcessA
 
#define GetModuleFileNameEx_name   "GetModuleFileNameExA"
 
#define bad_GetModuleFileNameEx   bad_GetModuleFileNameExA
 
#define CONTEXT_EXTENDED_REGISTERS   0
 
#define CONTEXT_DEBUGGER_DR
 
#define DR6_CLEAR_VALUE   0xffff0ff0
 
#define MS_VC_EXCEPTION   0x406d1388
 
#define _CYGWIN_SIGNAL_STRING   "cYgSiGw00f"
 
#define CHECK(x)   check (x, __FILE__,__LINE__)
 
#define DEBUG_EXEC(x)   if (debug_exec) printf_unfiltered x
 
#define DEBUG_EVENTS(x)   if (debug_events) printf_unfiltered x
 
#define DEBUG_MEM(x)   if (debug_memory) printf_unfiltered x
 
#define DEBUG_EXCEPT(x)   if (debug_exceptions) printf_unfiltered x
 
#define DEBUG_EXCEPTION_SIMPLE(x)
 
#define GPA(m, func)   func = (func ## _ftype *) GetProcAddress (m, #func)
 

Typedefs

typedef BOOL WINAPI() AdjustTokenPrivileges_ftype(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD)
 
typedef BOOL WINAPI() DebugActiveProcessStop_ftype(DWORD)
 
typedef BOOL WINAPI() DebugBreakProcess_ftype(HANDLE)
 
typedef BOOL WINAPI() DebugSetProcessKillOnExit_ftype(BOOL)
 
typedef BOOL WINAPI() EnumProcessModules_ftype(HANDLE, HMODULE *, DWORD, LPDWORD)
 
typedef BOOL WINAPI() GetModuleInformation_ftype(HANDLE, HMODULE, LPMODULEINFO, DWORD)
 
typedef BOOL WINAPI() LookupPrivilegeValueA_ftype(LPCSTR, LPCSTR, PLUID)
 
typedef BOOL WINAPI() OpenProcessToken_ftype(HANDLE, DWORD, PHANDLE)
 
typedef BOOL WINAPI() GetCurrentConsoleFont_ftype(HANDLE, BOOL, CONSOLE_FONT_INFO *)
 
typedef COORD WINAPI() GetConsoleFontSize_ftype(HANDLE, DWORD)
 
typedef DWORD WINAPI() GetModuleFileNameEx_ftype(HANDLE, HMODULE, LPSTR, DWORD)
 
typedef struct windows_thread_info_struct windows_thread_info
 

Enumerations

enum  { FLAG_TRACE_BIT = 0x100 }
 
enum  handle_exception_result { HANDLE_EXCEPTION_UNHANDLED = 0, HANDLE_EXCEPTION_HANDLED, HANDLE_EXCEPTION_IGNORED }
 

Functions

static void windows_interrupt (struct target_ops *self, ptid_t)
 
static int windows_thread_alive (struct target_ops *, ptid_t)
 
static void windows_kill_inferior (struct target_ops *)
 
static void cygwin_set_dr (int i, CORE_ADDR addr)
 
static void cygwin_set_dr7 (unsigned long val)
 
static CORE_ADDR cygwin_get_dr (int i)
 
static unsigned long cygwin_get_dr6 (void)
 
static unsigned long cygwin_get_dr7 (void)
 
void windows_set_context_register_offsets (const int *offsets)
 
void windows_set_segment_register_p (segment_register_p_ftype *fun)
 
static void check (BOOL ok, const char *file, int line)
 
static windows_thread_infothread_rec (DWORD id, int get_context)
 
static windows_thread_infowindows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
 
static void windows_init_thread_list (void)
 
static void windows_delete_thread (ptid_t ptid, DWORD exit_code)
 
static void do_windows_fetch_inferior_registers (struct regcache *regcache, windows_thread_info *th, int r)
 
static void windows_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int r)
 
static void do_windows_store_inferior_registers (const struct regcache *regcache, windows_thread_info *th, int r)
 
static void windows_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int r)
 
static struct so_listwindows_make_so (const char *name, LPVOID load_addr)
 
static char * get_image_name (HANDLE h, void *address, int unicode)
 
static void handle_load_dll ()
 
static void windows_free_so (struct so_list *so)
 
static void handle_unload_dll ()
 
static void catch_errors (void(*func)())
 
static void windows_clear_solib (void)
 
static void signal_event_command (const char *args, int from_tty)
 
static int handle_output_debug_string (struct target_waitstatus *ourstatus)
 
static int display_selector (HANDLE thread, DWORD sel)
 
static void display_selectors (const char *args, int from_tty)
 
static handle_exception_result handle_exception (struct target_waitstatus *ourstatus)
 
static BOOL windows_continue (DWORD continue_status, int id, int killed)
 
static DWORD fake_create_process (void)
 
static void windows_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal sig)
 
static BOOL WINAPI ctrl_c_handler (DWORD event_type)
 
static int get_windows_debug_event (struct target_ops *ops, int pid, struct target_waitstatus *ourstatus)
 
static ptid_t windows_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *ourstatus, int options)
 
static void windows_add_all_dlls (void)
 
static void do_initial_windows_stuff (struct target_ops *ops, DWORD pid, int attaching)
 
static int set_process_privilege (const char *privilege, BOOL enable)
 
static void windows_attach (struct target_ops *ops, const char *args, int from_tty)
 
static void windows_detach (struct target_ops *ops, const char *args, int from_tty)
 
static int windows_get_exec_module_filename (char *exe_name_ret, size_t exe_name_max_len)
 
static char * windows_pid_to_exec_file (struct target_ops *self, int pid)
 
static void windows_files_info (struct target_ops *ignore)
 
static void windows_set_console_info (STARTUPINFO *si, DWORD *flags)
 
static int envvar_cmp (const void *a, const void *b)
 
static int redir_open (const char *redir_string, int *inp, int *out, int *err)
 
static int redir_set_redirection (const char *s, int *inp, int *out, int *err)
 
static bool redirect_inferior_handles (const char *cmd_orig, char *cmd, int *inp, int *out, int *err)
 
static void windows_create_inferior (struct target_ops *ops, const char *exec_file, const std::string &origallargs, char **in_env, int from_tty)
 
static void windows_mourn_inferior (struct target_ops *ops)
 
static enum target_xfer_status windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
 
static void windows_close (struct target_ops *self)
 
static const char * windows_pid_to_str (struct target_ops *ops, ptid_t ptid)
 
static enum target_xfer_status windows_xfer_shared_libraries (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static enum target_xfer_status windows_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static int windows_get_tib_address (struct target_ops *self, ptid_t ptid, CORE_ADDR *addr)
 
static ptid_t windows_get_ada_task_ptid (struct target_ops *self, long lwp, long thread)
 
static const char * windows_thread_name (struct target_ops *self, struct thread_info *thr)
 
static struct target_opswindows_target (void)
 
void _initialize_windows_nat (void)
 
void _initialize_check_for_gdb_ini (void)
 
static BOOL WINAPI bad_DebugActiveProcessStop (DWORD w)
 
static BOOL WINAPI bad_DebugBreakProcess (HANDLE w)
 
static BOOL WINAPI bad_DebugSetProcessKillOnExit (BOOL w)
 
static BOOL WINAPI bad_EnumProcessModules (HANDLE w, HMODULE *x, DWORD y, LPDWORD z)
 
static DWORD WINAPI bad_GetModuleFileNameExA (HANDLE w, HMODULE x, LPSTR y, DWORD z)
 
static BOOL WINAPI bad_GetModuleInformation (HANDLE w, HMODULE x, LPMODULEINFO y, DWORD z)
 
static BOOL WINAPI bad_OpenProcessToken (HANDLE w, DWORD x, PHANDLE y)
 
static BOOL WINAPI bad_GetCurrentConsoleFont (HANDLE w, BOOL bMaxWindow, CONSOLE_FONT_INFO *f)
 
static COORD WINAPI bad_GetConsoleFontSize (HANDLE w, DWORD nFont)
 
void _initialize_loadable (void)
 

Variables

static AdjustTokenPrivileges_ftypeAdjustTokenPrivileges
 
static DebugActiveProcessStop_ftypeDebugActiveProcessStop
 
static DebugBreakProcess_ftypeDebugBreakProcess
 
static DebugSetProcessKillOnExit_ftypeDebugSetProcessKillOnExit
 
static EnumProcessModules_ftypeEnumProcessModules
 
static GetModuleInformation_ftypeGetModuleInformation
 
static LookupPrivilegeValueA_ftypeLookupPrivilegeValueA
 
static OpenProcessToken_ftypeOpenProcessToken
 
static GetCurrentConsoleFont_ftypeGetCurrentConsoleFont
 
static GetConsoleFontSize_ftypeGetConsoleFontSize
 
static GetModuleFileNameEx_ftypeGetModuleFileNameEx
 
static int have_saved_context
 
static CONTEXT saved_context
 
static uintptr_t dr [8]
 
static int debug_registers_changed
 
static int debug_registers_used
 
static int windows_initialization_done
 
static enum gdb_signal last_sig = GDB_SIGNAL_0
 
static windows_thread_info thread_head
 
static DEBUG_EVENT current_event
 
static HANDLE current_process_handle
 
static windows_thread_infocurrent_thread
 
static DWORD main_thread_id
 
static int exception_count = 0
 
static int event_count = 0
 
static int saw_create
 
static int open_process_used = 0
 
static int new_console = 0
 
static int new_group = 1
 
static int debug_exec = 0
 
static int debug_events = 0
 
static int debug_memory = 0
 
static int debug_exceptions = 0
 
static int useshell = 0
 
static const int * mappings
 
static segment_register_p_ftypesegment_register_p
 
static const struct xlate_exception xlate []
 
static struct so_list solib_start * solib_end
 

Macro Definition Documentation

◆ __PMAX

#define __PMAX   (MAX_PATH + 1)

◆ _CYGWIN_SIGNAL_STRING

#define _CYGWIN_SIGNAL_STRING   "cYgSiGw00f"

Definition at line 195 of file windows-nat.c.

Referenced by handle_output_debug_string().

◆ AdjustTokenPrivileges

#define AdjustTokenPrivileges   dyn_AdjustTokenPrivileges

Definition at line 72 of file windows-nat.c.

Referenced by _initialize_loadable(), and set_process_privilege().

◆ bad_GetModuleFileNameEx

#define bad_GetModuleFileNameEx   bad_GetModuleFileNameExA

Definition at line 130 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ CHECK

#define CHECK (   x)    check (x, __FILE__,__LINE__)

◆ CONTEXT_DEBUGGER_DR

#define CONTEXT_DEBUGGER_DR
Value:
CONTEXT_FULL | CONTEXT_FLOATING_POINT \
| CONTEXT_SEGMENTS | CONTEXT_DEBUG_REGISTERS \
#define CONTEXT_EXTENDED_REGISTERS
Definition: windows-nat.c:165

Definition at line 168 of file windows-nat.c.

Referenced by do_windows_fetch_inferior_registers().

◆ CONTEXT_EXTENDED_REGISTERS

#define CONTEXT_EXTENDED_REGISTERS   0

Definition at line 165 of file windows-nat.c.

◆ CreateProcess

#define CreateProcess   CreateProcessA

Definition at line 128 of file windows-nat.c.

Referenced by windows_create_inferior().

◆ DEBUG_EVENTS

#define DEBUG_EVENTS (   x)    if (debug_events) printf_unfiltered x

◆ DEBUG_EXCEPT

#define DEBUG_EXCEPT (   x)    if (debug_exceptions) printf_unfiltered x

Definition at line 202 of file windows-nat.c.

Referenced by windows_resume().

◆ DEBUG_EXCEPTION_SIMPLE

#define DEBUG_EXCEPTION_SIMPLE (   x)
Value:
printf_unfiltered ("gdb: Target exception %s at %s\n", x, \
current_event.u.Exception.ExceptionRecord.ExceptionAddress))
static int debug_exceptions
Definition: windows-nat.c:258
static DEBUG_EVENT current_event
Definition: windows-nat.c:237

Definition at line 1061 of file windows-nat.c.

Referenced by handle_exception().

◆ DEBUG_EXEC

#define DEBUG_EXEC (   x)    if (debug_exec) printf_unfiltered x

Definition at line 199 of file windows-nat.c.

Referenced by windows_resume().

◆ DEBUG_MEM

#define DEBUG_MEM (   x)    if (debug_memory) printf_unfiltered x

Definition at line 201 of file windows-nat.c.

Referenced by windows_xfer_memory().

◆ DebugActiveProcessStop

#define DebugActiveProcessStop   dyn_DebugActiveProcessStop

Definition at line 73 of file windows-nat.c.

Referenced by _initialize_loadable(), and windows_detach().

◆ DebugBreakProcess

#define DebugBreakProcess   dyn_DebugBreakProcess

Definition at line 74 of file windows-nat.c.

Referenced by _initialize_loadable(), and ctrl_c_handler().

◆ DebugSetProcessKillOnExit

#define DebugSetProcessKillOnExit   dyn_DebugSetProcessKillOnExit

Definition at line 75 of file windows-nat.c.

Referenced by _initialize_loadable(), windows_attach(), and windows_detach().

◆ DR6_CLEAR_VALUE

#define DR6_CLEAR_VALUE   0xffff0ff0

Definition at line 177 of file windows-nat.c.

Referenced by windows_add_thread(), windows_continue(), and windows_resume().

◆ EnumProcessModules

#define EnumProcessModules   dyn_EnumProcessModules

◆ GetConsoleFontSize

#define GetConsoleFontSize   dyn_GetConsoleFontSize

Definition at line 80 of file windows-nat.c.

Referenced by _initialize_loadable(), and windows_set_console_info().

◆ GetCurrentConsoleFont

#define GetCurrentConsoleFont   dyn_GetCurrentConsoleFont

Definition at line 81 of file windows-nat.c.

Referenced by _initialize_loadable(), and windows_set_console_info().

◆ GetModuleFileNameEx_name

#define GetModuleFileNameEx_name   "GetModuleFileNameExA"

Definition at line 129 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ GetModuleInformation

#define GetModuleInformation   dyn_GetModuleInformation

Definition at line 77 of file windows-nat.c.

Referenced by _initialize_loadable(), and windows_add_all_dlls().

◆ GPA

#define GPA (   m,
  func 
)    func = (func ## _ftype *) GetProcAddress (m, #func)

Referenced by _initialize_loadable().

◆ LookupPrivilegeValueA

#define LookupPrivilegeValueA   dyn_LookupPrivilegeValueA

Definition at line 78 of file windows-nat.c.

Referenced by _initialize_loadable(), and set_process_privilege().

◆ MS_VC_EXCEPTION

#define MS_VC_EXCEPTION   0x406d1388

Definition at line 183 of file windows-nat.c.

Referenced by handle_exception().

◆ OpenProcessToken

#define OpenProcessToken   dyn_OpenProcessToken

Definition at line 79 of file windows-nat.c.

Referenced by _initialize_loadable(), and set_process_privilege().

◆ STARTUPINFO

#define STARTUPINFO   STARTUPINFOA

Definition at line 127 of file windows-nat.c.

Referenced by windows_create_inferior().

Typedef Documentation

◆ AdjustTokenPrivileges_ftype

typedef BOOL WINAPI() AdjustTokenPrivileges_ftype(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD)

Definition at line 83 of file windows-nat.c.

◆ DebugActiveProcessStop_ftype

typedef BOOL WINAPI() DebugActiveProcessStop_ftype(DWORD)

Definition at line 89 of file windows-nat.c.

◆ DebugBreakProcess_ftype

typedef BOOL WINAPI() DebugBreakProcess_ftype(HANDLE)

Definition at line 92 of file windows-nat.c.

◆ DebugSetProcessKillOnExit_ftype

typedef BOOL WINAPI() DebugSetProcessKillOnExit_ftype(BOOL)

Definition at line 95 of file windows-nat.c.

◆ EnumProcessModules_ftype

typedef BOOL WINAPI() EnumProcessModules_ftype(HANDLE, HMODULE *, DWORD, LPDWORD)

Definition at line 98 of file windows-nat.c.

◆ GetConsoleFontSize_ftype

typedef COORD WINAPI() GetConsoleFontSize_ftype(HANDLE, DWORD)

Definition at line 116 of file windows-nat.c.

◆ GetCurrentConsoleFont_ftype

typedef BOOL WINAPI() GetCurrentConsoleFont_ftype(HANDLE, BOOL, CONSOLE_FONT_INFO *)

Definition at line 112 of file windows-nat.c.

◆ GetModuleFileNameEx_ftype

typedef DWORD WINAPI() GetModuleFileNameEx_ftype(HANDLE, HMODULE, LPSTR, DWORD)

Definition at line 125 of file windows-nat.c.

◆ GetModuleInformation_ftype

typedef BOOL WINAPI() GetModuleInformation_ftype(HANDLE, HMODULE, LPMODULEINFO, DWORD)

Definition at line 102 of file windows-nat.c.

◆ LookupPrivilegeValueA_ftype

typedef BOOL WINAPI() LookupPrivilegeValueA_ftype(LPCSTR, LPCSTR, PLUID)

Definition at line 106 of file windows-nat.c.

◆ OpenProcessToken_ftype

typedef BOOL WINAPI() OpenProcessToken_ftype(HANDLE, DWORD, PHANDLE)

Definition at line 109 of file windows-nat.c.

◆ windows_thread_info

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FLAG_TRACE_BIT 

Definition at line 156 of file windows-nat.c.

◆ handle_exception_result

Enumerator
HANDLE_EXCEPTION_UNHANDLED 
HANDLE_EXCEPTION_HANDLED 
HANDLE_EXCEPTION_IGNORED 

Definition at line 185 of file windows-nat.c.

Function Documentation

◆ _initialize_check_for_gdb_ini()

void _initialize_check_for_gdb_ini ( void  )

Definition at line 3164 of file windows-nat.c.

References _, inhibit_gdbinit, warning(), and xsnprintf().

◆ _initialize_loadable()

void _initialize_loadable ( void  )

◆ _initialize_windows_nat()

void _initialize_windows_nat ( void  )

◆ bad_DebugActiveProcessStop()

static BOOL WINAPI bad_DebugActiveProcessStop ( DWORD  w)
static

Definition at line 3196 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ bad_DebugBreakProcess()

static BOOL WINAPI bad_DebugBreakProcess ( HANDLE  w)
static

Definition at line 3201 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ bad_DebugSetProcessKillOnExit()

static BOOL WINAPI bad_DebugSetProcessKillOnExit ( BOOL  w)
static

Definition at line 3206 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ bad_EnumProcessModules()

static BOOL WINAPI bad_EnumProcessModules ( HANDLE  w,
HMODULE *  x,
DWORD  y,
LPDWORD  z 
)
static

Definition at line 3211 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ bad_GetConsoleFontSize()

static COORD WINAPI bad_GetConsoleFontSize ( HANDLE  w,
DWORD  nFont 
)
static

Definition at line 3249 of file windows-nat.c.

References size.

Referenced by _initialize_loadable().

◆ bad_GetCurrentConsoleFont()

static BOOL WINAPI bad_GetCurrentConsoleFont ( HANDLE  w,
BOOL  bMaxWindow,
CONSOLE_FONT_INFO *  f 
)
static

Definition at line 3243 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ bad_GetModuleFileNameExA()

static DWORD WINAPI bad_GetModuleFileNameExA ( HANDLE  w,
HMODULE  x,
LPSTR  y,
DWORD  z 
)
static

Definition at line 3224 of file windows-nat.c.

◆ bad_GetModuleInformation()

static BOOL WINAPI bad_GetModuleInformation ( HANDLE  w,
HMODULE  x,
LPMODULEINFO  y,
DWORD  z 
)
static

Definition at line 3231 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ bad_OpenProcessToken()

static BOOL WINAPI bad_OpenProcessToken ( HANDLE  w,
DWORD  x,
PHANDLE  y 
)
static

Definition at line 3237 of file windows-nat.c.

Referenced by _initialize_loadable().

◆ catch_errors()

static void catch_errors ( void(*)()  func)
static

Definition at line 840 of file windows-nat.c.

References CATCH, END_CATCH, exception_print(), func, gdb_stderr, RETURN_MASK_ALL, and TRY.

Referenced by get_windows_debug_event().

◆ check()

static void check ( BOOL  ok,
const char *  file,
int  line 
)
static

◆ ctrl_c_handler()

static BOOL WINAPI ctrl_c_handler ( DWORD  event_type)
static

◆ cygwin_get_dr()

static CORE_ADDR cygwin_get_dr ( int  i)
static

Definition at line 3124 of file windows-nat.c.

References dr.

Referenced by _initialize_windows_nat().

◆ cygwin_get_dr6()

static unsigned long cygwin_get_dr6 ( void  )
static

Definition at line 3133 of file windows-nat.c.

References dr.

Referenced by _initialize_windows_nat().

◆ cygwin_get_dr7()

static unsigned long cygwin_get_dr7 ( void  )
static

Definition at line 3143 of file windows-nat.c.

References dr.

Referenced by _initialize_windows_nat().

◆ cygwin_set_dr()

static void cygwin_set_dr ( int  i,
CORE_ADDR  addr 
)
static

Definition at line 3100 of file windows-nat.c.

References _, debug_registers_changed, debug_registers_used, dr, and internal_error().

Referenced by _initialize_windows_nat().

◆ cygwin_set_dr7()

static void cygwin_set_dr7 ( unsigned long  val)
static

Definition at line 3114 of file windows-nat.c.

References debug_registers_changed, debug_registers_used, and dr.

Referenced by _initialize_windows_nat().

◆ display_selector()

static int display_selector ( HANDLE  thread,
DWORD  sel 
)
static

Definition at line 947 of file windows-nat.c.

References err, if(), printf_filtered(), and puts_filtered().

Referenced by display_selectors().

◆ display_selectors()

static void display_selectors ( const char *  args,
int  from_tty 
)
static

◆ do_initial_windows_stuff()

static void do_initial_windows_stuff ( struct target_ops ops,
DWORD  pid,
int  attaching 
)
static

◆ do_windows_fetch_inferior_registers()

static void do_windows_fetch_inferior_registers ( struct regcache regcache,
windows_thread_info th,
int  r 
)
static

◆ do_windows_store_inferior_registers()

static void do_windows_store_inferior_registers ( const struct regcache regcache,
windows_thread_info th,
int  r 
)
static

◆ envvar_cmp()

static int envvar_cmp ( const void *  a,
const void *  b 
)
static

Definition at line 2107 of file windows-nat.c.

Referenced by windows_create_inferior().

◆ fake_create_process()

static DWORD fake_create_process ( void  )
static

◆ get_image_name()

static char* get_image_name ( HANDLE  h,
void *  address,
int  unicode 
)
static

Definition at line 703 of file windows-nat.c.

References __PMAX, and size.

Referenced by handle_load_dll().

◆ get_windows_debug_event()

static int get_windows_debug_event ( struct target_ops ops,
int  pid,
struct target_waitstatus ourstatus 
)
static

◆ handle_exception()

static handle_exception_result handle_exception ( struct target_waitstatus ourstatus)
static

◆ handle_load_dll()

static void handle_load_dll ( )
static

◆ handle_output_debug_string()

static int handle_output_debug_string ( struct target_waitstatus ourstatus)
static

◆ handle_unload_dll()

static void handle_unload_dll ( )
static

◆ redir_open()

static int redir_open ( const char *  redir_string,
int *  inp,
int *  out,
int *  err 
)
static

Definition at line 2215 of file windows-nat.c.

References err, and L.

Referenced by redir_set_redirection().

◆ redir_set_redirection()

static int redir_set_redirection ( const char *  s,
int *  inp,
int *  out,
int *  err 
)
static

Definition at line 2309 of file windows-nat.c.

References __PMAX, err, and redir_open().

Referenced by redirect_inferior_handles().

◆ redirect_inferior_handles()

static bool redirect_inferior_handles ( const char *  cmd_orig,
char *  cmd,
int *  inp,
int *  out,
int *  err 
)
static

Definition at line 2384 of file windows-nat.c.

References err, and redir_set_redirection().

Referenced by windows_create_inferior().

◆ set_process_privilege()

static int set_process_privilege ( const char *  privilege,
BOOL  enable 
)
static

Definition at line 1837 of file windows-nat.c.

References AdjustTokenPrivileges, enable, LookupPrivilegeValueA, OpenProcessToken, and size.

Referenced by windows_attach().

◆ signal_event_command()

static void signal_event_command ( const char *  args,
int  from_tty 
)
static

Definition at line 862 of file windows-nat.c.

References _, and error().

Referenced by _initialize_windows_nat().

◆ thread_rec()

static windows_thread_info* thread_rec ( DWORD  id,
int  get_context 
)
static

◆ windows_add_all_dlls()

static void windows_add_all_dlls ( void  )
static

◆ windows_add_thread()

static windows_thread_info* windows_add_thread ( ptid_t  ptid,
HANDLE  h,
void *  tlb 
)
static

◆ windows_attach()

static void windows_attach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static

◆ windows_clear_solib()

static void windows_clear_solib ( void  )
static

Definition at line 855 of file windows-nat.c.

References solib_end.

Referenced by do_initial_windows_stuff().

◆ windows_close()

static void windows_close ( struct target_ops self)
static

Definition at line 2846 of file windows-nat.c.

References DEBUG_EVENTS, inferior_ptid, and ptid_get_pid().

Referenced by windows_target().

◆ windows_continue()

static BOOL windows_continue ( DWORD  continue_status,
int  id,
int  killed 
)
static

◆ windows_create_inferior()

static void windows_create_inferior ( struct target_ops ops,
const char *  exec_file,
const std::string origallargs,
char **  in_env,
int  from_tty 
)
static

◆ windows_delete_thread()

static void windows_delete_thread ( ptid_t  ptid,
DWORD  exit_code 
)
static

◆ windows_detach()

static void windows_detach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static

◆ windows_fetch_inferior_registers()

static void windows_fetch_inferior_registers ( struct target_ops ops,
struct regcache regcache,
int  r 
)
static

◆ windows_files_info()

static void windows_files_info ( struct target_ops ignore)
static

Definition at line 2049 of file windows-nat.c.

References current_inferior(), inferior_ptid, printf_unfiltered(), and target_pid_to_str().

Referenced by windows_target().

◆ windows_free_so()

static void windows_free_so ( struct so_list so)
static

Definition at line 785 of file windows-nat.c.

References so_list::lm_info, and xfree().

Referenced by handle_unload_dll().

◆ windows_get_ada_task_ptid()

static ptid_t windows_get_ada_task_ptid ( struct target_ops self,
long  lwp,
long  thread 
)
static

Definition at line 2953 of file windows-nat.c.

References inferior_ptid, selftests::ptid::lwp, ptid_build(), and ptid_get_pid().

Referenced by windows_target().

◆ windows_get_exec_module_filename()

static int windows_get_exec_module_filename ( char *  exe_name_ret,
size_t  exe_name_max_len 
)
static

◆ windows_get_tib_address()

static int windows_get_tib_address ( struct target_ops self,
ptid_t  ptid,
CORE_ADDR addr 
)
static

◆ windows_init_thread_list()

static void windows_init_thread_list ( void  )
static

◆ windows_interrupt()

static void windows_interrupt ( struct target_ops self,
ptid_t  ptid 
)
static

Definition at line 2780 of file windows-nat.c.

References CHECK, current_event, DEBUG_EVENTS, and registers_changed().

Referenced by windows_target().

◆ windows_kill_inferior()

static void windows_kill_inferior ( struct target_ops ops)
static

◆ windows_make_so()

static struct so_list* windows_make_so ( const char *  name,
LPVOID  load_addr 
)
static

◆ windows_mourn_inferior()

static void windows_mourn_inferior ( struct target_ops ops)
static

◆ windows_pid_to_exec_file()

static char* windows_pid_to_exec_file ( struct target_ops self,
int  pid 
)
static

Definition at line 2021 of file windows-nat.c.

References __PMAX, pid, windows_get_exec_module_filename(), and xsnprintf().

Referenced by windows_target().

◆ windows_pid_to_str()

static const char* windows_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 2854 of file windows-nat.c.

References normal_pid_to_str(), ptid_get_pid(), and ptid_get_tid().

Referenced by windows_target().

◆ windows_resume()

static void windows_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  sig 
)
static

◆ windows_set_console_info()

static void windows_set_console_info ( STARTUPINFO si,
DWORD *  flags 
)
static

Definition at line 2072 of file windows-nat.c.

References flags, GetConsoleFontSize, and GetCurrentConsoleFont.

Referenced by windows_create_inferior().

◆ windows_set_context_register_offsets()

void windows_set_context_register_offsets ( const int *  offsets)

Definition at line 309 of file windows-nat.c.

References mappings.

Referenced by _initialize_amd64_windows_nat(), and _initialize_i386_windows_nat().

◆ windows_set_segment_register_p()

void windows_set_segment_register_p ( segment_register_p_ftype fun)

Definition at line 317 of file windows-nat.c.

References segment_register_p.

Referenced by _initialize_amd64_windows_nat(), and _initialize_i386_windows_nat().

◆ windows_store_inferior_registers()

static void windows_store_inferior_registers ( struct target_ops ops,
struct regcache regcache,
int  r 
)
static

◆ windows_target()

static struct target_ops* windows_target ( void  )
static

◆ windows_thread_alive()

static int windows_thread_alive ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 3152 of file windows-nat.c.

References gdb_assert, ptid_get_tid(), thread_rec(), and selftests::ptid::tid.

Referenced by windows_target().

◆ windows_thread_name()

static const char* windows_thread_name ( struct target_ops self,
struct thread_info thr 
)
static

◆ windows_wait()

static ptid_t windows_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus ourstatus,
int  options 
)
static

◆ windows_xfer_memory()

static enum target_xfer_status windows_xfer_memory ( gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  memaddr,
ULONGEST  len,
ULONGEST xfered_len 
)
static

◆ windows_xfer_partial()

static enum target_xfer_status windows_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static

◆ windows_xfer_shared_libraries()

static enum target_xfer_status windows_xfer_shared_libraries ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static

Variable Documentation

◆ AdjustTokenPrivileges

AdjustTokenPrivileges_ftype* AdjustTokenPrivileges
static

Definition at line 87 of file windows-nat.c.

◆ current_event

DEBUG_EVENT current_event
static

◆ current_process_handle

HANDLE current_process_handle
static

◆ current_thread

windows_thread_info* current_thread
static

◆ debug_events

int debug_events = 0
static

Definition at line 256 of file windows-nat.c.

Referenced by _initialize_windows_nat().

◆ debug_exceptions

int debug_exceptions = 0
static

Definition at line 258 of file windows-nat.c.

Referenced by _initialize_windows_nat().

◆ debug_exec

int debug_exec = 0
static

Definition at line 255 of file windows-nat.c.

Referenced by _initialize_windows_nat().

◆ debug_memory

int debug_memory = 0
static

Definition at line 257 of file windows-nat.c.

Referenced by _initialize_windows_nat().

◆ debug_registers_changed

int debug_registers_changed
static

◆ debug_registers_used

int debug_registers_used
static

◆ DebugActiveProcessStop

DebugActiveProcessStop_ftype* DebugActiveProcessStop
static

Definition at line 90 of file windows-nat.c.

◆ DebugBreakProcess

DebugBreakProcess_ftype* DebugBreakProcess
static

Definition at line 93 of file windows-nat.c.

◆ DebugSetProcessKillOnExit

DebugSetProcessKillOnExit_ftype* DebugSetProcessKillOnExit
static

Definition at line 96 of file windows-nat.c.

◆ dr

uintptr_t dr[8]
static

◆ EnumProcessModules

EnumProcessModules_ftype* EnumProcessModules
static

Definition at line 100 of file windows-nat.c.

◆ event_count

int event_count = 0
static

Definition at line 245 of file windows-nat.c.

Referenced by do_initial_windows_stuff(), and get_windows_debug_event().

◆ exception_count

int exception_count = 0
static

Definition at line 244 of file windows-nat.c.

Referenced by do_initial_windows_stuff(), and handle_exception().

◆ GetConsoleFontSize

GetConsoleFontSize_ftype* GetConsoleFontSize
static

Definition at line 117 of file windows-nat.c.

◆ GetCurrentConsoleFont

GetCurrentConsoleFont_ftype* GetCurrentConsoleFont
static

Definition at line 114 of file windows-nat.c.

◆ GetModuleFileNameEx

GetModuleFileNameEx_ftype* GetModuleFileNameEx
static

◆ GetModuleInformation

GetModuleInformation_ftype* GetModuleInformation
static

Definition at line 104 of file windows-nat.c.

◆ have_saved_context

int have_saved_context
static

◆ last_sig

enum gdb_signal last_sig = GDB_SIGNAL_0
static

◆ LookupPrivilegeValueA

LookupPrivilegeValueA_ftype* LookupPrivilegeValueA
static

Definition at line 107 of file windows-nat.c.

◆ main_thread_id

DWORD main_thread_id
static

◆ mappings

const int* mappings
static

◆ new_console

int new_console = 0
static

Definition at line 250 of file windows-nat.c.

Referenced by _initialize_windows_nat(), ctrl_c_handler(), and windows_create_inferior().

◆ new_group

int new_group = 1
static

Definition at line 254 of file windows-nat.c.

Referenced by _initialize_windows_nat(), and windows_create_inferior().

◆ open_process_used

int open_process_used = 0
static

◆ OpenProcessToken

OpenProcessToken_ftype* OpenProcessToken
static

Definition at line 110 of file windows-nat.c.

◆ saved_context

CONTEXT saved_context
static

◆ saw_create

int saw_create
static

Definition at line 246 of file windows-nat.c.

Referenced by get_windows_debug_event(), windows_attach(), and windows_create_inferior().

◆ segment_register_p

segment_register_p_ftype* segment_register_p
static

◆ solib_end

struct so_list solib_start* solib_end
static

◆ thread_head

windows_thread_info thread_head
static

◆ useshell

int useshell = 0
static

Definition at line 259 of file windows-nat.c.

Referenced by _initialize_windows_nat(), and windows_create_inferior().

◆ windows_initialization_done

int windows_initialization_done
static

Definition at line 176 of file windows-nat.c.

Referenced by do_initial_windows_stuff(), and get_windows_debug_event().

◆ xlate

const struct xlate_exception xlate[]
static
Initial value:
=
{
{EXCEPTION_ACCESS_VIOLATION, GDB_SIGNAL_SEGV},
{STATUS_STACK_OVERFLOW, GDB_SIGNAL_SEGV},
{EXCEPTION_BREAKPOINT, GDB_SIGNAL_TRAP},
{DBG_CONTROL_C, GDB_SIGNAL_INT},
{EXCEPTION_SINGLE_STEP, GDB_SIGNAL_TRAP},
{STATUS_FLOAT_DIVIDE_BY_ZERO, GDB_SIGNAL_FPE},
{-1, GDB_SIGNAL_UNKNOWN}}

Definition at line 295 of file windows-nat.c.

Referenced by windows_resume().