Skip to main content

drwrap_invoke_insert

Function drwrap_invoke_insert 

Source
pub unsafe extern "C" fn drwrap_invoke_insert(
    drcontext: *mut c_void,
    tag: *mut c_void,
    bb: *mut instrlist_t,
    inst: *mut instr_t,
    where_: *mut instr_t,
    for_trace: bool_,
    translating: bool_,
    user_data: *mut c_void,
) -> dr_emit_flags_t
Expand description

When #drwrap_global_flags_t #DRWRAP_INVERT_CONTROL is set, the user must call this function from a drmgr insertion event handler (typically registered with drmgr_register_bb_instrumentation_event() or if using drbbdup with the instrument_instr_ex field in #drbbdup_options_t). This function will insert instrumentation for function wrapping pre and post callbacks. It is up to the user to control the ordering, since the priority #DRMGR_PRIORITY_INSERT_DRWRAP will not apply. The separate “where” handles cases such as with drbbdup’s final app instruction (which cannot be duplicated into each case) or with emulation where the instruction “inst” to monitor is distinct from the location “where” to insert instrumentation. The \p user_data parameter is ignored.