GDBserver

Macros | Functions | Variables
win32-i386-low.c File Reference
`#include "server.h"`
`#include "win32-low.h"`
`#include "x86-low.h"`
`#include "x86-xstate.h"`
`#include "arch/i386.h"`
`#include "tdesc.h"`

Go to the source code of this file.

## Macros
#define | CONTEXT_EXTENDED_REGISTERS 0
#define | FCS_REGNUM 27
#define | FOP_REGNUM 31
#define | FLAG_TRACE_BIT 0x100
#define | RET_DR(DR)
#define | context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
#define | i386_win32_breakpoint_len 1

## Functions
static void | update_debug_registers (thread_info *thread)
static void | x86_dr_low_set_addr (int regnum, CORE_ADDR addr)
static void | x86_dr_low_set_control (unsigned long control)
static DWORD64 | win32_get_current_dr (int dr)
static CORE_ADDR | x86_dr_low_get_addr (int regnum)
static unsigned long | x86_dr_low_get_control (void)
static unsigned long | x86_dr_low_get_status (void)
static int | i386_supports_z_point_type (char z_type)
static int | i386_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
static int | i386_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
static int | x86_stopped_by_watchpoint (void)
static CORE_ADDR | x86_stopped_data_address (void)
static void | i386_initial_stuff (void)
static void | i386_get_thread_context (win32_thread_info *th)
static void | i386_prepare_to_resume (win32_thread_info *th)
static void | i386_thread_added (win32_thread_info *th)
static void | i386_single_step (win32_thread_info *th)
static void | i386_fetch_inferior_register (struct regcache *regcache, win32_thread_info *th, int r)
static void | i386_store_inferior_register (struct regcache *regcache, win32_thread_info *th, int r)
static void | i386_arch_setup (void)

## Variables
static struct x86_debug_reg_state | debug_reg_state
struct x86_dr_low_type | x86_dr_low
static const int | mappings []
static const unsigned char | i386_win32_breakpoint = 0xcc
struct win32_target_ops | the_low_target

## Macro Definition Documentation

## ◆ CONTEXT_EXTENDED_REGISTERS

#define CONTEXT_EXTENDED_REGISTERS 0

Definition at line 29 of file win32-i386-low.c.

Referenced by i386_get_thread_context().

## ◆ context_offset

#define context_offset | ( |  | x | ) | ((int)&(((CONTEXT *)NULL)->x))

Definition at line 280 of file win32-i386-low.c.

Referenced by i386_fetch_inferior_register(), and i386_store_inferior_register().

## ◆ FCS_REGNUM

#define FCS_REGNUM 27

Definition at line 32 of file win32-i386-low.c.

Referenced by i386_fetch_inferior_register().

## ◆ FLAG_TRACE_BIT

#define FLAG_TRACE_BIT 0x100

Definition at line 35 of file win32-i386-low.c.

Referenced by i386_single_step().

## ◆ FOP_REGNUM

#define FOP_REGNUM 31

Definition at line 33 of file win32-i386-low.c.

Referenced by i386_fetch_inferior_register().

## ◆ i386_win32_breakpoint_len

#define i386_win32_breakpoint_len 1

Definition at line 429 of file win32-i386-low.c.

## ◆ RET_DR

#define RET_DR | ( |  | DR | ) |

Value:
case DR: \
return th->context.Dr ## DR

Referenced by win32_get_current_dr().

## Function Documentation

## ◆ i386_arch_setup()

static void i386_arch_setup | ( | void |  | ) |
| static

Definition at line 432 of file win32-i386-low.c.

References init_target_desc(), win32_tdesc, and X86_XSTATE_SSE_MASK.

## ◆ i386_fetch_inferior_register()

static void i386_fetch_inferior_register | ( | struct regcache * | regcache,
|  | win32_thread_info * | th,
|  | int | r
| ) |  |
| static

Definition at line 399 of file win32-i386-low.c.

References win32_thread_info::context, context_offset, FCS_REGNUM, FOP_REGNUM, mappings, and supply_register().

## ◆ i386_get_thread_context()

static void i386_get_thread_context | ( | win32_thread_info * | th | ) |
| static

Definition at line 212 of file win32-i386-low.c.

References win32_thread_info::context, CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, error(), and win32_thread_info::h.

## ◆ i386_initial_stuff()

static void i386_initial_stuff | ( | void |  | ) |
| static

Definition at line 206 of file win32-i386-low.c.

References debug_reg_state, and x86_low_init_dregs().

## ◆ i386_insert_point()

