Adds a new execute_native_handler() feature where DR delivers a signal to a currently-native thread. For a native thread, a signal frame is set up on the appropriate stack, blocked signals are set natively rather than for emulation, and control is directly sent to the application's handler.
Adds handling of asynchronous signals by not recording them for delivery later but delivering immediately.
Adds a test that uses the client interface DR_EMIT_GO_NATIVE to send a thread native. The app then generates a synchronous and an asynchronous signal.
Initial attempts are made to also handle a pure-native thread with no dcontex, such as late in detach, but that portion is not fully finished and will be completed separately. Handling deault-action signals is also not fully tested and likely still has some issues to be worked out.
Fixes several small bugs in the go-native path hit by the test:
- Moves dynamo_thread_not_under_dynamo() to dispatch_enter_native() to avoid problems unlocking bb_building_lock on the path back through dispatch.
- Relaxes a TRY_EXCEPT assert to support a currently-native thread with no dcontext in TLS.
- Suppresses a curiosity from a still-temporarily-native thread at exit.
Issue: #1921 (closed)