This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pausing gdb


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]