GDB (xrefs)

Classes | Functions | Variables
/tmp/gdb-8.1/gdb/amd64-windows-tdep.c File Reference
`#include "defs.h"`
`#include "osabi.h"`
`#include "amd64-tdep.h"`
`#include "x86-xstate.h"`
`#include "gdbtypes.h"`
`#include "gdbcore.h"`
`#include "regcache.h"`
`#include "windows-tdep.h"`
`#include "frame.h"`
`#include "objfiles.h"`
`#include "frame-unwind.h"`
`#include "coff/internal.h"`
`#include "coff/i386.h"`
`#include "coff/pe.h"`
`#include "libcoff.h"`
`#include "value.h"`
`#include <algorithm>`

Go to the source code of this file.

## Classes
struct | amd64_windows_frame_cache

## Functions
static int | amd64_windows_passed_by_integer_register (struct type *type)
static int | amd64_windows_passed_by_xmm_register (struct type *type)
static int | amd64_windows_passed_by_pointer (struct type *type)
static CORE_ADDR | amd64_windows_adjust_args_passed_by_pointer (struct value **args, int nargs, CORE_ADDR sp)
static void | amd64_windows_store_arg_in_reg (struct regcache *regcache, struct value *arg, int regno)
static CORE_ADDR | amd64_windows_push_arguments (struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp, int struct_return)
static CORE_ADDR | amd64_windows_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static enum return_value_convention | amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static CORE_ADDR | amd64_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
static int | pc_in_range (CORE_ADDR pc, const struct amd64_windows_frame_cache *cache)
static int | amd64_windows_frame_decode_epilogue (struct frame_info *this_frame, struct amd64_windows_frame_cache *cache)
static void | amd64_windows_frame_decode_insns (struct frame_info *this_frame, struct amd64_windows_frame_cache *cache, CORE_ADDR unwind_info)
static int | amd64_windows_find_unwind_info (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR *unwind_info, CORE_ADDR *image_base, CORE_ADDR *start_rva, CORE_ADDR *end_rva)
static struct amd64_windows_frame_cache * | amd64_windows_frame_cache (struct frame_info *this_frame, void **this_cache)
static struct value * | amd64_windows_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static void | amd64_windows_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static CORE_ADDR | amd64_windows_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
static CORE_ADDR | amd64_windows_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
static const char * | amd64_windows_auto_wide_charset (void)
static void | amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
void | _initialize_amd64_windows_tdep (void)

## Variables
static int | amd64_windows_dummy_call_integer_regs []
static enum amd64_regnum | amd64_windows_w2gdb_regnum []
static const struct frame_unwind | amd64_windows_frame_unwind

## Function Documentation

## ◆ _initialize_amd64_windows_tdep()

void _initialize_amd64_windows_tdep | ( | void |  | ) |

Definition at line 1249 of file amd64-windows-tdep.c.

References amd64_windows_init_abi(), GDB_OSABI_CYGWIN, and gdbarch_register_osabi().

## ◆ amd64_skip_main_prologue()

static CORE_ADDR amd64_skip_main_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 343 of file amd64-windows-tdep.c.

References extract_signed_integer(), gdbarch_byte_order(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_LINKAGE_NAME, and target_read_memory().

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_adjust_args_passed_by_pointer()

static CORE_ADDR amd64_windows_adjust_args_passed_by_pointer | ( | struct value ** | args,
|  | int | nargs,
|  | CORE_ADDR | sp
| ) |  |
| static

Definition at line 107 of file amd64-windows-tdep.c.

References amd64_windows_passed_by_pointer(), TYPE_LENGTH, value_addr(), value_contents(), value_from_contents_and_address(), value_type(), and write_memory().

Referenced by amd64_windows_push_arguments().

## ◆ amd64_windows_auto_wide_charset()

static const char* amd64_windows_auto_wide_charset | ( | void |  | ) |
| static

Definition at line 1207 of file amd64-windows-tdep.c.

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_find_unwind_info()

static int amd64_windows_find_unwind_info | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc,
|  | CORE_ADDR * | unwind_info,
|  | CORE_ADDR * | image_base,
|  | CORE_ADDR * | start_rva,
|  | CORE_ADDR * | end_rva
| ) |  |
| static

Definition at line 934 of file amd64-windows-tdep.c.

References ANOFFSET, extract_unsigned_integer(), find_pc_section(), fprintf_unfiltered(), frame_debug, gdb_stdlog, gdbarch_byte_order(), objfile::obfd, obj_section::objfile, objfile::objfile(), paddress(), SECT_OFF_TEXT, objfile::section_offsets, and target_read_memory().

