Skip to main content

dr_save_arith_flags_to_reg

Function dr_save_arith_flags_to_reg 

Source
pub unsafe extern "C" fn dr_save_arith_flags_to_reg(
    drcontext: *mut c_void,
    ilist: *mut instrlist_t,
    where_: *mut instr_t,
    reg: reg_id_t,
)
Expand description

Inserts into \p ilist prior to \p where meta-instruction(s) to save the arithmetic flags (6 arithmetic flags on X86 or APSR on ARM) into \p reg. If the caller wishes to use \p reg between saving and restoring these flags, they must save and restore \p reg, potentially using dr_save_reg()/dr_restore_reg(). If the caller needs to save both the current value of \p reg and the flags stored to \p reg by this routine, they must use separate spill slots, or they will overwrite the original \p reg value in memory.

\note On X86, only DR_REG_XAX should be passed in.

\warning Clobbers \p reg; the caller must ensure \p reg is dead or saved at \p where.