Hmm. I am not in a position to actually debug this, but I am reading the
gdb sources and I think I understand what is happening. In gdb/inflow.c is
the following comment and code, which gets run when you do an "attach"
(among other times).
/* If attach_flag is set, we don't know whether
I haven't been able to follow this up much, but I find gdb accepts keyboard
signals when the process is run from gdb, but when gdb attaches to a process
direct keyboard signals no longer work. The last encounter I had with this
problem I was able to send an external signal to gdb and it worked.