GDB (xrefs)
Classes | Defines | Typedefs | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/windows-nat.c File Reference
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "target.h"
#include "exceptions.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 <stdlib.h>
#include <windows.h>
#include <imagehlp.h>
#include <psapi.h>
#include "buildsym.h"
#include "filenames.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdb_bfd.h"
#include "gdb_obstack.h"
#include "gdb_string.h"
#include "gdbthread.h"
#include "gdbcmd.h"
#include <unistd.h>
#include "exec.h"
#include "solist.h"
#include "solib.h"
#include "xml-support.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "windows-tdep.h"
#include "windows-nat.h"
#include "i386-nat.h"
#include "complaints.h"

Go to the source code of this file.

Classes

struct  thread_info_struct
struct  xlate_exception
struct  safe_symbol_file_add_args
struct  lm_info

Defines

#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 _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 p   ((struct safe_symbol_file_add_args *) argv)
#define sp   ((struct safe_symbol_file_add_args *)p)
#define DEBUG_EXCEPTION_SIMPLE(x)

Typedefs

typedef struct thread_info_struct thread_info

Enumerations

enum  { FLAG_TRACE_BIT = 0x100, CONTEXT_DEBUGGER = (CONTEXT_FULL | CONTEXT_FLOATING_POINT) }

Functions

