Implements drstatecmp, a library for machine state comparison for detecting instrumentation-induced clobbering of application state.
This implementation supports checks for side-effect-free basic blocks (with the exception of the terminating instruction that could be a function call with side effects). The check involves executing two versions of these basic blocks, one with instrumentation and one without, and then comparing the resulting state to detect bugs. When a mismatch is detected, by default, the disassembled basic block that involved the bug will be emitted.
Illustrates the use of the drstatecmp library by providing a sample client. This sample client introduces an instrumentation bug that is caught by drstatecmp. This sample client also shows how to specify a user-defined callback to be invoked on state comparison mismatches.
Originally part of #4938.
Issue: #4678