Referenced by amd64_windows_frame_cache(), and amd64_windows_skip_prologue().

## ◆ amd64_windows_frame_cache()

static struct amd64_windows_frame_cache* amd64_windows_frame_cache | ( | struct frame_info * | this_frame,
|  | void ** | this_cache
| ) |  |
| static

Definition at line 1012 of file amd64-windows-tdep.c.

References AMD64_RSP_REGNUM, amd64_windows_find_unwind_info(), amd64_windows_frame_decode_insns(), gdbarch::byte_order, amd64_windows_frame_cache::end_rva, extract_unsigned_integer(), FRAME_OBSTACK_ZALLOC, gdbarch_byte_order(), get_frame_arch(), get_frame_pc(), get_frame_register(), amd64_windows_frame_cache::image_base, amd64_windows_frame_cache::pc, amd64_windows_frame_cache::prev_rip_addr, amd64_windows_frame_cache::prev_sp, amd64_windows_frame_cache::sp, and amd64_windows_frame_cache::start_rva.

Referenced by amd64_windows_frame_prev_register(), and amd64_windows_frame_this_id().

## ◆ amd64_windows_frame_decode_epilogue()

static int amd64_windows_frame_decode_epilogue | ( | struct frame_info * | this_frame,
|  | struct amd64_windows_frame_cache * | cache
| ) |  |
| static

Definition at line 438 of file amd64-windows-tdep.c.

References amd64_windows_w2gdb_regnum, gdbarch::byte_order, extract_signed_integer(), extract_unsigned_integer(), gdbarch_byte_order(), get_frame_arch(), amd64_windows_frame_cache::pc, pc_in_range(), amd64_windows_frame_cache::prev_reg_addr, amd64_windows_frame_cache::prev_rip_addr, amd64_windows_frame_cache::prev_sp, QUIT, amd64_windows_frame_cache::sp, and target_read_memory().

Referenced by amd64_windows_frame_decode_insns().

## ◆ amd64_windows_frame_decode_insns()

static void amd64_windows_frame_decode_insns | ( | struct frame_info * | this_frame,
|  | struct amd64_windows_frame_cache * | cache,
|  | CORE_ADDR | unwind_info
| ) |  |
| static

Definition at line 618 of file amd64-windows-tdep.c.

References amd64_windows_frame_decode_epilogue(), amd64_windows_w2gdb_regnum, gdbarch::byte_order, amd64_windows_frame_cache::end_rva, extract_unsigned_integer(), fprintf_unfiltered(), frame_debug, gdb_stdlog, gdbarch_byte_order(), gdbarch_register_name(), get_frame_arch(), get_frame_register(), amd64_windows_frame_cache::image_base, memset(), paddress(), amd64_windows_frame_cache::pc, amd64_windows_frame_cache::prev_reg_addr, amd64_windows_frame_cache::prev_rip_addr, amd64_windows_frame_cache::prev_rsp_addr, amd64_windows_frame_cache::prev_sp, amd64_windows_frame_cache::prev_xmm_addr, QUIT, amd64_windows_frame_cache::sp, amd64_windows_frame_cache::start_rva, and target_read_memory().

Referenced by amd64_windows_frame_cache().

## ◆ amd64_windows_frame_prev_register()

static struct value* amd64_windows_frame_prev_register | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | int | regnum
| ) |  |
| static

Definition at line 1057 of file amd64-windows-tdep.c.

References AMD64_R15_REGNUM, AMD64_RAX_REGNUM, AMD64_RIP_REGNUM, AMD64_RSP_REGNUM, amd64_windows_frame_cache(), AMD64_XMM0_REGNUM, fprintf_unfiltered(), frame_debug, frame_unwind_got_constant(), frame_unwind_got_memory(), frame_unwind_got_register(), gdb_stdlog, gdbarch_register_name(), get_frame_arch(), paddress(), amd64_windows_frame_cache::prev_reg_addr, amd64_windows_frame_cache::prev_rip_addr, amd64_windows_frame_cache::prev_rsp_addr, amd64_windows_frame_cache::prev_sp, amd64_windows_frame_cache::prev_xmm_addr, and regnum.

## ◆ amd64_windows_frame_this_id()

static void amd64_windows_frame_this_id | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | struct frame_id * | this_id
| ) |  |
| static

Definition at line 1105 of file amd64-windows-tdep.c.

References amd64_windows_frame_cache(), frame_id_build(), amd64_windows_frame_cache::image_base, amd64_windows_frame_cache::prev_sp, and amd64_windows_frame_cache::start_rva.

## ◆ amd64_windows_init_abi()

