pub unsafe extern "C" fn dr_redirect_execution(
context: *mut dr_mcontext_t,
) -> bool_Expand description
Immediately resumes application execution from a clean call out of the cache (see dr_insert_clean_call() or dr_prepare_for_call()) or an exception event with the state specified in \p mcontext (including pc, and including the xmm fields that are valid according to dr_mcontext_xmm_fields_valid()). The flags field of \p context must contain DR_MC_ALL; using a partial set of fields is not suported.
For 32-bit ARM, be sure to use dr_app_pc_as_jump_target() to properly set the ISA mode for the continuation pc if it was obtained from instr_get_app_pc() or a similar source rather than from dr_get_proc_address(). This will set the least significant bit of the mcontext pc field to 1 when in Thumb mode (#DR_ISA_ARM_THUMB), \ref sec_thumb for more information.
\note dr_get_mcontext() can be used to get the register state (except pc) saved in dr_insert_clean_call() or dr_prepare_for_call().
\note If x87 floating point state was saved by dr_prepare_for_call() or dr_insert_clean_call() it is not restored (other than the valid xmm fields according to dr_mcontext_xmm_fields_valid(), if #DR_MC_MULTIMEDIA is specified in the flags field). The caller should instead manually save and restore the floating point state with proc_save_fpstate() and proc_restore_fpstate() if necessary.
\note If the caller wishes to set any other state (such as xmm registers that are not part of the mcontext) they may do so by just setting that state in the current thread before making this call. To set system data structures, use dr_switch_to_app_state(), make the changes, and then switch back with dr_switch_to_dr_state() before calling this routine.
\note This routine may only be called from a clean call from the cache. It can not be called from any registered event callback except the exception event (dr_register_exception_event()). From a signal event callback, use the #DR_SIGNAL_REDIRECT return value rather than calling this routine.
\note If control is being redirected to a new pc (determined using drsyms, dr_get_proc_address, or any other way) ensure that the app state (such as the register values) are set as expected by the transfer point.
\return false if unsuccessful; if successful, does not return.