static int i386_insert_point | ( | enum raw_bkpt_type | type,
|  | CORE_ADDR | addr,
|  | int | size,
|  | struct raw_breakpoint * | bp
| ) |  |
| static

Definition at line 149 of file win32-i386-low.c.

References debug_reg_state, raw_bkpt_type_access_wp, raw_bkpt_type_to_target_hw_bp_type(), raw_bkpt_type_write_wp, and x86_dr_insert_watchpoint().

## ◆ i386_prepare_to_resume()

static void i386_prepare_to_resume | ( | win32_thread_info * | th | ) |
| static

Definition at line 239 of file win32-i386-low.c.

References win32_thread_info::context, debug_reg_state, win32_thread_info::debug_registers_changed, x86_debug_reg_state::dr_control_mirror, x86_debug_reg_state::dr_mirror, and win32_require_context().

## ◆ i386_remove_point()

static int i386_remove_point | ( | enum raw_bkpt_type | type,
|  | CORE_ADDR | addr,
|  | int | size,
|  | struct raw_breakpoint * | bp
| ) |  |
| static

Definition at line 170 of file win32-i386-low.c.

References debug_reg_state, raw_bkpt_type_access_wp, raw_bkpt_type_to_target_hw_bp_type(), raw_bkpt_type_write_wp, and x86_dr_remove_watchpoint().

## ◆ i386_single_step()

static void i386_single_step | ( | win32_thread_info * | th | ) |
| static

Definition at line 266 of file win32-i386-low.c.

References win32_thread_info::context, and FLAG_TRACE_BIT.

## ◆ i386_store_inferior_register()

static void i386_store_inferior_register | ( | struct regcache * | regcache,
|  | win32_thread_info * | th,
|  | int | r
| ) |  |
| static

Definition at line 421 of file win32-i386-low.c.

References collect_register(), win32_thread_info::context, context_offset, and mappings.

## ◆ i386_supports_z_point_type()

static int i386_supports_z_point_type | ( | char | z_type | ) |
| static

Definition at line 136 of file win32-i386-low.c.

References Z_PACKET_ACCESS_WP, and Z_PACKET_WRITE_WP.

## ◆ i386_thread_added()

static void i386_thread_added | ( | win32_thread_info * | th | ) |
| static

Definition at line 260 of file win32-i386-low.c.

References win32_thread_info::debug_registers_changed.

## ◆ update_debug_registers()

static void update_debug_registers | ( | thread_info * | thread | ) |
| static

Definition at line 40 of file win32-i386-low.c.

References win32_thread_info::debug_registers_changed, and thread_target_data().

Referenced by x86_dr_low_set_addr(), and x86_dr_low_set_control().

## ◆ win32_get_current_dr()

static DWORD64 win32_get_current_dr | ( | int | dr | ) |
| static

Definition at line 73 of file win32-i386-low.c.

References current_thread, gdb_assert_not_reached, RET_DR, thread_target_data(), and win32_require_context().

Referenced by x86_dr_low_get_addr(), x86_dr_low_get_control(), and x86_dr_low_get_status().

## ◆ x86_dr_low_get_addr()

static CORE_ADDR x86_dr_low_get_addr | ( | int | regnum | ) |
| static

Definition at line 100 of file win32-i386-low.c.

References DR_FIRSTADDR, DR_LASTADDR, gdb_assert, and win32_get_current_dr().

## ◆ x86_dr_low_get_control()

static unsigned long x86_dr_low_get_control | ( | void |  | ) |
| static

Definition at line 108 of file win32-i386-low.c.

References win32_get_current_dr().

## ◆ x86_dr_low_get_status()

static unsigned long x86_dr_low_get_status | ( | void |  | ) |
| static

Definition at line 117 of file win32-i386-low.c.

References win32_get_current_dr().

## ◆ x86_dr_low_set_addr()