static void windows_stop (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 thread_infothread_rec (DWORD id, int get_context)
static 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, 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, int r)
static void windows_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int r)
static int get_module_name (LPVOID base_address, char *dll_name_ret)
static int safe_symbol_file_add_stub (void *argv)
static void safe_symbol_file_add_cleanup (void *p)
static struct objfilesafe_symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, int mainline, int flags)
static struct so_listwindows_make_so (const char *name, LPVOID load_addr)
static char * get_image_name (HANDLE h, void *address, int unicode)
static int handle_load_dll (void *dummy)
static void windows_free_so (struct so_list *so)
static int handle_unload_dll (void *dummy)
static void windows_clear_solib (void)
static void dll_symbol_command (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 (char *args, int from_tty)
static int handle_exception (struct target_waitstatus *ourstatus)
static BOOL windows_continue (DWORD continue_status, int id)
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 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, char *args, int from_tty)
static void windows_detach (struct target_ops *ops, char *args, int from_tty)
static char * windows_pid_to_exec_file (int pid)
static void windows_files_info (struct target_ops *ignore)
static void windows_open (char *arg, int from_tty)
static void windows_set_console_info (STARTUPINFO *si, DWORD *flags)
static int envvar_cmp (const void *a, const void *b)
static void windows_create_inferior (struct target_ops *ops, char *exec_file, char *allargs, char **in_env, int from_tty)
static void windows_mourn_inferior (struct target_ops *ops)
static LONGEST windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, LONGEST len)
static void windows_prepare_to_store (struct regcache *regcache)
static int windows_can_run (void)
static void windows_close (void)
static char * windows_pid_to_str (struct target_ops *ops, ptid_t ptid)
static LONGEST windows_xfer_shared_libraries (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
static LONGEST windows_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
static int windows_get_tib_address (ptid_t ptid, CORE_ADDR *addr)
static ptid_t windows_get_ada_task_ptid (long lwp, long thread)
static void init_windows_ops (void)
static void set_windows_aliases (char *argv0)
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 BOOL WINAPI(* AdjustTokenPrivileges )(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD)
static BOOL WINAPI(* DebugActiveProcessStop )(DWORD)
static BOOL WINAPI(* DebugBreakProcess )(HANDLE)
static BOOL WINAPI(* DebugSetProcessKillOnExit )(BOOL)
static BOOL WINAPI(* EnumProcessModules )(HANDLE, HMODULE *, DWORD, LPDWORD)
static BOOL WINAPI(* GetModuleInformation )(HANDLE, HMODULE, LPMODULEINFO, DWORD)
static BOOL WINAPI(* LookupPrivilegeValueA )(LPCSTR, LPCSTR, PLUID)
static BOOL WINAPI(* OpenProcessToken )(HANDLE, DWORD, PHANDLE)
static BOOL WINAPI(* GetCurrentConsoleFont )(HANDLE, BOOL, CONSOLE_FONT_INFO *)
static COORD WINAPI(* GetConsoleFontSize )(HANDLE, DWORD)
static struct target_ops windows_ops
static DWORD WINAPI(* GetModuleFileNameEx )(HANDLE, HMODULE, LPSTR, DWORD)
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 thread_info thread_head
static DEBUG_EVENT current_event
static HANDLE current_process_handle
static 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 intmappings
static segment_register_p_ftypesegment_register_p
static struct xlate_exception xlate []
static struct so_list solib_start * solib_end
initialize_file_ftype _initialize_windows_nat
initialize_file_ftype _initialize_check_for_gdb_ini
initialize_file_ftype _initialize_loadable

Define Documentation

#define __PMAX   (MAX_PATH + 1)
#define _CYGWIN_SIGNAL_STRING   "cYgSiGw00f"

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

Referenced by handle_output_debug_string().

#define AdjustTokenPrivileges   dyn_AdjustTokenPrivileges

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

Referenced by _initialize_loadable(), and set_process_privilege().

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

Referenced by _initialize_loadable().

#define CHECK (   x)    check (x, __FILE__,__LINE__)
Value:
CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \
        | CONTEXT_EXTENDED_REGISTERS

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

Referenced by do_windows_fetch_inferior_registers().

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

#define CreateProcess   CreateProcessA

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

Referenced by windows_create_inferior().

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

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

Referenced by windows_resume().

#define DEBUG_EXCEPTION_SIMPLE (   x)
Value:
if (debug_exceptions) \
  printf_unfiltered ("gdb: Target exception %s at %s\n", x, \
    host_address_to_string (\
      current_event.u.Exception.ExceptionRecord.ExceptionAddress))

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

Referenced by handle_exception().

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

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

Referenced by windows_resume().

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

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

Referenced by windows_xfer_memory().

#define DebugActiveProcessStop   dyn_DebugActiveProcessStop

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

Referenced by _initialize_loadable(), and windows_detach().

#define DebugBreakProcess   dyn_DebugBreakProcess

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

Referenced by _initialize_loadable(), and ctrl_c_handler().

#define DebugSetProcessKillOnExit   dyn_DebugSetProcessKillOnExit

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

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

#define DR6_CLEAR_VALUE   0xffff0ff0

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

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

#define EnumProcessModules   dyn_EnumProcessModules

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

Referenced by _initialize_loadable(), and get_module_name().

#define GetConsoleFontSize   dyn_GetConsoleFontSize

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

Referenced by _initialize_loadable(), and windows_set_console_info().

#define GetCurrentConsoleFont   dyn_GetCurrentConsoleFont

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

Referenced by _initialize_loadable(), and windows_set_console_info().

#define GetModuleFileNameEx_name   "GetModuleFileNameExA"

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

Referenced by _initialize_loadable().

#define GetModuleInformation   dyn_GetModuleInformation

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

Referenced by _initialize_loadable(), and get_module_name().

#define LookupPrivilegeValueA   dyn_LookupPrivilegeValueA

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

Referenced by _initialize_loadable(), and set_process_privilege().

#define OpenProcessToken   dyn_OpenProcessToken

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

Referenced by _initialize_loadable(), and set_process_privilege().

#define p   ((struct safe_symbol_file_add_args *) argv)

Referenced by _initialize_check_for_gdb_ini(), ada_decode(), ada_encode(), ada_in_variant(), ada_name_prefix_len(), ada_tag_name_from_tsd(), add_cmd(), add_line_to_sigset(), add_msglist(), add_old_header_file(), add_path(), add_pending(), add_piece(), add_prefix_cmd(), amd64_windows_frame_decode_insns(), arm_exidx_new_objfile(), arm_linux_new_thread(), arm_linux_thread_exit(), avr_io_reg_read_command(), bpstat_clear(), bpstat_copy(), buffer_xml_printf(), c_type_print_base(), can_use_watchpoint_cond_accel(), captured_main(), cd_command(), check_pieced_value_bits(), check_stub_method(), classes_info(), clear_complaints(), command_line_handler(), command_line_input(), condition_command(), core_open(), create_exception_master_breakpoint(), create_longjmp_master_breakpoint(), decode_format(), decode_static_tracepoint_spec(), define_symbol(), disassemble_command(), do_collect_symbol(), do_print_variable_and_value(), do_set_command(), echo_command(), edit_command(), end_msglist(), end_psymtab(), envvar_cmp(), exec_set_section_address(), extract_identifier(), extract_long_unsigned_integer(), extract_signed_integer(), extract_unsigned_integer(), fill_gregset(), find_and_open_source(), find_command_name_length(), find_linespec_symbols(), find_parameter_list_end(), find_pc_sect_psymbol(), find_pc_sect_psymtab(), find_pc_sect_psymtab_closer(), find_source_lines(), find_stab_function_addr(), fork_inferior(), forward_search_command(), frame_id_p(), free_completion_list(), free_search_symbols(), gdb_bfd_errmsg(), gdb_search(), gdbpy_readline_wrapper(), gdbtk_set_hook(), get_decimal_float_return_value(), get_init_files(), get_number_trailer(), get_token(), gnuv2_value_rtti_type(), handle_output_debug_string(), hwdebug_insert_point(), i386_sol2_static_transform_name(), i387_collect_xsave(), ignore_command(), in_pid_list_p(), indirect_pieced_value(), info_macro_command(), init_breakpoint_sal(), insert_args(), is_pending_symbol(), java_find_last_component(), java_name_of_child(), java_name_of_variable(), java_type_print_base(), language_lookup_primitive_type_by_name(), lex_one_token(), linespec_lexer_lex_string(), linespec_parse_variable(), linux_common_core_of_thread(), linux_info_proc(), list_command(), lookup_cmd_for_prefixlist(), m32c_frame_base(), m32c_prev_register(), maintenance_translate_address(), make_command(), make_srec(), map_breakpoint_numbers(), map_display_numbers(), maybe_add_address(), maybe_add_script(), memory_xfer_live_readonly_partial(), mep_frame_base(), mep_frame_prev_register(), mep_skip_prologue(), mi_cmd_break_passcount(), mi_cmd_data_read_memory_bytes(), mi_cmd_trace_frame_collected(), mips_expect_timeout(), mips_linux_in_dynsym_stub(), mn10300_frame_base(), mn10300_frame_prev_register(), monitor_expect(), monitor_expect_regexp(), monitor_open(), monitor_rcmd(), monitor_read_memory(), monitor_read_memory_single(), monitor_supply_register(), monitor_vsprintf(), msp430_frame_base(), msp430_prev_register(), nto_parse_redirection(), nto_target(), output_cores(), parse_frame_specification_1(), parse_macro_definition(), parse_number(), parse_one_string(), parse_partial_symbols(), parse_probes(), parse_static_tracepoint_marker_definition(), parse_trace_status(), parse_tracepoint_definition(), parse_tsv_definition(), picobug_dumpregs(), pmon_make_fastrec(), ppc64_sysv_abi_push_dummy_call(), ppc64_sysv_abi_push_float(), ppc_linux_new_thread(), ppc_linux_thread_exit(), ppc_sysv_abi_push_dummy_call(), print_binary_chars(), print_char_chars(), print_choices(), print_decimal_chars(), print_doc_line(), print_hex_chars(), print_octal_chars(), print_section_info(), printf_decfloat(), printf_pointer(), process_one_symbol(), process_reference(), processString(), procfs_create_inferior(), prompt_for_continue(), pull_pid_from_list(), rbreak_command(), read_atcb(), read_cpp_abbrev(), read_dbx_symtab(), read_enum_type(), read_huge_number(), read_mapping(), read_member_functions(), read_pieced_value(), read_psymtabs_with_fullname(), read_ptid(), read_struct_fields(), read_tilde_fields(), read_type(), read_xcoff_symtab(), record_full_core_xfer_partial(), record_full_goto(), record_full_goto_begin(), record_full_goto_end(), record_full_info(), regcache_dump(), relocate_psymtabs(), remote_get_noisy_reply(), remote_pass_signals(), remote_program_signals(), remote_thread_alive(), reverse_search_command(), rl78_frame_base(), rl78_prev_register(), rs6000_aix_shared_library_to_xml(), rx_frame_base(), rx_frame_prev_register(), safe_symbol_file_add_stub(), savestring(), scan_xcoff_symtab(), score3_breakpoint_from_pc(), section_table_xfer_memory_partial(), selectors_info(), ser_windows_read_prim(), set_cmd_prefix(), set_environment_command(), set_hpux_major_release(), set_prompt(), set_section_command(), shell_escape(), skip_quote_char(), solib_contains_address_p(), solib_find(), solib_map_sections(), sparc_sol2_static_transform_name(), store_signed_integer(), store_unsigned_integer(), strip_bg_char(), supply_gregset(), svr4_create_solib_event_breakpoints(), swap_sym(), symbol_end(), symbol_reference_defined(), symtab_symbol_info(), tfile_interp_line(), trace_variable_command(), tui_display_registers_from(), tui_get_function_from_frame(), tui_register_format(), unpack_mangled_go_symbol(), valid_user_defined_cmd_name_p(), validate_actionline(), validate_trace_state_variable_name(), value_logical_not(), varobj_create(), VEC(), wild_match(), windows_make_so(), windows_xfer_shared_library(), write_pieced_value(), write_selectors(), and yylex().

#define sp   ((struct safe_symbol_file_add_args *)p)

Referenced by aarch64_linux_sigframe_init(), alpha_linux_sigcontext_addr(), alphaobsd_sigcontext_addr(), amd64_linux_sigcontext_addr(), amd64_sol2_mcontext_addr(), amd64fbsd_sigcontext_addr(), amd64obsd_collect_uthread(), amd64obsd_supply_uthread(), amd64obsd_trapframe_cache(), arm_linux_restart_syscall_init(), arm_linux_rt_sigreturn_init(), arm_linux_sigreturn_init(), arm_linux_sigtramp_cache(), bfin_dummy_id(), bfin_linux_sigframe_init(), call0_frame_cache(), call_function_by_hand(), cris_dummy_id(), cris_sigcontext_addr(), cris_unwind_sp(), find_pc_section(), frame_info(), frv_dummy_id(), frv_linux_sigcontext_reg_addr(), h8300_dummy_id(), hppa_hpux_sigtramp_frame_unwind_cache(), hppa_hpux_skip_trampoline_code(), hppa_linux_sigtramp_find_sigcontext(), i386_epilogue_frame_cache(), i386_fetch_pointer_argument(), i386_get_longjmp_target(), i386_linux_resume(), i386_linux_sigcontext_addr(), i386_sol2_mcontext_addr(), i386_svr4_sigcontext_addr(), i386bsd_sigcontext_addr(), i386obsd_collect_uthread(), i386obsd_supply_uthread(), i386obsd_trapframe_cache(), ia64_dummy_id(), ia64_hpux_dummy_id(), iq2000_dummy_id(), lm32_dummy_id(), m32r_dummy_id(), m68hc11_unwind_sp(), m68k_get_longjmp_target(), m68k_linux_get_sigtramp_info(), m88k_dummy_id(), make_regs(), mep_dummy_id(), mep_frame_base(), micromips_scan_prologue(), mips16_scan_prologue(), mips32_scan_prologue(), mips64obsd_sigframe_init(), mips_irix_n32_stack_tramp_frame_init(), mips_irix_n32_tramp_frame_init(), mn10300_dummy_id(), mn10300_frame_base(), mn10300_unwind_sp(), moxie_dummy_id(), msp430_frame_base(), msp430_skip_trampoline_code(), mt_dummy_id(), mt_frame_unwind_cache(), mt_unwind_sp(), rl78_frame_base(), rx_frame_base(), rx_unwind_sp(), s390_analyze_prologue(), s390_backchain_frame_unwind_cache(), s390_dummy_id(), s390_prologue_frame_unwind_cache(), safe_symbol_file_add_cleanup(), score3_analyze_prologue(), score7_analyze_prologue(), sh64_dummy_id(), sh_dummy_id(), sparc32_linux_step_trap(), sparc32_return_value(), sparc32_supply_gregset(), sparc32nbsd_sigcontext_saved_regs(), sparc32obsd_collect_uthread(), sparc64_linux_step_trap(), sparc64_sol2_sigtramp_frame_cache(), sparc64_supply_gregset(), sparc64fbsd_sigtramp_frame_cache(), sparc64nbsd_sigcontext_saved_regs(), sparc64obsd_collect_uthread(), sparc64obsd_trapframe_cache(), sparc_dummy_id(), sparc_store_inferior_registers(), thumb_get_next_pc_raw(), tic6x_linux_rt_sigreturn_init(), tilegx_linux_sigframe_init(), tilegx_unwind_dummy_id(), v850_dummy_id(), xstormy16_dummy_id(), and xtensa_frame_cache().

#define STARTUPINFO   STARTUPINFOA

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

Referenced by windows_create_inferior().


Typedef Documentation


Enumeration Type Documentation

anonymous enum
Enumerator:
FLAG_TRACE_BIT 
CONTEXT_DEBUGGER 

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


Function Documentation

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

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

void _initialize_loadable ( void  )
void _initialize_windows_nat ( void  )
static BOOL WINAPI bad_DebugActiveProcessStop ( DWORD  w) [static]

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

Referenced by _initialize_loadable().

static BOOL WINAPI bad_DebugBreakProcess ( HANDLE  w) [static]

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

Referenced by _initialize_loadable().

static BOOL WINAPI bad_DebugSetProcessKillOnExit ( BOOL  w) [static]

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

Referenced by _initialize_loadable().

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

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

Referenced by _initialize_loadable().

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

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

References size.

Referenced by _initialize_loadable().

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

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

Referenced by _initialize_loadable().

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

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

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

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

Referenced by _initialize_loadable().

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

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

Referenced by _initialize_loadable().

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

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

References printf_filtered().

Referenced by i386_skip_noop(), i387_collect_xsave(), and load_progress().

static BOOL WINAPI ctrl_c_handler ( DWORD  event_type) [static]

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

References _, inferior::attach_flag, current_inferior(), DebugBreakProcess, and warning().

Referenced by windows_wait().

static CORE_ADDR cygwin_get_dr ( int  i) [static]

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

Referenced by init_windows_ops().

static unsigned long cygwin_get_dr6 ( void  ) [static]

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

Referenced by init_windows_ops().

static unsigned long cygwin_get_dr7 ( void  ) [static]

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

Referenced by init_windows_ops().

static void cygwin_set_dr ( int  i,
CORE_ADDR  addr 
) [static]

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

References _, and internal_error().

Referenced by init_windows_ops().

static void cygwin_set_dr7 ( unsigned long  val) [static]

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

Referenced by init_windows_ops().

static int display_selector ( HANDLE  thread,
DWORD  sel 
) [static]

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

References printf_filtered(), and puts_filtered().

Referenced by display_selectors().

static void display_selectors ( char *  args,
int  from_tty 
) [static]
static void dll_symbol_command ( char *  args,
int  from_tty 
) [static]

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

References _, dont_repeat(), error(), OBJF_SHARED, OBJF_USERLOADED, and safe_symbol_file_add().

Referenced by _initialize_windows_nat().

static void do_initial_windows_stuff ( struct target_ops ops,
DWORD  pid,
int  attaching 
) [static]
static void do_windows_fetch_inferior_registers ( struct regcache regcache,
int  r 
) [static]
static void do_windows_store_inferior_registers ( const struct regcache regcache,
int  r 
) [static]
static int envvar_cmp ( const void *  a,
const void *  b 
) [static]

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

References p.

Referenced by windows_create_inferior().

static DWORD fake_create_process ( void  ) [static]

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

References _, error(), main_thread_id, ptid_build(), and windows_add_thread().

Referenced by get_windows_debug_event().

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

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

References __PMAX, len, and size.

Referenced by handle_load_dll().

static int get_module_name ( LPVOID  base_address,
char *  dll_name_ret 
) [static]
static int get_windows_debug_event ( struct target_ops ops,
int  pid,
struct target_waitstatus ourstatus 
) [static]
static int handle_exception ( struct target_waitstatus ourstatus) [static]
static int handle_load_dll ( void *  dummy) [static]
static int handle_output_debug_string ( struct target_waitstatus ourstatus) [static]
static int handle_unload_dll ( void *  dummy) [static]
static void init_windows_ops ( void  ) [static]

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

References child_terminal_info(), cygwin_get_dr(), cygwin_get_dr6(), cygwin_get_dr7(), cygwin_set_dr(), cygwin_set_dr7(), default_child_has_all_memory(), default_child_has_execution(), default_child_has_memory(), default_child_has_registers(), default_child_has_stack(), i386_dr_low_type::get_addr, i386_dr_low_type::get_control, i386_dr_low_type::get_status, i386_dr_low, i386_use_watchpoints(), memory_insert_breakpoint(), memory_remove_breakpoint(), OPS_MAGIC, process_stratum, i386_dr_low_type::set_addr, i386_dr_low_type::set_control, terminal_inferior(), terminal_init_inferior(), terminal_ours(), terminal_ours_for_output(), terminal_save_ours(), target_ops::to_attach, target_ops::to_attach_no_wait, target_ops::to_can_run, target_ops::to_close, target_ops::to_create_inferior, target_ops::to_detach, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_files_info, target_ops::to_get_ada_task_ptid, target_ops::to_get_tib_address, target_ops::to_has_all_memory, target_ops::to_has_execution, target_ops::to_has_memory, target_ops::to_has_registers, target_ops::to_has_stack, target_ops::to_insert_breakpoint, target_ops::to_kill, target_ops::to_longname, target_ops::to_magic, target_ops::to_mourn_inferior, target_ops::to_open, target_ops::to_pid_to_exec_file, target_ops::to_pid_to_str, target_ops::to_prepare_to_store, target_ops::to_remove_breakpoint, target_ops::to_resume, target_ops::to_shortname, target_ops::to_stop, target_ops::to_store_registers, target_ops::to_stratum, target_ops::to_terminal_inferior, target_ops::to_terminal_info, target_ops::to_terminal_init, target_ops::to_terminal_ours, target_ops::to_terminal_ours_for_output, target_ops::to_terminal_save_ours, target_ops::to_thread_alive, target_ops::to_wait, target_ops::to_xfer_partial, windows_attach(), windows_can_run(), windows_close(), windows_create_inferior(), windows_detach(), windows_fetch_inferior_registers(), windows_files_info(), windows_get_ada_task_ptid(), windows_get_tib_address(), windows_kill_inferior(), windows_mourn_inferior(), windows_open(), windows_ops, windows_pid_to_exec_file(), windows_pid_to_str(), windows_prepare_to_store(), windows_resume(), windows_stop(), windows_store_inferior_registers(), windows_thread_alive(), windows_wait(), and windows_xfer_partial().

Referenced by _initialize_windows_nat().

static struct objfile* safe_symbol_file_add ( char *  name,
int  from_tty,
struct section_addr_info addrs,
int  mainline,
int  flags 
) [static, read]
static void safe_symbol_file_add_cleanup ( void *  p) [static]

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

References gdb_flush(), gdb_stderr, gdb_stdout, sp, and ui_file_delete().

Referenced by safe_symbol_file_add().

static int safe_symbol_file_add_stub ( void *  argv) [static]

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

References p, symbol_file_add(), SYMFILE_MAINLINE, and SYMFILE_VERBOSE.

Referenced by safe_symbol_file_add().

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

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

References AdjustTokenPrivileges, LookupPrivilegeValueA, OpenProcessToken, and size.

Referenced by windows_attach().

static void set_windows_aliases ( char *  argv0) [static]

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

References add_info_alias().

Referenced by _initialize_windows_nat().

static thread_info* thread_rec ( DWORD  id,
int  get_context 
) [static]
static thread_info* windows_add_thread ( ptid_t  ptid,
HANDLE  h,
void *  tlb 
) [static]
static void windows_attach ( struct target_ops ops,
char *  args,
int  from_tty 
) [static]
static int windows_can_run ( void  ) [static]

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

Referenced by init_windows_ops().

static void windows_clear_solib ( void  ) [static]

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

Referenced by do_initial_windows_stuff().

static void windows_close ( void  ) [static]

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

References DEBUG_EVENTS, inferior_ptid, and ptid_get_pid().

Referenced by init_windows_ops().

static BOOL windows_continue ( DWORD  continue_status,
int  id 
) [static]
static void windows_create_inferior ( struct target_ops ops,
char *  exec_file,
char *  allargs,
char **  in_env,
int  from_tty 
) [static]
static void windows_delete_thread ( ptid_t  ptid,
DWORD  exit_code 
) [static]
static void windows_detach ( struct target_ops ops,
char *  args,
int  from_tty 
) [static]
static void windows_fetch_inferior_registers ( struct target_ops ops,
struct regcache regcache,
int  r 
) [static]
static void windows_files_info ( struct target_ops ignore) [static]
static void windows_free_so ( struct so_list so) [static]

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

References so_list::lm_info, and xfree().

Referenced by handle_unload_dll().

static ptid_t windows_get_ada_task_ptid ( long  lwp,
long  thread 
) [static]

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

References inferior_ptid, ptid_build(), and ptid_get_pid().

Referenced by init_windows_ops().

static int windows_get_tib_address ( ptid_t  ptid,
CORE_ADDR addr 
) [static]

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

References ptid_get_tid(), and thread_rec().

Referenced by init_windows_ops().

static void windows_init_thread_list ( void  ) [static]
static void windows_kill_inferior ( struct target_ops ops) [static]

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

References CHECK, target_mourn_inferior(), and windows_continue().

Referenced by init_windows_ops(), and windows_wait().

static struct so_list* windows_make_so ( const char *  name,
LPVOID  load_addr 
) [static, read]
static void windows_mourn_inferior ( struct target_ops ops) [static]
static void windows_open ( char *  arg,
int  from_tty 
) [static]

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

References _, and error().

Referenced by init_windows_ops().

static char* windows_pid_to_exec_file ( int  pid) [static]

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

References __PMAX, get_module_name(), and xsnprintf().

Referenced by init_windows_ops().

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

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

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

Referenced by init_windows_ops().

static void windows_prepare_to_store ( struct regcache regcache) [static]

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

Referenced by init_windows_ops().

static void windows_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  sig 
) [static]
static void windows_set_console_info ( STARTUPINFO si,
DWORD *  flags 
) [static]

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

