GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
windows-tdep.c File Reference
#include "defs.h"
#include "windows-tdep.h"
#include "gdbsupport/gdb_obstack.h"
#include "xml-support.h"
#include "gdbarch.h"
#include "target.h"
#include "value.h"
#include "inferior.h"
#include "command.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "objfiles.h"
#include "symfile.h"
#include "coff-pe-read.h"
#include "gdb_bfd.h"
#include "solib.h"
#include "solib-target.h"
#include "gdbcore.h"
#include "coff/internal.h"
#include "libcoff.h"
#include "solist.h"

Go to the source code of this file.

Classes

struct  thread_information_block_32
 
struct  thread_information_block_64
 
struct  windows_gdbarch_data
 
struct  enum_value_name
 
struct  pe_import_directory_entry
 
struct  cpms_data
 

Macros

#define CYGWIN_DLL_NAME   "cygwin1.dll"
 

Typedefs

typedef struct thread_information_block_32 thread_information_32
 
typedef struct thread_information_block_64 thread_information_64
 

Enumerations

enum  {
  WINDOWS_SIGHUP = 1 , WINDOWS_SIGINT = 2 , WINDOWS_SIGQUIT = 3 , WINDOWS_SIGILL = 4 ,
  WINDOWS_SIGTRAP = 5 , WINDOWS_SIGIOT = 6 , WINDOWS_SIGEMT = 7 , WINDOWS_SIGFPE = 8 ,
  WINDOWS_SIGKILL = 9 , WINDOWS_SIGBUS = 10 , WINDOWS_SIGSEGV = 11 , WINDOWS_SIGSYS = 12 ,
  WINDOWS_SIGPIPE = 13 , WINDOWS_SIGALRM = 14 , WINDOWS_SIGTERM = 15 , WINDOWS_SIGBREAK = 21 ,
  WINDOWS_SIGABRT = 22
}
 
enum  {
  CYGWIN_SIGHUP = 1 , CYGWIN_SIGINT = 2 , CYGWIN_SIGQUIT = 3 , CYGWIN_SIGILL = 4 ,
  CYGWIN_SIGTRAP = 5 , CYGWIN_SIGABRT = 6 , CYGWIN_SIGEMT = 7 , CYGWIN_SIGFPE = 8 ,
  CYGWIN_SIGKILL = 9 , CYGWIN_SIGBUS = 10 , CYGWIN_SIGSEGV = 11 , CYGWIN_SIGSYS = 12 ,
  CYGWIN_SIGPIPE = 13 , CYGWIN_SIGALRM = 14 , CYGWIN_SIGTERM = 15 , CYGWIN_SIGURG = 16 ,
  CYGWIN_SIGSTOP = 17 , CYGWIN_SIGTSTP = 18 , CYGWIN_SIGCONT = 19 , CYGWIN_SIGCHLD = 20 ,
  CYGWIN_SIGTTIN = 21 , CYGWIN_SIGTTOU = 22 , CYGWIN_SIGIO = 23 , CYGWIN_SIGXCPU = 24 ,
  CYGWIN_SIGXFSZ = 25 , CYGWIN_SIGVTALRM = 26 , CYGWIN_SIGPROF = 27 , CYGWIN_SIGWINCH = 28 ,
  CYGWIN_SIGLOST = 29 , CYGWIN_SIGUSR1 = 30 , CYGWIN_SIGUSR2 = 31
}
 

Functions

static struct windows_gdbarch_dataget_windows_gdbarch_data (struct gdbarch *gdbarch)
 
static struct typewindows_get_tlb_type (struct gdbarch *gdbarch)
 
static void tlb_value_read (struct value *val)
 
static void tlb_value_write (struct value *v, struct value *fromval)
 
static struct valuetlb_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
 
static int display_one_tib (ptid_t ptid)
 
static void display_tib (const char *args, int from_tty)
 
void windows_xfer_shared_library (const char *so_name, CORE_ADDR load_addr, CORE_ADDR *text_offset_cached, struct gdbarch *gdbarch, struct obstack *obstack)
 
static void windows_iterate_over_objfiles_in_search_order (gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype cb, objfile *current_objfile)
 
static void show_maint_show_all_tib (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
void init_w32_command_list (void)
 
static int windows_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal)
 
static int cygwin_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal)
 
