pub unsafe extern "C" fn drmgr_in_emulation_region(
drcontext: *mut c_void,
emulation_info: *mut *const emulated_instr_t,
) -> bool_Expand description
Must be called during drmgr’s insertion phase. Returns whether the current instruction in the phase is inside an emulation region. If it returns true, \p emulation_info is written with a pointer to information about the emulation. The pointed-at information’s lifetime is the full range of the emulation region.
This is a convenience routine that records the state for the drmgr_is_emulation_start() and drmgr_is_emulation_end() labels and the #DR_EMULATE_REST_OF_BLOCK flag to prevent the client having to store state.
While this is exported, there is still complexity in analyzing the different flags, and we recommend that clients do not use this function directly but instead use the two routines drmgr_orig_app_instr_for_fetch() and drmgr_orig_app_instr_for_operands() (which internally use this function):
dr_emit_flags_t event_insertion(void *drcontext, void *tag, instrlist_t *bb, instr_t *insert_instr, bool for_trace, bool translating, void *user_data) { instr_t *instr_fetch = drmgr_orig_app_instr_for_fetch(drcontext); if (instr_fetch != NULL) record_instr_fetch(instr_fetch); instr_t *instr_operands = drmgr_orig_app_instr_for_operands(drcontext); if (instr_operands_valid != NULL) record_data_addresses(instr_operands); return DR_EMIT_DEFAULT; }
\return false if the caller’s \p emulated_instr_t is not compatible, true otherwise.