Skip to main content

dr_delete_fragment

Function dr_delete_fragment 

Source
pub unsafe extern "C" fn dr_delete_fragment(
    drcontext: *mut c_void,
    tag: *mut c_void,
) -> bool_
Expand description

Deletes the fragment with tag \p tag. This routine is only valid with the -thread_private option; it deletes the fragment in the current thread only. After deletion, the existing fragment is allowed to complete execution. For example, a clean call deleting the currently executing fragment will safely return to the existing code. Subsequent executions will cause DynamoRIO to reconstruct the fragment, and therefore call the appropriate fragment-creation event hook, if registered.

\note This routine supports deletion for the current thread only. \p drcontext must be from the current thread and must be the drcontext used to create the instruction list. This routine may not be called from the thread exit event.

\note Other options of removing the code fragments from code cache include dr_flush_region(), dr_unlink_flush_region(), and dr_delay_flush_region().

\return false if the fragment does not exist and true otherwise.