static struct typecreate_enum (struct gdbarch *gdbarch, int bit, const char *name, const struct enum_value_name *values, int count)
 
static struct typewindows_get_siginfo_type (struct gdbarch *gdbarch)
 
static void windows_solib_create_inferior_hook (int from_tty)
 
static void windows_init_abi_common (struct gdbarch_info info, struct gdbarch *gdbarch)
 
void windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
void cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
 gdb_static_assert (sizeof(pe_import_directory_entry)==20)
 
bool is_linked_with_cygwin_dll (bfd *abfd)
 
static void core_process_module_section (bfd *abfd, asection *sect, void *obj)
 
ULONGEST windows_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
 
std::string windows_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
 
void _initialize_windows_tdep ()
 

Variables

static constexpr unsigned int NOTE_INFO_MODULE = 3
 
static constexpr unsigned int NOTE_INFO_MODULE64 = 4
 
struct cmd_list_elementinfo_w32_cmdlist
 
static const char * TIB_NAME []
 
static const int MAX_TIB32
 
static const int MAX_TIB64
 
static const int FULL_TIB_SIZE = 0x1000
 
static bool maint_display_all_tib = false
 
static const registry< gdbarch >::key< windows_gdbarch_datawindows_gdbarch_data_handle
 
static const struct lval_funcs tlb_value_funcs
 
static int w32_prefix_command_valid = 0
 
static const struct enum_value_name exception_values []
 
static const struct enum_value_name violation_values []
 
static struct target_so_ops windows_so_ops
 
static const struct internalvar_funcs tlb_funcs
 

Macro Definition Documentation

◆ CYGWIN_DLL_NAME

#define CYGWIN_DLL_NAME   "cygwin1.dll"

Definition at line 40 of file windows-tdep.c.

Referenced by is_linked_with_cygwin_dll().

Typedef Documentation

◆ thread_information_32

◆ thread_information_64

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WINDOWS_SIGHUP 
WINDOWS_SIGINT 
WINDOWS_SIGQUIT 
WINDOWS_SIGILL 
WINDOWS_SIGTRAP 
WINDOWS_SIGIOT 
WINDOWS_SIGEMT 
WINDOWS_SIGFPE 
WINDOWS_SIGKILL 
WINDOWS_SIGBUS 
WINDOWS_SIGSEGV 
WINDOWS_SIGSYS 
WINDOWS_SIGPIPE 
WINDOWS_SIGALRM 
WINDOWS_SIGTERM 
WINDOWS_SIGBREAK 
WINDOWS_SIGABRT 

Definition at line 49 of file windows-tdep.c.

◆ anonymous enum

anonymous enum
Enumerator
CYGWIN_SIGHUP 
CYGWIN_SIGINT 
CYGWIN_SIGQUIT 
CYGWIN_SIGILL 
CYGWIN_SIGTRAP 
CYGWIN_SIGABRT 
CYGWIN_SIGEMT 
CYGWIN_SIGFPE 
CYGWIN_SIGKILL 
CYGWIN_SIGBUS 
CYGWIN_SIGSEGV 
CYGWIN_SIGSYS 
CYGWIN_SIGPIPE 
CYGWIN_SIGALRM 
CYGWIN_SIGTERM 
CYGWIN_SIGURG 
CYGWIN_SIGSTOP 
CYGWIN_SIGTSTP 
CYGWIN_SIGCONT 
CYGWIN_SIGCHLD 
CYGWIN_SIGTTIN 
CYGWIN_SIGTTOU 
CYGWIN_SIGIO 
CYGWIN_SIGXCPU 
CYGWIN_SIGXFSZ 
CYGWIN_SIGVTALRM 
CYGWIN_SIGPROF 
CYGWIN_SIGWINCH 
CYGWIN_SIGLOST 
CYGWIN_SIGUSR1 
CYGWIN_SIGUSR2 

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

Function Documentation

◆ _initialize_windows_tdep()

void _initialize_windows_tdep ( )

◆ core_process_module_section()

static void core_process_module_section ( bfd * abfd,
asection * sect,
void * obj )
static

◆ create_enum()

static struct type * create_enum ( struct gdbarch * gdbarch,
int bit,
const char * name,
const struct enum_value_name * values,
int count )
static

◆ cygwin_gdb_signal_to_target()

static int cygwin_gdb_signal_to_target ( struct gdbarch * gdbarch,
enum gdb_signal signal )
static

