This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

blocking SIGINT?


Hi,

when sending SIGINT to gdb when it waits in the cmd line for user input, I
get a "Quit", and a new prompt. Sending SIGINT after that, nothing happens,
so I suspect SIGINTs are masked off by GDB after that. 

This is obviously an intended feature, as it is in gdb-4.16 and gdb-4.17,
independent of target configuration. My host config is i586-unknown-linux.

The reason, why I find this behavior annoying, is my implementation of
target->to_wait() in the m68k-BDM backend: I install a Unix SIGINT handler,
which catches the SIGINT from the user and signals the target to stop.
to_wait() periodically checks with some sleeps between, if the target has
stopped. If it has for any reason (e.g. breakpoint, crash, etc), the SIGINT
handler is restored, and the stop is analzed. 

This works fine, as long as the user does not hit ctrl-c when in the cmd
line. Now when GDB blocks SIGINTs there is no chance to interrupt the
target by this mechanism, after the user issues the next "continue" cmd.

How can I disable SIGINT blocking of GDB? Or should I implement target
waiting in another way, which is more compatible to GDB? Any pointers or
suggestions?

gm
-- 
Gunter Magin                                      magin[AT]skil.camelot.de