LLDB  mainline
Macros | Enumerations | Variables
RegisterContextDarwin_x86_64.cpp File Reference
#include <cinttypes>
#include <cstdarg>
#include <cstddef>
#include <memory>
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Scalar.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Compiler.h"
#include "RegisterContextDarwin_x86_64.h"
Include dependency graph for RegisterContextDarwin_x86_64.cpp:

Go to the source code of this file.

Macros

#define GPR_OFFSET(reg)   (LLVM_EXTENSION offsetof(RegisterContextDarwin_x86_64::GPR, reg))
 
#define FPU_OFFSET(reg)
 
#define EXC_OFFSET(reg)
 
#define DEFINE_GPR(reg, alt)
 
#define DEFINE_FPU_UINT(reg)
 
#define DEFINE_FPU_VECT(reg, i)
 
#define DEFINE_EXC(reg)
 
#define REG_CONTEXT_SIZE
 

Enumerations

enum  {
  gpr_rax = 0, gpr_rbx, gpr_rcx, gpr_rdx,
  gpr_rdi, gpr_rsi, gpr_rbp, gpr_rsp,
  gpr_r8, gpr_r9, gpr_r10, gpr_r11,
  gpr_r12, gpr_r13, gpr_r14, gpr_r15,
  gpr_rip, gpr_rflags, gpr_cs, gpr_fs,
  gpr_gs, fpu_fcw, fpu_fsw, fpu_ftw,
  fpu_fop, fpu_ip, fpu_cs, fpu_dp,
  fpu_ds, fpu_mxcsr, fpu_mxcsrmask, fpu_stmm0,
  fpu_stmm1, fpu_stmm2, fpu_stmm3, fpu_stmm4,
  fpu_stmm5, fpu_stmm6, fpu_stmm7, fpu_xmm0,
  fpu_xmm1, fpu_xmm2, fpu_xmm3, fpu_xmm4,
  fpu_xmm5, fpu_xmm6, fpu_xmm7, fpu_xmm8,
  fpu_xmm9, fpu_xmm10, fpu_xmm11, fpu_xmm12,
  fpu_xmm13, fpu_xmm14, fpu_xmm15, exc_trapno,
  exc_err, exc_faultvaddr, k_num_registers, fpu_fctrl = fpu_fcw,
  fpu_fstat = fpu_fsw, fpu_ftag = fpu_ftw, fpu_fiseg = fpu_cs, fpu_fioff = fpu_ip,
  fpu_foseg = fpu_ds, fpu_fooff = fpu_dp
}
 
enum  ehframe_dwarf_regnums {
  ehframe_dwarf_gpr_rax = 0, ehframe_dwarf_gpr_rdx, ehframe_dwarf_gpr_rcx, ehframe_dwarf_gpr_rbx,
  ehframe_dwarf_gpr_rsi, ehframe_dwarf_gpr_rdi, ehframe_dwarf_gpr_rbp, ehframe_dwarf_gpr_rsp,
  ehframe_dwarf_gpr_r8, ehframe_dwarf_gpr_r9, ehframe_dwarf_gpr_r10, ehframe_dwarf_gpr_r11,
  ehframe_dwarf_gpr_r12, ehframe_dwarf_gpr_r13, ehframe_dwarf_gpr_r14, ehframe_dwarf_gpr_r15,
  ehframe_dwarf_gpr_rip, ehframe_dwarf_fpu_xmm0, ehframe_dwarf_fpu_xmm1, ehframe_dwarf_fpu_xmm2,
  ehframe_dwarf_fpu_xmm3, ehframe_dwarf_fpu_xmm4, ehframe_dwarf_fpu_xmm5, ehframe_dwarf_fpu_xmm6,
  ehframe_dwarf_fpu_xmm7, ehframe_dwarf_fpu_xmm8, ehframe_dwarf_fpu_xmm9, ehframe_dwarf_fpu_xmm10,
  ehframe_dwarf_fpu_xmm11, ehframe_dwarf_fpu_xmm12, ehframe_dwarf_fpu_xmm13, ehframe_dwarf_fpu_xmm14,
  ehframe_dwarf_fpu_xmm15, ehframe_dwarf_fpu_stmm0, ehframe_dwarf_fpu_stmm1, ehframe_dwarf_fpu_stmm2,
  ehframe_dwarf_fpu_stmm3, ehframe_dwarf_fpu_stmm4, ehframe_dwarf_fpu_stmm5, ehframe_dwarf_fpu_stmm6,
  ehframe_dwarf_fpu_stmm7
}
 

Variables

static RegisterInfo g_register_infos []
 
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos)
 
static uint32_t g_gpr_regnums []
 
static uint32_t g_fpu_regnums []
 
static uint32_t g_exc_regnums [] = {exc_trapno, exc_err, exc_faultvaddr}
 
const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums)
 
const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums)
 
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums)
 
static const RegisterSet g_reg_sets []
 
const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets)
 

Macro Definition Documentation

◆ DEFINE_EXC

#define DEFINE_EXC (   reg)
Value:
#reg, NULL, sizeof(((RegisterContextDarwin_x86_64::EXC *) NULL)->reg), \
EXC_OFFSET(reg), eEncodingUint, eFormatHex

Definition at line 176 of file RegisterContextDarwin_x86_64.cpp.

◆ DEFINE_FPU_UINT

#define DEFINE_FPU_UINT (   reg)
Value:
#reg, NULL, sizeof(((RegisterContextDarwin_x86_64::FPU *) NULL)->reg), \
FPU_OFFSET(reg), eEncodingUint, eFormatHex

Definition at line 165 of file RegisterContextDarwin_x86_64.cpp.

◆ DEFINE_FPU_VECT

#define DEFINE_FPU_VECT (   reg,
 
)
Value:
#reg #i, NULL, \
sizeof(((RegisterContextDarwin_x86_64::FPU *) NULL)->reg[i].bytes), \
FPU_OFFSET(reg[i]), eEncodingVector, eFormatVectorOfUInt8, \
{ehframe_dwarf_fpu_##reg##i, \
ehframe_dwarf_fpu_##reg##i, LLDB_INVALID_REGNUM, \
LLDB_INVALID_REGNUM, fpu_##reg##i }, \
nullptr, nullptr, nullptr, 0

Definition at line 168 of file RegisterContextDarwin_x86_64.cpp.

◆ DEFINE_GPR

#define DEFINE_GPR (   reg,
  alt 
)
Value:
#reg, alt, sizeof(((RegisterContextDarwin_x86_64::GPR *) NULL)->reg), \
GPR_OFFSET(reg), eEncodingUint, eFormatHex

Definition at line 162 of file RegisterContextDarwin_x86_64.cpp.

◆ EXC_OFFSET

#define EXC_OFFSET (   reg)
Value:

Definition at line 153 of file RegisterContextDarwin_x86_64.cpp.

◆ FPU_OFFSET