◆ cygwin_init_abi()

void cygwin_init_abi ( struct gdbarch_info info,
struct gdbarch * gdbarch )

◆ display_one_tib()

static int display_one_tib ( ptid_t ptid)
static

◆ display_tib()

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

Definition at line 521 of file windows-tdep.c.

References display_one_tib(), and inferior_ptid.

Referenced by _initialize_windows_tdep().

◆ gdb_static_assert()

gdb_static_assert ( sizeof(pe_import_directory_entry) = =20)

◆ get_windows_gdbarch_data()

static struct windows_gdbarch_data * get_windows_gdbarch_data ( struct gdbarch * gdbarch)
static

◆ init_w32_command_list()

void init_w32_command_list ( void )

◆ is_linked_with_cygwin_dll()

bool is_linked_with_cygwin_dll ( bfd * abfd)

◆ show_maint_show_all_tib()

static void show_maint_show_all_tib ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 592 of file windows-tdep.c.

References gdb_printf().

Referenced by _initialize_windows_tdep().

◆ tlb_make_value()

static struct value * tlb_make_value ( struct gdbarch * gdbarch,
struct internalvar * var,
void * ignore )
static

◆ tlb_value_read()

static void tlb_value_read ( struct value * val)
static

◆ tlb_value_write()

static void tlb_value_write ( struct value * v,
struct value * fromval )
static

Definition at line 416 of file windows-tdep.c.

◆ windows_core_pid_to_str()

std::string windows_core_pid_to_str ( struct gdbarch * gdbarch,
ptid_t ptid )

Definition at line 1185 of file windows-tdep.c.

References normal_pid_to_str().

Referenced by amd64_windows_init_abi_common(), and i386_windows_init_abi_common().

◆ windows_core_xfer_shared_libraries()

ULONGEST windows_core_xfer_shared_libraries ( struct gdbarch * gdbarch,
gdb_byte * readbuf,
ULONGEST offset,
ULONGEST len )

◆ windows_gdb_signal_to_target()

static int windows_gdb_signal_to_target ( struct gdbarch * gdbarch,
enum gdb_signal signal )
static

◆ windows_get_siginfo_type()

static struct type * windows_get_siginfo_type ( struct gdbarch * gdbarch)
static

◆ windows_get_tlb_type()

static struct type * windows_get_tlb_type ( struct gdbarch * gdbarch)
static

◆ windows_init_abi()

void windows_init_abi ( struct gdbarch_info info,
struct gdbarch * gdbarch )

◆ windows_init_abi_common()

static void windows_init_abi_common ( struct gdbarch_info info,
struct gdbarch * gdbarch )
static

◆ windows_iterate_over_objfiles_in_search_order()

static void windows_iterate_over_objfiles_in_search_order ( gdbarch * gdbarch,
iterate_over_objfiles_in_search_order_cb_ftype cb,
objfile * current_objfile )
static

Definition at line 573 of file windows-tdep.c.

References current_program_space, and program_space::objfiles().

Referenced by windows_init_abi_common().

◆ windows_solib_create_inferior_hook()

static void windows_solib_create_inferior_hook ( int from_tty)
static

◆ windows_xfer_shared_library()

void windows_xfer_shared_library ( const char * so_name,
CORE_ADDR load_addr,
CORE_ADDR * text_offset_cached,
struct gdbarch * gdbarch,
struct obstack * obstack )

Variable Documentation

◆ exception_values

