GDB (xrefs)
Loading...
Searching...
No Matches
Macros | Functions | Variables
i387-tdep.c File Reference
#include "defs.h"
#include "frame.h"
#include "gdbcore.h"
#include "inferior.h"
#include "language.h"
#include "regcache.h"
#include "target-float.h"
#include "value.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "gdbsupport/x86-xstate.h"

Go to the source code of this file.

Macros

#define FSAVE_ADDR(tdep, fsave, regnum)    (fsave + fsave_offset[regnum - I387_ST0_REGNUM (tdep)])
 
#define FXSAVE_ADDR(tdep, fxsave, regnum)    (fxsave + fxsave_offset[regnum - I387_ST0_REGNUM (tdep)])
 
#define FXSAVE_MXCSR_ADDR(fxsave)   (fxsave + 24)
 
#define XSAVE_XSTATE_BV_ADDR(xsave)   (xsave + 512)
 
#define XSAVE_AVXH_ADDR(tdep, xsave, regnum)
 
#define XSAVE_YMM_AVX512_ADDR(tdep, xsave, regnum)
 
#define XSAVE_XMM_AVX512_ADDR(tdep, xsave, regnum)
 
#define XSAVE_BNDREGS_ADDR(tdep, xsave, regnum)
 
#define XSAVE_BNDCFG_ADDR(tdep, xsave, regnum)
 
#define XSAVE_AVX512_K_ADDR(tdep, xsave, regnum)
 
#define XSAVE_AVX512_ZMM0_H_ADDR(tdep, xsave, regnum)
 
#define XSAVE_AVX512_ZMM16_H_ADDR(tdep, xsave, regnum)
 
#define XSAVE_PKEYS_ADDR(tdep, xsave, regnum)
 

Functions

static void print_i387_value (struct gdbarch *gdbarch, const gdb_byte *raw, struct ui_file *file)
 
static void print_i387_ext (struct gdbarch *gdbarch, const gdb_byte *raw, struct ui_file *file)
 
static void print_i387_status_word (int status_p, unsigned int status, struct ui_file *file)
 
static void print_i387_control_word (int control_p, unsigned int control, struct ui_file *file)
 
void i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, const char *args)
 
int i387_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
 
int i387_register_to_value (frame_info_ptr frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
 
void i387_value_to_register (frame_info_ptr frame, int regnum, struct type *type, const gdb_byte *from)
 
void i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
 
void i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave)
 
static int i387_tag (const gdb_byte *raw)
 
void i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
 
void i387_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave)
 
bool i387_guess_xsave_layout (uint64_t xcr0, size_t xsave_size, x86_xsave_layout &layout)
 
x86_xsave_layout i387_fallback_xsave_layout (uint64_t xcr0)
 
ULONGEST i387_xsave_get_clear_bv (struct gdbarch *gdbarch, const void *xsave)
 
void i387_supply_xsave (struct regcache *regcache, int regnum, const void *xsave)
 
void i387_collect_xsave (const struct regcache *regcache, int regnum, void *xsave, int gcore)
 
void i387_return_value (struct gdbarch *gdbarch, struct regcache *regcache)
 
void i387_reset_bnd_regs (struct gdbarch *gdbarch, struct regcache *regcache)
 

Variables

static int fsave_offset []
 
static int fxsave_offset []
 
static int xsave_avxh_offset []
 
static int xsave_ymm_avx512_offset []
 
static int xsave_xmm_avx512_offset []
 
static int xsave_bndregs_offset []
 
static int xsave_bndcfg_offset []
 
static int xsave_avx512_k_offset []
 
static int xsave_avx512_zmm0_h_offset []
 
static int xsave_avx512_zmm16_h_offset []
 
static int xsave_pkeys_offset []
 

Macro Definition Documentation

◆ FSAVE_ADDR

#define FSAVE_ADDR ( tdep,
fsave,
regnum )    (fsave + fsave_offset[regnum - I387_ST0_REGNUM (tdep)])

