I’d built a version of gdb 7.0 for myself after being pointed to a new feature, and happened to have that in my path still.
Attempting to step through some new code, I’d added a pause() call, expecting to be able to get out like so:
(gdb) b 5048 Breakpoint 1 at 0x2b1811b25052: file testca.C, line 5048. (gdb) signal SIGCONT Continuing with signal SIGCONT. Breakpoint 1, FLUSH_SUDF_TEST (h=@0x2b1811b061c0) at testca.C:5048 5048 rc = h.SAL_testcaFlushPagesByUDF( uPrimary - 1, uPrimary ) ;
(that was with the system gdb, version 6.6).
With gdb 7.0 I never hit the post-pause() breakpoint when I try this. With the various multi process debugging changes in gdb 7, does anybody know if signal handling has to be handled differently and how?
The
pause()function does not return unless a signal handler is called (see the specification and the man page).To make it return after your program receives SIGCONT, you must install an handler for SIGCONT. Try and see using the following example:
The behavior is correct with gdb 7.0:
pause()completely ignores ignored signals (likeSIGCHLD, returns on caught signals (SIGCONT), and no signal is delivered when thecontinuecommand is issued.