pausing gdb

Andrew Cagney cagney@gnu.org
Thu Aug 5 00:24:00 GMT 2004


> Hi,
> 
> Can anyone tell me how ctrl-c is handled in gdb?  More importantly how
> is gdb able to continue from a sigint.
> 
> your help is much appreciated.

I'm assuming this is UNIX.  Check the man pages for ptrace, and wait. 
The sequence, assuming that GDB's attached to the process (aka inferior):

- GDB's blocked on wait() ; inferior process running
- user enters CNTRL-C
- kernel, instead of delivering cntrl-c to inferior process, unblocks 
GDB returning a ``SIGINT'' indication for that wait() call
- GDB interacts with user
- user enters "continue"
- gdb does ptrace (continue)
- kernel resumes inferior process (signal is never delivered)

Andrew




More information about the Gdb mailing list