Basic defines and type definitions. More...
#include <windows.h>
#include <winbase.h>
#include <stdarg.h>
#include <sys/types.h>
Data Structures | |
struct | opnd_t |
struct | instr_t |
union | _dr_xmm_t |
union | _dr_ymm_t |
struct | _dr_mcontext_t |
struct | dr_time_t |
struct | _dr_stats_t |
Macros | |
#define | MAXIMUM_PATH 260 |
#define | INVALID_FILE INVALID_HANDLE_VALUE |
#define | STDOUT (dr_get_stdout_file()) |
#define | STDERR (dr_get_stderr_file()) |
#define | STDIN (dr_get_stdin_file()) |
#define | INVALID_FILE -1 |
#define | STDOUT our_stdout |
#define | STDERR our_stderr |
#define | STDIN our_stdin |
#define | PFX "0x" PFMT |
#define | PIFX "0x" PIFMT |
#define | PIDFMT SZFMT |
#define | TIDFMT SZFMT |
#define | NUM_SIMD_SLOTS 32 |
#define | PRE_SIMD_PADDING 0 |
#define | DR_NOTE_FIRST_RESERVED 0xfffffffffffffff0ULL |
Typedefs | |
typedef size_t | app_rva_t |
typedef uint | client_id_t |
typedef union _dr_xmm_t | dr_xmm_t |
typedef union _dr_ymm_t | dr_ymm_t |
typedef struct _dr_mcontext_t | dr_mcontext_t |
typedef struct _dr_stats_t | dr_stats_t |
Enumerations | |
enum | dr_mcontext_flags_t { DR_MC_INTEGER = 0x01, DR_MC_CONTROL = 0x02, DR_MC_MULTIMEDIA = 0x04, DR_MC_ALL = (DR_MC_INTEGER | DR_MC_CONTROL | DR_MC_MULTIMEDIA) } |
enum | dr_where_am_i_t { DR_WHERE_APP = 0, DR_WHERE_INTERP, DR_WHERE_DISPATCH, DR_WHERE_MONITOR, DR_WHERE_SYSCALL_HANDLER, DR_WHERE_SIGNAL_HANDLER, DR_WHERE_TRAMPOLINE, DR_WHERE_CONTEXT_SWITCH, DR_WHERE_IBL, DR_WHERE_FCACHE, DR_WHERE_CLEAN_CALLEE, DR_WHERE_UNKNOWN, DR_WHERE_LAST } |
Functions | |
union | ALIGN_VAR (16) _dr_simd_t |
Variables | |
file_t | our_stdout |
file_t | our_stderr |
file_t | our_stdin |
Basic defines and type definitions.
#define DR_NOTE_FIRST_RESERVED 0xfffffffffffffff0ULL |
Upper note values are reserved for core DR.
#define INVALID_FILE INVALID_HANDLE_VALUE |
The sentinel value for an invalid file_t.
#define INVALID_FILE -1 |
The sentinel value for an invalid file_t.
#define MAXIMUM_PATH 260 |
Maximum file path length define meant to replace platform-specific defines such as MAX_PATH and PATH_MAX. Currently, internal stack size limits prevent this from being much larger on UNIX.
#define NUM_SIMD_SLOTS 32 |
Number of 128-bit SIMD Vn slots in dr_mcontext_t \
#define PFX "0x" PFMT |
printf format code for pointers
#define PIDFMT SZFMT |
printf format code for process_id_t
#define PIFX "0x" PIFMT |
printf format code for pointer-sized integers
#define PRE_SIMD_PADDING 0 |
Bytes of padding before xmm/ymm dr_mcontext_t slots \
#define STDERR (dr_get_stderr_file()) |
The file_t value for standard error.
#define STDERR our_stderr |
The file_t value for standard error.
#define STDIN (dr_get_stdin_file()) |
The file_t value for standard input.
The file_t value for standard error.
#define STDIN our_stdin |
The file_t value for standard input.
The file_t value for standard error.
#define STDOUT (dr_get_stdout_file()) |
The file_t value for standard output.
#define STDOUT our_stdout |
The file_t value for standard output.
#define TIDFMT SZFMT |
printf format code for thread_id_t
typedef size_t app_rva_t |
Application offset from module base. PE32+ modules are limited to 2GB, but not ELF x64 med/large code model.
typedef uint client_id_t |
ID used to uniquely identify a client. This value is set at client registration and passed to the client in dr_client_main().
typedef struct _dr_mcontext_t dr_mcontext_t |
Machine context structure.
typedef struct _dr_stats_t dr_stats_t |
Used by dr_get_stats() and dr_app_stop_and_cleanup_with_stats()
enum dr_mcontext_flags_t |
Values for the flags field of dr_mcontext_t
Enumerator | |
---|---|
DR_MC_INTEGER | On x86, selects the xdi, xsi, xbp, xbx, xdx, xcx, xax, and r8-r15 fields (i.e., all of the general-purpose registers excluding xsp, xip, and xflags). On ARM, selects r0-r12 and r14. On AArch64, selects r0-r30. |
DR_MC_CONTROL | On x86, selects the xsp, xflags, and xip fields. On ARM, selects the sp, pc, and cpsr fields. On AArch64, selects the sp, pc, and nzcv fields.
|
DR_MC_MULTIMEDIA | Selects the simd fields. This flag is ignored unless dr_mcontext_xmm_fields_valid() returns true. If dr_mcontext_xmm_fields_valid() returns false, the application values of the multimedia registers remain in the registers themselves. |
DR_MC_ALL | Selects all fields |
enum dr_where_am_i_t |
Identifies where a thread's control is at any one point. Used with client PC sampling using dr_set_itimer().
union ALIGN_VAR | ( | 16 | ) |
128-bit ARM SIMD Vn register. In AArch64, align to 16 bytes for better performance. In AArch32, we're not using any uint64 fields here to avoid alignment padding in sensitive structs. We could alternatively use pragma pack.
< Bottom 8 bits of Vn == Bn.
< Bottom 16 bits of Vn == Hn.
< Bottom 32 bits of Vn == Sn.
< Bottom 64 bits of Vn == Dn as d[1]:d[0].
< 128-bit Qn as q[3]:q[2]:q[1]:q[0].
< The full 128-bit register.
file_t our_stderr |
Allow use of stderr after the application closes it.
file_t our_stdin |
Allow use of stdin after the application closes it.
file_t our_stdout |
Allow use of stdout after the application closes it.