References GetConsoleFontSize, and GetCurrentConsoleFont.

Referenced by windows_create_inferior().

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

Referenced by _initialize_amd64_windows_nat(), and _initialize_i386_windows_nat().

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

Referenced by _initialize_amd64_windows_nat(), and _initialize_i386_windows_nat().

static void windows_stop ( ptid_t  ptid) [static]

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

References CHECK, DEBUG_EVENTS, and registers_changed().

Referenced by init_windows_ops().

static void windows_store_inferior_registers ( struct target_ops ops,
struct regcache regcache,
int  r 
) [static]
static int windows_thread_alive ( struct target_ops ops,
ptid_t  ptid 
) [static]

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

References gdb_assert, ptid_get_tid(), and thread_rec().

Referenced by init_windows_ops().

static ptid_t windows_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus ourstatus,
int  options 
) [static]
static LONGEST windows_xfer_memory ( gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  memaddr,
LONGEST  len 
) [static]

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

References BOOL, core_addr_to_string(), DEBUG_MEM, plongest(), and TARGET_XFER_E_IO.

Referenced by windows_xfer_partial().

static LONGEST windows_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST windows_xfer_shared_libraries ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
) [static]

Variable Documentation

BOOL WINAPI(* AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD) [static]

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

DEBUG_EVENT current_event [static]

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