static void amd64_windows_init_abi | ( | struct gdbarch_info | info,
|  | struct gdbarch * | gdbarch
| ) |  |
| static

Definition at line 1213 of file amd64-windows-tdep.c.

References amd64_init_abi(), amd64_skip_main_prologue(), amd64_target_description(), amd64_windows_auto_wide_charset(), amd64_windows_frame_unwind, amd64_windows_push_dummy_call(), amd64_windows_return_value(), amd64_windows_skip_prologue(), amd64_windows_skip_trampoline_code(), frame_unwind_append_unwinder(), set_gdbarch_auto_wide_charset(), set_gdbarch_long_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_return_value(), set_gdbarch_skip_main_prologue(), set_gdbarch_skip_prologue(), set_gdbarch_skip_trampoline_code(), windows_init_abi(), and X86_XSTATE_SSE_MASK.

Referenced by _initialize_amd64_windows_tdep().

## ◆ amd64_windows_passed_by_integer_register()

static int amd64_windows_passed_by_integer_register | ( | struct type * | type | ) |
| static

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

References TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_ENUM, TYPE_CODE_INT, TYPE_CODE_PTR, TYPE_CODE_RANGE, TYPE_CODE_REF, TYPE_CODE_RVALUE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNION, and TYPE_LENGTH.

Referenced by amd64_windows_passed_by_pointer(), and amd64_windows_push_arguments().

## ◆ amd64_windows_passed_by_pointer()

static int amd64_windows_passed_by_pointer | ( | struct type * | type | ) |
| static

Definition at line 88 of file amd64-windows-tdep.c.

References amd64_windows_passed_by_integer_register(), and amd64_windows_passed_by_xmm_register().

Referenced by amd64_windows_adjust_args_passed_by_pointer().

## ◆ amd64_windows_passed_by_xmm_register()

static int amd64_windows_passed_by_xmm_register | ( | struct type * | type | ) |
| static

Definition at line 77 of file amd64-windows-tdep.c.

References TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, and TYPE_LENGTH.

Referenced by amd64_windows_passed_by_pointer(), and amd64_windows_push_arguments().

## ◆ amd64_windows_push_arguments()

static CORE_ADDR amd64_windows_push_arguments | ( | struct regcache * | regcache,
|  | int | nargs,
|  | struct value ** | args,
|  | CORE_ADDR | sp,
|  | int | struct_return
| ) |  |
| static

Definition at line 158 of file amd64-windows-tdep.c.

References amd64_windows_adjust_args_passed_by_pointer(), amd64_windows_dummy_call_integer_regs, amd64_windows_passed_by_integer_register(), amd64_windows_passed_by_xmm_register(), amd64_windows_store_arg_in_reg(), AMD64_XMM0_REGNUM, TYPE_LENGTH, value_contents(), value_type(), and write_memory().

Referenced by amd64_windows_push_dummy_call().

## ◆ amd64_windows_push_dummy_call()

static CORE_ADDR amd64_windows_push_dummy_call | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct regcache * | regcache,
|  | CORE_ADDR | bp_addr,
|  | int | nargs,
|  | struct value ** | args,
|  | CORE_ADDR | sp,
|  | int | struct_return,
|  | CORE_ADDR | struct_addr
| ) |  |
| static

Definition at line 245 of file amd64-windows-tdep.c.

References AMD64_RBP_REGNUM, AMD64_RSP_REGNUM, amd64_windows_dummy_call_integer_regs, amd64_windows_push_arguments(), gdbarch_byte_order(), regcache_cooked_write(), store_unsigned_integer(), and write_memory().

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_return_value()

static enum return_value_convention amd64_windows_return_value | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct type * | type,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf
| ) |  |
| static

Definition at line 290 of file amd64-windows-tdep.c.

References AMD64_RAX_REGNUM, AMD64_XMM0_REGNUM, read_memory(), regcache_raw_read_part(), regcache_raw_read_unsigned(), regcache_raw_write_part(), regnum, RETURN_VALUE_ABI_RETURNS_ADDRESS, RETURN_VALUE_REGISTER_CONVENTION, TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, and TYPE_LENGTH.

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_skip_prologue()

static CORE_ADDR amd64_windows_skip_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 1130 of file amd64-windows-tdep.c.

References amd64_windows_find_unwind_info(), find_pc_partial_function(), skip_prologue_using_sal(), and target_read_memory().

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_skip_trampoline_code()