Definition at line 431 of file i387-tdep.c.

Referenced by i387_collect_fsave(), and i387_supply_fsave().

◆ FXSAVE_ADDR

#define FXSAVE_ADDR ( tdep,
fxsave,
regnum )    (fxsave + fxsave_offset[regnum - I387_ST0_REGNUM (tdep)])

◆ FXSAVE_MXCSR_ADDR

#define FXSAVE_MXCSR_ADDR ( fxsave)    (fxsave + 24)

◆ XSAVE_AVX512_K_ADDR

#define XSAVE_AVX512_K_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.k_offset \
int regnum
static int xsave_avx512_k_offset[]
Definition i387-tdep.c:847
#define I387_K0_REGNUM(tdep)
Definition i387-tdep.h:51

Definition at line 859 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_AVX512_ZMM0_H_ADDR

#define XSAVE_AVX512_ZMM0_H_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.zmm_h_offset \
static int xsave_avx512_zmm0_h_offset[]
Definition i387-tdep.c:868
#define I387_ZMM0H_REGNUM(tdep)
Definition i387-tdep.h:53

Definition at line 888 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_AVX512_ZMM16_H_ADDR

#define XSAVE_AVX512_ZMM16_H_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.zmm_offset \
static int xsave_avx512_zmm16_h_offset[]
Definition i387-tdep.c:896
#define I387_ZMM16H_REGNUM(tdep)
Definition i387-tdep.h:54

Definition at line 916 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_AVXH_ADDR

#define XSAVE_AVXH_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.avx_offset \
static int xsave_avxh_offset[]
Definition i387-tdep.c:739
#define I387_YMM0H_REGNUM(tdep)
Definition i387-tdep.h:38

Definition at line 759 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_BNDCFG_ADDR

#define XSAVE_BNDCFG_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.bndcfg_offset \
static int xsave_bndcfg_offset[]
Definition i387-tdep.c:834
#define I387_BNDCFGU_REGNUM(tdep)
Definition i387-tdep.h:41

Definition at line 839 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_BNDREGS_ADDR

#define XSAVE_BNDREGS_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.bndregs_offset \
static int xsave_bndregs_offset[]
Definition i387-tdep.c:823
#define I387_BND0R_REGNUM(tdep)
Definition i387-tdep.h:40

Definition at line 830 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_PKEYS_ADDR

#define XSAVE_PKEYS_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.pkru_offset \
static int xsave_pkeys_offset[]
Definition i387-tdep.c:924
#define I387_PKRU_REGNUM(tdep)
Definition i387-tdep.h:50

Definition at line 930 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_XMM_AVX512_ADDR

#define XSAVE_XMM_AVX512_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.zmm_offset \
static int xsave_xmm_avx512_offset[]
Definition i387-tdep.c:795
#define I387_XMM16_REGNUM(tdep)
Definition i387-tdep.h:67

Definition at line 815 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

◆ XSAVE_XSTATE_BV_ADDR

#define XSAVE_XSTATE_BV_ADDR ( xsave)    (xsave + 512)

Definition at line 733 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_xsave_get_clear_bv().

◆ XSAVE_YMM_AVX512_ADDR