const struct enum_value_name exception_values[]
static
Initial value:
=
{
{ 0x40000015, "FATAL_APP_EXIT" },
{ 0x4000001E, "WX86_SINGLE_STEP" },
{ 0x4000001F, "WX86_BREAKPOINT" },
{ 0x40010005, "DBG_CONTROL_C" },
{ 0x40010008, "DBG_CONTROL_BREAK" },
{ 0x80000002, "DATATYPE_MISALIGNMENT" },
{ 0x80000003, "BREAKPOINT" },
{ 0x80000004, "SINGLE_STEP" },
{ 0xC0000005, "ACCESS_VIOLATION" },
{ 0xC0000006, "IN_PAGE_ERROR" },
{ 0xC000001D, "ILLEGAL_INSTRUCTION" },
{ 0xC0000025, "NONCONTINUABLE_EXCEPTION" },
{ 0xC0000026, "INVALID_DISPOSITION" },
{ 0xC000008C, "ARRAY_BOUNDS_EXCEEDED" },
{ 0xC000008D, "FLOAT_DENORMAL_OPERAND" },
{ 0xC000008E, "FLOAT_DIVIDE_BY_ZERO" },
{ 0xC000008F, "FLOAT_INEXACT_RESULT" },
{ 0xC0000090, "FLOAT_INVALID_OPERATION" },
{ 0xC0000091, "FLOAT_OVERFLOW" },
{ 0xC0000092, "FLOAT_STACK_CHECK" },
{ 0xC0000093, "FLOAT_UNDERFLOW" },
{ 0xC0000094, "INTEGER_DIVIDE_BY_ZERO" },
{ 0xC0000095, "INTEGER_OVERFLOW" },
{ 0xC0000096, "PRIV_INSTRUCTION" },
{ 0xC00000FD, "STACK_OVERFLOW" },
{ 0xC0000409, "FAST_FAIL" },
}

Definition at line 760 of file windows-tdep.c.

Referenced by windows_get_siginfo_type().

◆ FULL_TIB_SIZE

const int FULL_TIB_SIZE = 0x1000
static

Definition at line 174 of file windows-tdep.c.

Referenced by display_one_tib().

◆ info_w32_cmdlist

struct cmd_list_element* info_w32_cmdlist

◆ maint_display_all_tib

bool maint_display_all_tib = false
static

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

Referenced by _initialize_windows_tdep(), and display_one_tib().

◆ MAX_TIB32

const int MAX_TIB32
static
Initial value:
=
sizeof (thread_information_32) / sizeof (uint32_t)
struct thread_information_block_32 thread_information_32

Definition at line 170 of file windows-tdep.c.

Referenced by display_one_tib().

◆ MAX_TIB64

const int MAX_TIB64
static
Initial value:
=
sizeof (thread_information_64) / sizeof (uint64_t)
struct thread_information_block_64 thread_information_64

Definition at line 172 of file windows-tdep.c.

Referenced by display_one_tib().

◆ NOTE_INFO_MODULE

constexpr unsigned int NOTE_INFO_MODULE = 3
staticconstexpr

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

Referenced by core_process_module_section().

◆ NOTE_INFO_MODULE64

constexpr unsigned int NOTE_INFO_MODULE64 = 4
staticconstexpr

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

Referenced by core_process_module_section().

◆ TIB_NAME

const char* TIB_NAME[]
static
Initial value:
=
{
" current_seh ",
" current_top_of_stack ",
" current_bottom_of_stack ",
" sub_system_tib ",
" fiber_data ",
" arbitrary_data_slot ",
" linear_address_tib ",
" environment_pointer ",
" process_id ",
" current_thread_id ",
" active_rpc_handle ",
" thread_local_storage ",
" process_environment_block ",
" last_error_number "
}

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

Referenced by display_one_tib().

◆ tlb_funcs

const struct internalvar_funcs tlb_funcs
static
Initial value:
=
{
NULL,
}
static struct value * tlb_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)

Definition at line 959 of file windows-tdep.c.

Referenced by _initialize_windows_tdep().

◆ tlb_value_funcs

const struct lval_funcs tlb_value_funcs
static
Initial value:
=
{
}
static void tlb_value_read(struct value *val)
static void tlb_value_write(struct value *v, struct value *fromval)

Definition at line 421 of file windows-tdep.c.

Referenced by tlb_make_value().

◆ violation_values

const struct enum_value_name violation_values[]
static
Initial value:
=
{
{ 0, "READ_ACCESS_VIOLATION" },
{ 1, "WRITE_ACCESS_VIOLATION" },
{ 8, "DATA_EXECUTION_PREVENTION_VIOLATION" },
}

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

Referenced by windows_get_siginfo_type().

◆ w32_prefix_command_valid

int w32_prefix_command_valid = 0
static

Definition at line 600 of file windows-tdep.c.

Referenced by init_w32_command_list().

◆ windows_gdbarch_data_handle

const registry<gdbarch>::key<windows_gdbarch_data> windows_gdbarch_data_handle
static

Definition at line 186 of file windows-tdep.c.

Referenced by get_windows_gdbarch_data().

◆ windows_so_ops

struct target_so_ops windows_so_ops
static

Definition at line 914 of file windows-tdep.c.

Referenced by windows_init_abi_common().