static CORE_ADDR amd64_windows_skip_trampoline_code | ( | struct frame_info * | frame,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 1170 of file amd64-windows-tdep.c.

References gdbarch::byte_order, gdbarch_byte_order(), get_frame_arch(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_LINKAGE_NAME, offset, read_memory_unsigned_integer(), and startswith().

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_store_arg_in_reg()

static void amd64_windows_store_arg_in_reg | ( | struct regcache * | regcache,
|  | struct value * | arg,
|  | int | regno
| ) |  |
| static

Definition at line 138 of file amd64-windows-tdep.c.

References gdb_assert, memset(), regcache_cooked_write(), TYPE_LENGTH, value_contents(), and value_type().

Referenced by amd64_windows_push_arguments().

## ◆ pc_in_range()

static int pc_in_range | ( | CORE_ADDR | pc,
|  | const struct amd64_windows_frame_cache * | cache
| ) |  |
| static

Definition at line 426 of file amd64-windows-tdep.c.

References amd64_windows_frame_cache::end_rva, amd64_windows_frame_cache::image_base, and amd64_windows_frame_cache::start_rva.

Referenced by amd64_windows_frame_decode_epilogue().

## Variable Documentation

## ◆ amd64_windows_dummy_call_integer_regs

int amd64_windows_dummy_call_integer_regs[]
| static

Initial value:
=
{
AMD64_RCX_REGNUM,
AMD64_RDX_REGNUM,
AMD64_R8_REGNUM,
AMD64_R9_REGNUM
}
AMD64_R8_REGNUM
Definition: amd64-tdep.h:42
AMD64_R9_REGNUM
Definition: amd64-tdep.h:43
AMD64_RCX_REGNUM
Definition: amd64-tdep.h:36
AMD64_RDX_REGNUM
Definition: amd64-tdep.h:37

Definition at line 37 of file amd64-windows-tdep.c.

Referenced by amd64_windows_push_arguments(), and amd64_windows_push_dummy_call().

## ◆ amd64_windows_frame_unwind

const struct frame_unwind amd64_windows_frame_unwind
| static

Initial value:
=
{
NORMAL_FRAME,
default_frame_unwind_stop_reason,
&amd64_windows_frame_this_id,
&amd64_windows_frame_prev_register,
NULL,
default_frame_sniffer
}
amd64_windows_frame_this_id
static void amd64_windows_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: amd64-windows-tdep.c:1105
amd64_windows_frame_prev_register
static struct value * amd64_windows_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: amd64-windows-tdep.c:1057
NORMAL_FRAME
Definition: frame.h:244
default_frame_sniffer
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:174
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184

Definition at line 1117 of file amd64-windows-tdep.c.

Referenced by amd64_windows_init_abi().

## ◆ amd64_windows_w2gdb_regnum

enum amd64_regnum amd64_windows_w2gdb_regnum[]
| static

Initial value:
=
{
AMD64_RAX_REGNUM,
AMD64_RCX_REGNUM,
AMD64_RDX_REGNUM,
AMD64_RBX_REGNUM,
AMD64_RSP_REGNUM,
AMD64_RBP_REGNUM,
AMD64_RSI_REGNUM,
AMD64_RDI_REGNUM,
AMD64_R8_REGNUM,
AMD64_R9_REGNUM,
AMD64_R10_REGNUM,
AMD64_R11_REGNUM,
AMD64_R12_REGNUM,
AMD64_R13_REGNUM,
AMD64_R14_REGNUM,
AMD64_R15_REGNUM
}
AMD64_R8_REGNUM
Definition: amd64-tdep.h:42
AMD64_RBX_REGNUM
Definition: amd64-tdep.h:35
AMD64_R9_REGNUM
Definition: amd64-tdep.h:43
AMD64_R11_REGNUM
Definition: amd64-tdep.h:45
AMD64_RCX_REGNUM
Definition: amd64-tdep.h:36
AMD64_RAX_REGNUM
Definition: amd64-tdep.h:34
AMD64_R12_REGNUM
Definition: amd64-tdep.h:46
AMD64_R10_REGNUM
Definition: amd64-tdep.h:44
AMD64_RSP_REGNUM
Definition: amd64-tdep.h:41
AMD64_RSI_REGNUM
Definition: amd64-tdep.h:38
AMD64_RDI_REGNUM
Definition: amd64-tdep.h:39
AMD64_R13_REGNUM
Definition: amd64-tdep.h:47
AMD64_RBP_REGNUM
Definition: amd64-tdep.h:40
AMD64_RDX_REGNUM
Definition: amd64-tdep.h:37
AMD64_R14_REGNUM
Definition: amd64-tdep.h:48
AMD64_R15_REGNUM
Definition: amd64-tdep.h:49

Definition at line 402 of file amd64-windows-tdep.c.

Referenced by amd64_windows_frame_decode_epilogue(), and amd64_windows_frame_decode_insns().