Support forging OS signals on Linux
Created by: yury-khrustalev
Users list discussion Original discussion: https://groups.google.com/forum/#!topic/dynamorio-users/kHAyNgzvXuA.
Description This feature request is about supporting raising a signal from code inserted by a clean call. This signal should appear as a signal naturally raised by OS for the application or by the application itself. This should be correctly detected y debuggers (the point of fault should be found at the specified PC of the instrumented application code). This ticket is limited to scope of Linux / MacOS support.
How it should look
// API
void dr_forge_signal(app_pc pc, int sig);
// Usage
app_pc pc = ...;
int sig = SIGILL;
dr_forge_signal(pc, sig);
Poor man's solution
A dummy solution is to invoke int raise(int sig);
from signal.h
, however this is not "expected" by DynamoRIO core and is not handled properly (especially if DR is built in Debug mode), plus there is no way to deliver correct PC to a debugger.
Existing functionality
There already is function os_forge_exception
which does something similar, but is not exposed via API.