HANDLE current_process_handle [static]

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

int debug_events = 0 [static]

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

int debug_exceptions = 0 [static]

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

int debug_exec = 0 [static]

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

int debug_memory = 0 [static]

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

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

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

BOOL WINAPI(* DebugActiveProcessStop)(DWORD) [static]

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

BOOL WINAPI(* DebugBreakProcess)(HANDLE) [static]

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

BOOL WINAPI(* DebugSetProcessKillOnExit)(BOOL) [static]

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

uintptr_t dr[8] [static]

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

Referenced by do_initial_windows_stuff().

BOOL WINAPI(* EnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD) [static]

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

int event_count = 0 [static]

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

int exception_count = 0 [static]

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

COORD WINAPI(* GetConsoleFontSize)(HANDLE, DWORD) [static]

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

BOOL WINAPI(* GetCurrentConsoleFont)(HANDLE, BOOL, CONSOLE_FONT_INFO *) [static]

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

DWORD WINAPI(* GetModuleFileNameEx)(HANDLE, HMODULE, LPSTR, DWORD) [static]

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

Referenced by _initialize_loadable(), and get_module_name().

BOOL WINAPI(* GetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD) [static]

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

enum gdb_signal last_sig = GDB_SIGNAL_0 [static]

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

BOOL WINAPI(* LookupPrivilegeValueA)(LPCSTR, LPCSTR, PLUID) [static]

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

DWORD main_thread_id [static]
const int* mappings [static]

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

int new_console = 0 [static]

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

int new_group = 1 [static]

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

int open_process_used = 0 [static]

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

BOOL WINAPI(* OpenProcessToken)(HANDLE, DWORD, PHANDLE) [static]

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

CONTEXT saved_context [static]
int saw_create [static]

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

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

struct so_list solib_start* solib_end [static]

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

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

Referenced by windows_init_thread_list().

int useshell = 0 [static]

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

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

struct target_ops windows_ops [static]

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

Referenced by _initialize_windows_nat(), and init_windows_ops().

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, -1}}

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines