DynamoRIO API
_dr_mcontext_t Struct Reference

#include <dr_defines.h>

Data Fields

size_t size
 
dr_mcontext_flags_t flags
 
union {
   reg_t   xdi
 
   reg_t   rdi
 
}; 
 
union {
   reg_t   xsi
 
   reg_t   rsi
 
}; 
 
union {
   reg_t   xbp
 
   reg_t   rbp
 
}; 
 
union {
   reg_t   xsp
 
   reg_t   rsp
 
}; 
 
union {
   reg_t   xbx
 
   reg_t   rbx
 
}; 
 
union {
   reg_t   xdx
 
   reg_t   rdx
 
}; 
 
union {
   reg_t   xcx
 
   reg_t   rcx
 
}; 
 
union {
   reg_t   xax
 
   reg_t   rax
 
}; 
 
reg_t r8
 
reg_t r9
 
reg_t r10
 
reg_t r11
 
reg_t r12
 
reg_t r13
 
reg_t r14
 
reg_t r15
 
union {
   reg_t   xflags
 
   reg_t   rflags
 
}; 
 
union {
   byte *   xip
 
   byte *   pc
 
   byte *   rip
 
}; 
 
byte padding [PRE_XMM_PADDING]
 
dr_ymm_t ymm [NUM_SIMD_SLOTS]
 

Detailed Description

Machine context structure.

Field Documentation

union { ... }

The anonymous union of alternative names for rbx/ebx register.

union { ... }

The anonymous union of alternative names for rdx/edx register.

union { ... }

The anonymous union of alternative names for rcx/ecx register.

union { ... }

The anonymous union of alternative names for rax/eax register.

union { ... }

The anonymous union of alternative names for rflags/eflags register.

union { ... }

The anonymous union of alternative names for rdi/edi register.

union { ... }

Anonymous union of alternative names for the program counter / instruction pointer (eip/rip).

Note
This field is not always set or read by all API routines.
union { ... }

The anonymous union of alternative names for rsi/esi register.

union { ... }

The anonymous union of alternative names for rbp/ebp register.

union { ... }

The anonymous union of alternative names for rsp/esp register.

dr_mcontext_flags_t _dr_mcontext_t::flags

The valid fields of this structure. This field must be set prior to filling in the fields. For input requests (dr_get_mcontext()), this indicates which fields should be written. Writing the multimedia fields frequently can incur a performance hit. For output requests (dr_set_mcontext() and dr_redirect_execution()), this indicates which fields will be copied to the actual context.

byte _dr_mcontext_t::padding[PRE_XMM_PADDING]

The padding to get ymm field 32-byte aligned.

byte* _dr_mcontext_t::pc

The platform-independent alt name for full rip/eip register.

reg_t _dr_mcontext_t::r10

The r10 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r11

The r11 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r12

The r12 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r13

The r13 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r14

The r14 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r15

The r15 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r8

The r8 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::r9

The r9 register.

Note
For 64-bit DR builds only.
reg_t _dr_mcontext_t::rax

The platform-dependent name for rax/eax register.

reg_t _dr_mcontext_t::rbp

The platform-dependent name for rbp/ebp register.

reg_t _dr_mcontext_t::rbx

The platform-dependent name for rbx/ebx register.

reg_t _dr_mcontext_t::rcx

The platform-dependent name for rcx/ecx register.

reg_t _dr_mcontext_t::rdi

The platform-dependent name for rdi/edi register.

reg_t _dr_mcontext_t::rdx

The platform-dependent name for rdx/edx register.

reg_t _dr_mcontext_t::rflags

The platform-dependent name for rflags/eflags register.

byte* _dr_mcontext_t::rip

The platform-dependent name for rip/eip register.

reg_t _dr_mcontext_t::rsi

The platform-dependent name for rsi/esi register.

reg_t _dr_mcontext_t::rsp

The platform-dependent name for rsp/esp register.

size_t _dr_mcontext_t::size

The size of this structure. This field must be set prior to filling in the fields to support forward compatibility.

reg_t _dr_mcontext_t::xax

The platform-independent name for full rax/eax register.

reg_t _dr_mcontext_t::xbp

The platform-independent name for full rbp/ebp register.

reg_t _dr_mcontext_t::xbx

The platform-independent name for full rbx/ebx register.

reg_t _dr_mcontext_t::xcx

The platform-independent name for full rcx/ecx register.

reg_t _dr_mcontext_t::xdi

The platform-independent name for full rdi/edi register.

reg_t _dr_mcontext_t::xdx

The platform-independent name for full rdx/edx register.

reg_t _dr_mcontext_t::xflags

The platform-independent name for full rflags/eflags register.

byte* _dr_mcontext_t::xip

The platform-independent name for full rip/eip register.

reg_t _dr_mcontext_t::xsi

The platform-independent name for full rsi/esi register.

reg_t _dr_mcontext_t::xsp

The platform-independent name for full rsp/esp register.

dr_ymm_t _dr_mcontext_t::ymm[NUM_SIMD_SLOTS]

The SSE registers xmm0-xmm5 (-xmm15 on Linux) are volatile (caller-saved) for 64-bit and WOW64, and are actually zeroed out on Windows system calls. These fields are ignored for 32-bit processes that are not WOW64, or if the underlying processor does not support SSE. Use dr_mcontext_xmm_fields_valid() to determine whether the fields are valid.

When the fields are valid, on processors with AVX enabled (i.e., proc_has_feature(FEATURE_AVX) returns true), these fields will contain the full ymm register values; otherwise, the top 128 bits of each slot will be undefined.


The documentation for this struct was generated from the following file: