Linux: Snoop case-insensitive signal for subsequent core dump?

When I get a signal that calls coredump, I want to run my own handler to copy the siginfo_t and ucontext_t structures into global variables so that they can be accessed in a kernel dump. At the end of my handler, I reassign the default handler and call the raise (thesig). The problem with this is that in the base dump "info registers" the status of the registers in my handler is displayed, and not during the initial signal. I understand that since I saved ucontext_t, I can see that for the initial values ​​of the register, but this knowledge is likely to be lost / forgotten when the main dumps are passed around the command.

So my question is: is there a way to re-trace the signal and ensure that the core dump file maintains the registration state of the original signal? I thought that maybe I could use some built-in asm to manually restore all regs at the end of the handler, and then return to the instruction that caused the signal instead of calling raise (), but I'm not sure if we can guarantee that re - activation of the command will lead to the same signaling behavior as the first attempt.

+5
source share
1 answer

copy the siginfo_t and ucontext_t structures to global variables so that they can be accessed by a core dump

, - - .

"info registers" , .

up 5 ( , ) info reg .

, ?

: SIG_DFL signal(signum, SIG_DFL); . , SIGSEGV, .

+3

All Articles