34 #define FT_CR_EFLAGS 1 60 #define X86_64_NUM_FT_COLLECT_GREGS \ 61 (sizeof (x86_64_ft_collect_regmap) / sizeof(x86_64_ft_collect_regmap[0])) 65 const unsigned char *buf)
85 #include <ust/processor.h> 92 #define ST_REGENTRY(REG) \ 94 offsetof (struct registers, REG), \ 95 sizeof (((struct registers *) NULL)->REG) \ 102 } x86_64_st_collect_regmap[] =
126 #define X86_64_NUM_ST_COLLECT_GREGS \ 127 (sizeof (x86_64_st_collect_regmap) / sizeof (x86_64_st_collect_regmap[0])) 130 #define AMD64_RIP_REGNUM 16 134 const unsigned char *buf,
138 unsigned long newpc = pc;
142 for (i = 0; i < X86_64_NUM_ST_COLLECT_GREGS; i++)
143 if (x86_64_st_collect_regmap[i].
offset != -1)
145 switch (x86_64_st_collect_regmap[i].size)
150 + x86_64_st_collect_regmap[i].
offset);
155 = * (
short *) (((
char *) buf)
156 + x86_64_st_collect_regmap[i].offset);
163 "unhandled register size: %d",
164 x86_64_st_collect_regmap[i].size);
172 #if !defined __ILP32__ 194 "unknown ipa tdesc index: %d", idx);
197 #if defined __ILP32__ 210 return amd64_linux_read_description (
idx2mask[idx],
false);
214 "unknown ipa tdesc index: %d", idx);
238 pagesize = sysconf (_SC_PAGE_SIZE);
242 addr = 0x80000000 - size;
245 addr &= ~(pagesize - 1);
248 for (; addr; addr -= pagesize)
253 res = mmap ((
void *) addr, size,
254 PROT_READ | PROT_WRITE | PROT_EXEC,
255 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
258 if ((uintptr_t) res == addr)
262 if (res != MAP_FAILED)
268 void *res = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
269 MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
271 if (res == MAP_FAILED)
281 #if defined __ILP32__ 287 amd64_linux_read_description (
idx2mask[i],
false);
#define X86_XSTATE_AVX_MASK
#define X86_XSTATE_SSE_MASK
#define X86_XSTATE_MPX_MASK
void internal_error(const char *file, int line, const char *fmt,...)
const struct target_desc * get_ipa_tdesc(int idx)
static uint64_t idx2mask[X86_TDESC_LAST]
#define X86_64_NUM_FT_COLLECT_GREGS
#define X86_XSTATE_AVX_AVX512_MASK
void * alloc_jump_pad_buffer(size_t size)
void init_registers_amd64_linux(void)
const struct target_desc * tdesc_amd64_linux
#define X86_XSTATE_X87_MASK
static const int x86_64_ft_collect_regmap[]
void initialize_low_tracepoint(void)
void perror_with_name(const char *string)
unsigned long long ULONGEST
ULONGEST get_raw_reg(const unsigned char *raw_regs, int regnum)
#define X86_XSTATE_AVX_MPX_MASK
void supply_register(struct regcache *regcache, int n, const void *buf)
void supply_fast_tracepoint_registers(struct regcache *regcache, const unsigned char *buf)
#define X86_XSTATE_AVX_MPX_AVX512_PKU_MASK