I have a program that I am trying to reverse, which contains an int3 (0xCC) which emits a SIGTRAP signal, which is then handled by a sighandler defined in sigaction.
The handler performs calculations on certain values.
When I'm debugging with GDB, the SIGTRAP is raised, and the handler does not receive the signal because it is GDB which intercepts it. I need the signal to be caught in order to see what the handler is dynamically returning as a value.
I tried to disable SIGTRAP interception with the command :
handle SIGTRAP nostop noprint noignore
but I have the following error:
Program terminated with signal SIGTRAP, Trace / breakpoint trap. The program no longer exists.
My goal is to make sure that I can let the SIGTRAP be intercepted by the sighandler and not by GDB, but still be able to launch the program and place breakpoints.