Linux signal handling. How to get address of interrupted instruction? [duplicate]
问题 This question already has answers here : Getting fault address that generated a UNIX signal (2 answers) Closed 3 years ago . Is there any way to figure out address of machine instruction, that was interrupted by some signal? Assuming that we are at handler established by sigaction() and have all access to passed siginfo_t and ucontext_t . As far as I see man pages says nothing about it. 回答1: Not portable. But this is for x86_64: The structure ucontext_t contains the value of the register REG