#define XSAVE_YMM_AVX512_ADDR ( tdep,
xsave,
regnum )
Value:
(xsave + (tdep)->xsave_layout.zmm_offset \
static int xsave_ymm_avx512_offset[]
Definition i387-tdep.c:767
#define I387_YMM16H_REGNUM(tdep)
Definition i387-tdep.h:56

Definition at line 787 of file i387-tdep.c.

Referenced by i387_collect_xsave(), and i387_supply_xsave().

Function Documentation

◆ i387_collect_fsave()

void i387_collect_fsave ( const struct regcache * regcache,
int regnum,
void * fsave )

◆ i387_collect_fxsave()

void i387_collect_fxsave ( const struct regcache * regcache,
int regnum,
void * fxsave )

◆ i387_collect_xsave()

void i387_collect_xsave ( const struct regcache * regcache,
int regnum,
void * xsave,
int gcore )

◆ i387_convert_register_p()

int i387_convert_register_p ( struct gdbarch * gdbarch,
int regnum,
struct type * type )

Definition at line 327 of file i387-tdep.c.

References type::code(), i386_fp_regnum_p(), i387_ext_type(), and regnum.

Referenced by amd64_init_abi(), and i386_convert_register_p().

◆ i387_fallback_xsave_layout()

x86_xsave_layout i387_fallback_xsave_layout ( uint64_t xcr0)

Definition at line 993 of file i387-tdep.c.

Referenced by i386_gdbarch_init().

◆ i387_guess_xsave_layout()

bool i387_guess_xsave_layout ( uint64_t xcr0,
size_t xsave_size,
x86_xsave_layout & layout )

Definition at line 938 of file i387-tdep.c.

Referenced by i386_fbsd_core_read_xsave_info(), and i386_linux_core_read_xsave_info().

◆ i387_print_float_info()

void i387_print_float_info ( struct gdbarch * gdbarch,
struct ui_file * file,
frame_info_ptr frame,
const char * args )

◆ i387_register_to_value()

int i387_register_to_value ( frame_info_ptr frame,
int regnum,
struct type * type,
gdb_byte * to,
int * optimizedp,
int * unavailablep )

◆ i387_reset_bnd_regs()

void i387_reset_bnd_regs ( struct gdbarch * gdbarch,
struct regcache * regcache )

◆ i387_return_value()

void i387_return_value ( struct gdbarch * gdbarch,
struct regcache * regcache )

◆ i387_supply_fsave()

void i387_supply_fsave ( struct regcache * regcache,
int regnum,
const void * fsave )

◆ i387_supply_fxsave()

void i387_supply_fxsave ( struct regcache * regcache,
int regnum,
const void * fxsave )

◆ i387_supply_xsave()

void i387_supply_xsave ( struct regcache * regcache,
int regnum,
const void * xsave )

◆ i387_tag()

static int i387_tag ( const gdb_byte * raw)
static

Definition at line 2076 of file i387-tdep.c.

Referenced by i387_supply_fxsave(), and i387_supply_xsave().

◆ i387_value_to_register()

void i387_value_to_register ( frame_info_ptr frame,
int regnum,
struct type * type,
const gdb_byte * from )

◆ i387_xsave_get_clear_bv()

ULONGEST i387_xsave_get_clear_bv ( struct gdbarch * gdbarch,
const void * xsave )

◆ print_i387_control_word()

static void print_i387_control_word ( int control_p,
unsigned int control,
struct ui_file * file )
static

Definition at line 143 of file i387-tdep.c.

References gdb_printf(), and gdb_puts().

Referenced by i387_print_float_info().

◆ print_i387_ext()

static void print_i387_ext ( struct gdbarch * gdbarch,
const gdb_byte * raw,
struct ui_file * file )
static

Definition at line 51 of file i387-tdep.c.

References gdb_printf(), gdb_puts(), and print_i387_value().

Referenced by i387_print_float_info().

◆ print_i387_status_word()

static void print_i387_status_word ( int status_p,
unsigned int status,
struct ui_file * file )
static

Definition at line 105 of file i387-tdep.c.

References gdb_printf(), gdb_puts(), and status.

Referenced by i387_print_float_info().

◆ print_i387_value()

static void print_i387_value ( struct gdbarch * gdbarch,
const gdb_byte * raw,
struct ui_file * file )
static

Definition at line 36 of file i387-tdep.c.

References gdb_printf(), i387_ext_type(), and target_float_to_string().

Referenced by print_i387_ext().

Variable Documentation

◆ fsave_offset

int fsave_offset[]
static
Initial value:
=
{
28 + 0 * 10,
28 + 1 * 10,
28 + 2 * 10,
28 + 3 * 10,
28 + 4 * 10,
28 + 5 * 10,
28 + 6 * 10,
28 + 7 * 10,
0,
4,
8,
16,
12,
24,
20,
18
}

Definition at line 411 of file i387-tdep.c.

◆ fxsave_offset

int fxsave_offset[]
static

Definition at line 535 of file i387-tdep.c.

◆ xsave_avx512_k_offset

int xsave_avx512_k_offset[]
static
Initial value:
=
{
0 * 8,
1 * 8,
2 * 8,
3 * 8,
4 * 8,
5 * 8,
6 * 8,
7 * 8
}

Definition at line 847 of file i387-tdep.c.

◆ xsave_avx512_zmm0_h_offset

int xsave_avx512_zmm0_h_offset[]
static
Initial value:
=
{
0 * 32,
1 * 32,
2 * 32,
3 * 32,
4 * 32,
5 * 32,
6 * 32,
7 * 32,
8 * 32,
9 * 32,
10 * 32,
11 * 32,
12 * 32,
13 * 32,
14 * 32,
15 * 32
}

Definition at line 868 of file i387-tdep.c.

◆ xsave_avx512_zmm16_h_offset

int xsave_avx512_zmm16_h_offset[]
static
Initial value:
=
{
32 + 0 * 64,
32 + 1 * 64,
32 + 2 * 64,
32 + 3 * 64,
32 + 4 * 64,
32 + 5 * 64,
32 + 6 * 64,
32 + 7 * 64,
32 + 8 * 64,
32 + 9 * 64,
32 + 10 * 64,
32 + 11 * 64,
32 + 12 * 64,
32 + 13 * 64,
32 + 14 * 64,
32 + 15 * 64
}

Definition at line 896 of file i387-tdep.c.

◆ xsave_avxh_offset

int xsave_avxh_offset[]
static
Initial value:
=
{
0 * 16,
1 * 16,
2 * 16,
3 * 16,
4 * 16,
5 * 16,
6 * 16,
7 * 16,
8 * 16,
9 * 16,
10 * 16,
11 * 16,
12 * 16,
13 * 16,
14 * 16,
15 * 16
}

Definition at line 739 of file i387-tdep.c.

◆ xsave_bndcfg_offset

int xsave_bndcfg_offset[]
static
Initial value:
= {
0 * 8,
1 * 8,
}

Definition at line 834 of file i387-tdep.c.

◆ xsave_bndregs_offset

int xsave_bndregs_offset[]
static
Initial value:
= {
0 * 16,
1 * 16,
2 * 16,
3 * 16
}

Definition at line 823 of file i387-tdep.c.

◆ xsave_pkeys_offset

int xsave_pkeys_offset[]
static
Initial value:
=
{
0 * 8
}

Definition at line 924 of file i387-tdep.c.

◆ xsave_xmm_avx512_offset

int xsave_xmm_avx512_offset[]
static
Initial value:
=
{
0 * 64,
1 * 64,
2 * 64,
3 * 64,
4 * 64,
5 * 64,
6 * 64,
7 * 64,
8 * 64,
9 * 64,
10 * 64,
11 * 64,
12 * 64,
13 * 64,
14 * 64,
15 * 64
}

Definition at line 795 of file i387-tdep.c.

◆ xsave_ymm_avx512_offset

int xsave_ymm_avx512_offset[]
static
Initial value:
=
{
16 + 0 * 64,
16 + 1 * 64,
16 + 2 * 64,
16 + 3 * 64,
16 + 4 * 64,
16 + 5 * 64,
16 + 6 * 64,
16 + 7 * 64,
16 + 8 * 64,
16 + 9 * 64,
16 + 10 * 64,
16 + 11 * 64,
16 + 12 * 64,
16 + 13 * 64,
16 + 14 * 64,
16 + 15 * 64
}

Definition at line 767 of file i387-tdep.c.