#define FPU_OFFSET (   reg)
Value:
(LLVM_EXTENSION offsetof(RegisterContextDarwin_x86_64::FPU, reg) + \

Definition at line 150 of file RegisterContextDarwin_x86_64.cpp.

◆ GPR_OFFSET

#define GPR_OFFSET (   reg)    (LLVM_EXTENSION offsetof(RegisterContextDarwin_x86_64::GPR, reg))

Definition at line 148 of file RegisterContextDarwin_x86_64.cpp.

◆ REG_CONTEXT_SIZE

#define REG_CONTEXT_SIZE

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
gpr_rax 
gpr_rbx 
gpr_rcx 
gpr_rdx 
gpr_rdi 
gpr_rsi 
gpr_rbp 
gpr_rsp 
gpr_r8 
gpr_r9 
gpr_r10 
gpr_r11 
gpr_r12 
gpr_r13 
gpr_r14 
gpr_r15 
gpr_rip 
gpr_rflags 
gpr_cs 
gpr_fs 
gpr_gs 
fpu_fcw 
fpu_fsw 
fpu_ftw 
fpu_fop 
fpu_ip 
fpu_cs 
fpu_dp 
fpu_ds 
fpu_mxcsr 
fpu_mxcsrmask 
fpu_stmm0 
fpu_stmm1 
fpu_stmm2 
fpu_stmm3 
fpu_stmm4 
fpu_stmm5 
fpu_stmm6 
fpu_stmm7 
fpu_xmm0 
fpu_xmm1 
fpu_xmm2 
fpu_xmm3 
fpu_xmm4 
fpu_xmm5 
fpu_xmm6 
fpu_xmm7 
fpu_xmm8 
fpu_xmm9 
fpu_xmm10 
fpu_xmm11 
fpu_xmm12 
fpu_xmm13 
fpu_xmm14 
fpu_xmm15 
exc_trapno 
exc_err 
exc_faultvaddr 
k_num_registers 
fpu_fctrl 
fpu_fstat 
fpu_ftag 
fpu_fiseg 
fpu_fioff 
fpu_foseg 
fpu_fooff 

Definition at line 29 of file RegisterContextDarwin_x86_64.cpp.

◆ ehframe_dwarf_regnums

Enumerator
ehframe_dwarf_gpr_rax 
ehframe_dwarf_gpr_rdx 
ehframe_dwarf_gpr_rcx 
ehframe_dwarf_gpr_rbx 
ehframe_dwarf_gpr_rsi 
ehframe_dwarf_gpr_rdi 
ehframe_dwarf_gpr_rbp 
ehframe_dwarf_gpr_rsp 
ehframe_dwarf_gpr_r8 
ehframe_dwarf_gpr_r9 
ehframe_dwarf_gpr_r10 
ehframe_dwarf_gpr_r11 
ehframe_dwarf_gpr_r12 
ehframe_dwarf_gpr_r13 
ehframe_dwarf_gpr_r14 
ehframe_dwarf_gpr_r15 
ehframe_dwarf_gpr_rip 
ehframe_dwarf_fpu_xmm0 
ehframe_dwarf_fpu_xmm1 
ehframe_dwarf_fpu_xmm2 
ehframe_dwarf_fpu_xmm3 
ehframe_dwarf_fpu_xmm4 
ehframe_dwarf_fpu_xmm5 
ehframe_dwarf_fpu_xmm6 
ehframe_dwarf_fpu_xmm7 
ehframe_dwarf_fpu_xmm8 
ehframe_dwarf_fpu_xmm9 
ehframe_dwarf_fpu_xmm10 
ehframe_dwarf_fpu_xmm11 
ehframe_dwarf_fpu_xmm12 
ehframe_dwarf_fpu_xmm13 
ehframe_dwarf_fpu_xmm14 
ehframe_dwarf_fpu_xmm15 
ehframe_dwarf_fpu_stmm0 
ehframe_dwarf_fpu_stmm1 
ehframe_dwarf_fpu_stmm2 
ehframe_dwarf_fpu_stmm3 
ehframe_dwarf_fpu_stmm4 
ehframe_dwarf_fpu_stmm5 
ehframe_dwarf_fpu_stmm6 
ehframe_dwarf_fpu_stmm7 

Definition at line 103 of file RegisterContextDarwin_x86_64.cpp.

Variable Documentation

◆ g_exc_regnums

uint32_t g_exc_regnums[] = {exc_trapno, exc_err, exc_faultvaddr}
static

Definition at line 511 of file RegisterContextDarwin_x86_64.cpp.

◆ g_fpu_regnums

uint32_t g_fpu_regnums[]
static

◆ g_gpr_regnums

uint32_t g_gpr_regnums[]
static

◆ g_reg_sets

const RegisterSet g_reg_sets[]
static
Initial value:
= {
{
"General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums,
},
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}}

Definition at line 521 of file RegisterContextDarwin_x86_64.cpp.

Referenced by RegisterContextDarwin_x86_64::GetRegisterSet().

◆ g_register_infos

RegisterInfo g_register_infos[]
static

◆ k_num_exc_registers

const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums)

Definition at line 516 of file RegisterContextDarwin_x86_64.cpp.

◆ k_num_fpu_registers

const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums)

Definition at line 515 of file RegisterContextDarwin_x86_64.cpp.

◆ k_num_gpr_registers

const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums)

Definition at line 514 of file RegisterContextDarwin_x86_64.cpp.

◆ k_num_register_infos

size_t k_num_register_infos = llvm::array_lengthof(g_register_infos)
static

◆ k_num_regsets

const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets)
fpu_dp
@ fpu_dp
Definition: RegisterContextDarwin_x86_64.cpp:58
gpr_rdi
@ gpr_rdi
Definition: RegisterContextDarwin_x86_64.cpp:34
fpu_xmm12
@ fpu_xmm12
Definition: RegisterContextDarwin_x86_64.cpp:82
fpu_xmm9
@ fpu_xmm9
Definition: RegisterContextDarwin_x86_64.cpp:79
fpu_ftw
@ fpu_ftw
Definition: RegisterContextDarwin_x86_64.cpp:54
gpr_rax
@ gpr_rax
Definition: RegisterContextDarwin_x86_64.cpp:30
g_fpu_regnums
static uint32_t g_fpu_regnums[]
Definition: RegisterContextDarwin_x86_64.cpp:503
fpu_xmm7
@ fpu_xmm7
Definition: RegisterContextDarwin_x86_64.cpp:77
gpr_rsp
@ gpr_rsp
Definition: RegisterContextDarwin_x86_64.cpp:37
fpu_stmm6
@ fpu_stmm6
Definition: RegisterContextDarwin_x86_64.cpp:68
fpu_ds
@ fpu_ds
Definition: RegisterContextDarwin_x86_64.cpp:59
fpu_ip
@ fpu_ip
Definition: RegisterContextDarwin_x86_64.cpp:56
fpu_stmm7
@ fpu_stmm7
Definition: RegisterContextDarwin_x86_64.cpp:69
fpu_xmm1
@ fpu_xmm1
Definition: RegisterContextDarwin_x86_64.cpp:71
gpr_rsi
@ gpr_rsi
Definition: RegisterContextDarwin_x86_64.cpp:35
gpr_rbx
@ gpr_rbx
Definition: RegisterContextDarwin_x86_64.cpp:31
gpr_r15
@ gpr_r15
Definition: RegisterContextDarwin_x86_64.cpp:45
gpr_rdx
@ gpr_rdx
Definition: RegisterContextDarwin_x86_64.cpp:33
fpu_mxcsrmask
@ fpu_mxcsrmask
Definition: RegisterContextDarwin_x86_64.cpp:61
fpu_stmm1
@ fpu_stmm1
Definition: RegisterContextDarwin_x86_64.cpp:63
RegisterContextDarwin_x86_64::GPR
Definition: RegisterContextDarwin_x86_64.h:47
fpu_fop
@ fpu_fop
Definition: RegisterContextDarwin_x86_64.cpp:55
fpu_stmm4
@ fpu_stmm4
Definition: RegisterContextDarwin_x86_64.cpp:66
gpr_rcx
@ gpr_rcx
Definition: RegisterContextDarwin_x86_64.cpp:32
fpu_stmm0
@ fpu_stmm0
Definition: RegisterContextDarwin_x86_64.cpp:62
fpu_xmm4
@ fpu_xmm4
Definition: RegisterContextDarwin_x86_64.cpp:74
GPR
struct _GPR GPR
fpu_xmm3
@ fpu_xmm3
Definition: RegisterContextDarwin_x86_64.cpp:73
fpu_xmm6
@ fpu_xmm6
Definition: RegisterContextDarwin_x86_64.cpp:76
gpr_r13
@ gpr_r13
Definition: RegisterContextDarwin_x86_64.cpp:43
fpu_xmm15
@ fpu_xmm15
Definition: RegisterContextDarwin_x86_64.cpp:85
gpr_gs
@ gpr_gs
Definition: RegisterContextDarwin_x86_64.cpp:50
gpr_r14
@ gpr_r14
Definition: RegisterContextDarwin_x86_64.cpp:44
k_num_gpr_registers
const size_t k_num_gpr_registers
Definition: RegisterContextDarwin_x86_64.cpp:514
gpr_rip
@ gpr_rip
Definition: RegisterContextDarwin_x86_64.cpp:46
fpu_xmm5
@ fpu_xmm5
Definition: RegisterContextDarwin_x86_64.cpp:75
g_exc_regnums
static uint32_t g_exc_regnums[]
Definition: RegisterContextDarwin_x86_64.cpp:511
gpr_r8
@ gpr_r8
Definition: RegisterContextDarwin_x86_64.cpp:38
fpu_fsw
@ fpu_fsw
Definition: RegisterContextDarwin_x86_64.cpp:53
fpu_xmm14
@ fpu_xmm14
Definition: RegisterContextDarwin_x86_64.cpp:84
gpr_r11
@ gpr_r11
Definition: RegisterContextDarwin_x86_64.cpp:41
gpr_rflags
@ gpr_rflags
Definition: RegisterContextDarwin_x86_64.cpp:47
RegisterContextDarwin_x86_64::EXC
Definition: RegisterContextDarwin_x86_64.h:101
g_gpr_regnums
static uint32_t g_gpr_regnums[]
Definition: RegisterContextDarwin_x86_64.cpp:498
fpu_stmm2
@ fpu_stmm2
Definition: RegisterContextDarwin_x86_64.cpp:64
fpu_fcw
@ fpu_fcw
Definition: RegisterContextDarwin_x86_64.cpp:52
gpr_cs
@ gpr_cs
Definition: RegisterContextDarwin_x86_64.cpp:48
fpu_mxcsr
@ fpu_mxcsr
Definition: RegisterContextDarwin_x86_64.cpp:60
fpu_stmm5
@ fpu_stmm5
Definition: RegisterContextDarwin_x86_64.cpp:67
fpu_xmm11
@ fpu_xmm11
Definition: RegisterContextDarwin_x86_64.cpp:81
k_num_fpu_registers
const size_t k_num_fpu_registers
Definition: RegisterContextDarwin_x86_64.cpp:515
fpu_xmm13
@ fpu_xmm13
Definition: RegisterContextDarwin_x86_64.cpp:83
fpu_xmm2
@ fpu_xmm2
Definition: RegisterContextDarwin_x86_64.cpp:72
fpu_xmm0
@ fpu_xmm0
Definition: RegisterContextDarwin_x86_64.cpp:70
gpr_fs
@ gpr_fs
Definition: RegisterContextDarwin_x86_64.cpp:49
gpr_rbp
@ gpr_rbp
Definition: RegisterContextDarwin_x86_64.cpp:36
fpu_xmm8
@ fpu_xmm8
Definition: RegisterContextDarwin_x86_64.cpp:78
RegisterContextDarwin_x86_64::FPU
Definition: RegisterContextDarwin_x86_64.h:80
gpr_r12
@ gpr_r12
Definition: RegisterContextDarwin_x86_64.cpp:42
gpr_r9
@ gpr_r9
Definition: RegisterContextDarwin_x86_64.cpp:39
k_num_exc_registers
const size_t k_num_exc_registers
Definition: RegisterContextDarwin_x86_64.cpp:516
fpu_xmm10
@ fpu_xmm10
Definition: RegisterContextDarwin_x86_64.cpp:80
fpu_cs
@ fpu_cs
Definition: RegisterContextDarwin_x86_64.cpp:57
fpu_stmm3
@ fpu_stmm3
Definition: RegisterContextDarwin_x86_64.cpp:65
gpr_r10
@ gpr_r10
Definition: RegisterContextDarwin_x86_64.cpp:40