I have an exception handler for an arm32 bit system running Linux. When the exception occurs, I'd like to do some analysis, and optionally change the PC and some other registers when the exception returns. I thought it would be easy to find information on how to properly do this online, but I've not found anything as of yet.
I can get the registers at the time of the exception from the ucontext_t * parameter, and I thought I would be able to simply modify this to effect the return state, however, I found this, which suggests that I cannot do that. I'm wondering if there is a proper way to do this?
Just to clarify -- I want the signal handler to adjust the PC and registers of the thread that was running when the exception occured, such that when the thread resumes, it resumes with a slightly different state.