Linux – How to print the last received signal in GDB

coredumpdebugginggdblinux

when loading a core dump into GDB the reason why it crashed automatically is displayed. For example

Program terminated with signal 11, Segmentation fault.

Is there any way to get the information again?
The thing is, that I'm writing a script which needs this information. But if the signal is only available after loading the core dump amd I can't access the information later on.

Is there really no command for such an important feature?

Best Answer

To print the information about the last signal execute

p $_siginfo