Adds a new drwrap API, drwrap_get_retaddr_if_sentinel(), that allows mitigation of a transparency violation under the DRWRAP_REPLACE_RETADDR drwrap strategy where the return address on the stack is replaced with the address of the internal replace_retaddr_sentinel() routine. This API modifies the passed-in value to the actual return address of the inner-most nested wrapped function if the passed-in value is replace_retaddr_sentinel() itself.
Fixes the value of the marker written by the kernel xfer event in drmemtrace by using the new drwrap_get_retaddr_if_sentinel() API on the mcontext PC before writing it out to the trace. Before, this caused many invariant errors of type 'Signal handler return point incorrect' in traces collected on proprietary apps.
Verified on a large proprietary app that this error due to drwrap is fixed now, whereas there were a few hundred instances before.
Fixes: #5784 (closed)