Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB (not) handling SIGINT...?
@ 2018-11-13 22:37 Paul Smith
  2018-11-14 22:32 ` Simon Marchi
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Smith @ 2018-11-13 22:37 UTC (permalink / raw)
  To: gdb

Hi all; I'm using GDB 8.1 on a modern 64bit GNU/Linux system (Ubuntu
18.04LTS).

Recently I added a call to sigtimedwait() for SIGINT into my
(multithreaded) program and now I'm having an issue with GDB.

What I want is that if I attach to my program then continue, then use
^C at the GDB terminal, I should get a (gdb) prompt back but I do NOT
want the SIGINT delivered to my program to wake up my sigtimedwait()
call (because it will cause my program to do various things that I
don't want it to do).

I see that SIGINT is set to nopass:

  (gdb) info signals SIGINT
  Signal        Stop      Print   Pass to program Description
  SIGINT        Yes       Yes     No              Interrupt

but yet when I use ^C at the GDB prompt my sigtimedwait() call inside
my program does return with "2" (SIGINT), which I don't want.

I guess I don't understand what the docs mean when they say that the
signal is not passed to the process under debug.  Note that in my case
I'm attaching to the program from a completely different terminal so
there's no issue with process groups etc. and as far as I can
understand it, the signal should only be delivered to GDB not my
process, so unless there's some weird magic at work here it must be GDB
forwarding that signal to my process.

Anyone have any thoughts about this?

Cheers!


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-11-19 19:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 22:37 GDB (not) handling SIGINT...? Paul Smith
2018-11-14 22:32 ` Simon Marchi
2018-11-15 13:55   ` Pedro Alves
2018-11-15 16:01     ` Paul Smith
2018-11-15 16:24       ` Pedro Alves
2018-11-15 18:01         ` Paul Smith
2018-11-15 18:04           ` Pedro Alves
2018-11-15 18:27             ` Paul Smith
2018-11-19 19:07         ` Paul Smith
2018-11-19 19:44           ` Paul Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox