GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
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 <algorithm>
#include <vector>
#include <queue>
#include "filenames.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdb_bfd.h"
#include "gdbsupport/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 "gdbsupport/gdb_tilde_expand.h"
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/gdb_wait.h"
#include "nat/windows-nat.h"
#include "gdbsupport/symbol.h"
#include "ser-event.h"
#include "inf-loop.h"

Go to the source code of this file.

Classes

struct  windows_solib
 
struct  windows_per_inferior
 
struct  windows_nat_target
 

Macros

#define __PMAX   (MAX_PATH + 1)
 
#define STARTUPINFO   STARTUPINFOA
 
#define CONTEXT_EXTENDED_REGISTERS   0
 
#define CONTEXT_DEBUGGER_DR
 
#define DR6_CLEAR_VALUE   0xffff0ff0
 
#define _CYGWIN_SIGNAL_STRING   "cYgSiGw00f"
 
#define CHECK(x)   check (x, __FILE__,__LINE__)
 
#define DEBUG_EXEC(fmt, ...)    debug_prefixed_printf_cond (debug_exec, "windows exec", fmt, ## __VA_ARGS__)
 
#define DEBUG_EVENTS(fmt, ...)
 
#define DEBUG_MEM(fmt, ...)
 
#define DEBUG_EXCEPT(fmt, ...)
 

Enumerations

enum  { FLAG_TRACE_BIT = 0x100 }
 

Functions

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)
 
static void check (BOOL ok, const char *file, int line)
 
static void wait_for_single (HANDLE handle, DWORD howlong)
 
static void windows_init_thread_list (void)
 
static void windows_fetch_one_register (struct regcache *regcache, windows_thread_info *th, int r)
 
static void windows_store_one_register (const struct regcache *regcache, windows_thread_info *th, int r)
 
static windows_solibwindows_make_so (const char *name, LPVOID load_addr)
 
static void windows_clear_solib (void)
 
static void signal_event_command (const char *args, int from_tty)
 
static int display_selector (HANDLE thread, DWORD sel)
 
static void display_selectors (const char *args, int from_tty)
 
static int set_process_privilege (const char *privilege, BOOL enable)
 
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 enum target_xfer_status windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
 
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_siginfo (gdb_byte *readbuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
void _initialize_windows_nat ()
 
void _initialize_check_for_gdb_ini ()
 

Variables

static windows_per_inferior windows_process
 
static bool new_console = false
 
static bool new_group = true
 
static bool debug_exec = false
 
static bool debug_events = false
 
static bool debug_memory = false
 
static bool debug_exceptions = false
 
static bool useshell = false
 

Macro Definition Documentation

◆ __PMAX

#define __PMAX   (MAX_PATH + 1)

◆ _CYGWIN_SIGNAL_STRING

#define _CYGWIN_SIGNAL_STRING   "cYgSiGw00f"

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

Referenced by windows_per_inferior::handle_output_debug_string().

◆ 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 at line 181 of file windows-nat.c.

Referenced by windows_nat_target::fetch_registers().

◆ CONTEXT_EXTENDED_REGISTERS

#define CONTEXT_EXTENDED_REGISTERS   0

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

◆ DEBUG_EVENTS

#define DEBUG_EVENTS ( fmt,
... )
Value:
debug_prefixed_printf_cond (debug_events, "windows events", fmt, \
## __VA_ARGS__)
static bool debug_events

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

Referenced by windows_nat_target::close(), windows_nat_target::get_windows_debug_event(), windows_per_inferior::handle_load_dll(), windows_nat_target::interrupt(), and windows_init_thread_list().

◆ DEBUG_EXCEPT

#define DEBUG_EXCEPT ( fmt,
... )
Value:
debug_prefixed_printf_cond (debug_exceptions, "windows except", fmt, \
## __VA_ARGS__)
static bool debug_exceptions

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

Referenced by windows_nat_target::resume().

◆ DEBUG_EXEC

#define DEBUG_EXEC ( fmt,
... )    debug_prefixed_printf_cond (debug_exec, "windows exec", fmt, ## __VA_ARGS__)

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

Referenced by windows_nat_target::resume().

◆ DEBUG_MEM

#define DEBUG_MEM ( fmt,
... )
Value:
debug_prefixed_printf_cond (debug_memory, "windows mem", fmt, \
## __VA_ARGS__)
static bool debug_memory

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

Referenced by windows_xfer_memory().

◆ DR6_CLEAR_VALUE

#define DR6_CLEAR_VALUE   0xffff0ff0

◆ STARTUPINFO

#define STARTUPINFO   STARTUPINFOA

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

Referenced by windows_nat_target::create_inferior().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FLAG_TRACE_BIT 

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

Function Documentation

◆ _initialize_check_for_gdb_ini()

void _initialize_check_for_gdb_ini ( )

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

References inhibit_gdbinit.

◆ _initialize_windows_nat()

void _initialize_windows_nat ( )

◆ check()

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

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

References err, and gdb_printf().

Referenced by build_id_verify(), gdbscm_value_to_real(), i386_skip_noop(), and load_progress().

◆ cygwin_get_dr()

static CORE_ADDR cygwin_get_dr ( int i)
static

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

References windows_per_inferior::dr, and windows_process.

Referenced by _initialize_windows_nat().

◆ cygwin_get_dr6()

static unsigned long cygwin_get_dr6 ( void )
static

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

References windows_per_inferior::dr, and windows_process.

Referenced by _initialize_windows_nat().

◆ cygwin_get_dr7()

static unsigned long cygwin_get_dr7 ( void )
static

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

References windows_per_inferior::dr, and windows_process.

Referenced by _initialize_windows_nat().

◆ cygwin_set_dr()

static void cygwin_set_dr ( int i,
CORE_ADDR addr )
static

◆ cygwin_set_dr7()

static void cygwin_set_dr7 ( unsigned long val)
static

◆ display_selector()

static int display_selector ( HANDLE thread,
DWORD sel )
static

◆ display_selectors()

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

◆ envvar_cmp()

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

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

Referenced by windows_nat_target::create_inferior().

◆ redir_open()

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

Definition at line 2278 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 2372 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 2447 of file windows-nat.c.

References err, and redir_set_redirection().

Referenced by windows_nat_target::create_inferior().

◆ set_process_privilege()

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

◆ signal_event_command()

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

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

Referenced by _initialize_windows_nat().

◆ wait_for_single()

static void wait_for_single ( HANDLE handle,
DWORD howlong )
static

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

References err.

Referenced by windows_nat_target::do_synchronously(), and windows_nat_target::process_thread().

◆ windows_clear_solib()

static void windows_clear_solib ( void )
static

◆ windows_fetch_one_register()

static void windows_fetch_one_register ( struct regcache * regcache,
windows_thread_info * th,
int r )
static

◆ windows_init_thread_list()

static void windows_init_thread_list ( void )
static

◆ windows_make_so()

static windows_solib * windows_make_so ( const char * name,
LPVOID load_addr )
static

◆ windows_set_console_info()

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

◆ windows_store_one_register()

static void windows_store_one_register ( const struct regcache * regcache,
windows_thread_info * th,
int r )
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_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

◆ windows_xfer_siginfo()

static enum target_xfer_status windows_xfer_siginfo ( gdb_byte * readbuf,
ULONGEST offset,
ULONGEST len,
ULONGEST * xfered_len )
static

Variable Documentation

◆ debug_events

bool debug_events = false
static

◆ debug_exceptions

bool debug_exceptions = false
static

◆ debug_exec

bool debug_exec = false
static

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

Referenced by _initialize_windows_nat().

◆ debug_memory

bool debug_memory = false
static

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

Referenced by _initialize_windows_nat().

◆ new_console

bool new_console = false
static

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

Referenced by _initialize_windows_nat(), and windows_nat_target::create_inferior().

◆ new_group

bool new_group = true
static

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

Referenced by _initialize_windows_nat(), and windows_nat_target::create_inferior().

◆ useshell

bool useshell = false
static

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

Referenced by _initialize_windows_nat(), and windows_nat_target::create_inferior().

◆ windows_process

windows_per_inferior windows_process
static