For debugging reasons I am trying to print the name of the function that made an illegal memory access (out of range for example).
I have written a SIGSEGV signal handler to print the Instruction Pointer (IP) and the faulted memory address, but I was not able to create a method such that I can get the function name and not the IP.
Is there a way to modify the signature of the signal handler to pass the __ FUNCTION __ variable as an argument or is there another method to do this?
Note: The program is written in C and I trying to do this in a Linux environment.