static void x86_dr_low_set_addr | ( | int | regnum,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 52 of file win32-i386-low.c.

References current_thread, DR_FIRSTADDR, DR_LASTADDR, for_each_thread(), gdb_assert, thread_info::id, ptid_t::pid(), and update_debug_registers().

## ◆ x86_dr_low_set_control()

static void x86_dr_low_set_control | ( | unsigned long | control | ) |
| static

Definition at line 63 of file win32-i386-low.c.

References current_thread, for_each_thread(), thread_info::id, ptid_t::pid(), and update_debug_registers().

## ◆ x86_stopped_by_watchpoint()

static int x86_stopped_by_watchpoint | ( | void |  | ) |
| static

Definition at line 191 of file win32-i386-low.c.

References debug_reg_state, and x86_dr_stopped_by_watchpoint().

## ◆ x86_stopped_data_address()

static CORE_ADDR x86_stopped_data_address | ( | void |  | ) |
| static

Definition at line 197 of file win32-i386-low.c.

References debug_reg_state, and x86_dr_stopped_data_address().

## Variable Documentation

## ◆ debug_reg_state

struct x86_debug_reg_state debug_reg_state
| static

Definition at line 37 of file win32-i386-low.c.

Referenced by i386_initial_stuff(), i386_insert_point(), i386_prepare_to_resume(), i386_remove_point(), x86_stopped_by_watchpoint(), and x86_stopped_data_address().

## ◆ i386_win32_breakpoint

const unsigned char i386_win32_breakpoint = 0xcc
| static

Definition at line 428 of file win32-i386-low.c.

## ◆ mappings

const int mappings[]
| static

Definition at line 281 of file win32-i386-low.c.

Referenced by i386_fetch_inferior_register(), and i386_store_inferior_register().

## ◆ the_low_target

struct win32_target_ops the_low_target

Initial value:
= {
i386_arch_setup,
sizeof (mappings) / sizeof (mappings[0]),
i386_initial_stuff,
i386_get_thread_context,
i386_prepare_to_resume,
i386_thread_added,
i386_fetch_inferior_register,
i386_store_inferior_register,
i386_single_step,
&i386_win32_breakpoint,
i386_win32_breakpoint_len,
i386_supports_z_point_type,
i386_insert_point,
i386_remove_point,
x86_stopped_by_watchpoint,
x86_stopped_data_address
}
i386_prepare_to_resume
static void i386_prepare_to_resume(win32_thread_info *th)
Definition: win32-i386-low.c:239
i386_supports_z_point_type
static int i386_supports_z_point_type(char z_type)
Definition: win32-i386-low.c:136
i386_get_thread_context
static void i386_get_thread_context(win32_thread_info *th)
Definition: win32-i386-low.c:212
x86_stopped_data_address
static CORE_ADDR x86_stopped_data_address(void)
Definition: win32-i386-low.c:197
x86_stopped_by_watchpoint
static int x86_stopped_by_watchpoint(void)
Definition: win32-i386-low.c:191
i386_insert_point
static int i386_insert_point(enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
Definition: win32-i386-low.c:149
i386_thread_added
static void i386_thread_added(win32_thread_info *th)
Definition: win32-i386-low.c:260
i386_win32_breakpoint_len
#define i386_win32_breakpoint_len
Definition: win32-i386-low.c:429
mappings
static const int mappings[]
Definition: win32-i386-low.c:281
i386_arch_setup
static void i386_arch_setup(void)
Definition: win32-i386-low.c:432
i386_single_step
static void i386_single_step(win32_thread_info *th)
Definition: win32-i386-low.c:266
i386_initial_stuff
static void i386_initial_stuff(void)
Definition: win32-i386-low.c:206
i386_win32_breakpoint
static const unsigned char i386_win32_breakpoint
Definition: win32-i386-low.c:428
i386_remove_point
static int i386_remove_point(enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
Definition: win32-i386-low.c:170
i386_fetch_inferior_register
static void i386_fetch_inferior_register(struct regcache *regcache, win32_thread_info *th, int r)
Definition: win32-i386-low.c:399
i386_store_inferior_register
static void i386_store_inferior_register(struct regcache *regcache, win32_thread_info *th, int r)
Definition: win32-i386-low.c:421

Definition at line 448 of file win32-i386-low.c.

## ◆ x86_dr_low

struct x86_dr_low_type x86_dr_low

Initial value:
=
{
x86_dr_low_set_control,
x86_dr_low_set_addr,
x86_dr_low_get_addr,
x86_dr_low_get_status,
x86_dr_low_get_control,
sizeof (void *),
}
x86_dr_low_get_addr
static CORE_ADDR x86_dr_low_get_addr(int regnum)
Definition: win32-i386-low.c:100
x86_dr_low_get_control
static unsigned long x86_dr_low_get_control(void)
Definition: win32-i386-low.c:108
x86_dr_low_get_status
static unsigned long x86_dr_low_get_status(void)
Definition: win32-i386-low.c:117
x86_dr_low_set_control
static void x86_dr_low_set_control(unsigned long control)
Definition: win32-i386-low.c:63
x86_dr_low_set_addr
static void x86_dr_low_set_addr(int regnum, CORE_ADDR addr)
Definition: win32-i386-low.c:52

Definition at line 123 of file win32-i386-low.c.