This is the mail archive of the gdb@sourceware.org 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: GDB (not) handling SIGINT...?


On Thu, 2018-11-15 at 16:24 +0000, Pedro Alves wrote:
> With current GDB, you can work around this by attaching in non-stop
> mode ("set non-stop on"), and then using "continue&" to continue in
> the background, and the "interrupt" command to interrupt.

Tricksy!

> If you're OK with hacking GDB, s/SIGINT/SIGSTOP/g in child_pass_ctrlc
> should work reasonably OK, even though not perfect.

Oh, I understand now.  The SIGINT is passed to the child to get it to
stop.  Somehow I assumed that there was a magical ptrace way to do
this, rather than having to send normal signals.

I guess there is now: using PTRACE_SEIZE instead of PTRACE_ATTACH,
which will allow you to later send PTRACE_INTERRUPT: presumably if this
were used would solve the problem for attached processes anyway...?


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