public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Is readline's SIGINT handler supposed to set quit_flag?
@ 2011-11-06 20:29 Doug Evans
  2011-11-06 21:17 ` Jan Kratochvil
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2011-11-06 20:29 UTC (permalink / raw)
  To: gdb

Hi.
While playing with tab-completion speedups I found that ^c never
sets quit_flag, and thus QUITs in completion routines are useless
(when invoked from readline).

Am I missing something?
[It's possible I messed up and quit_flag is indeed set,
but I'm not sure what I'm missing.]

Or is ^c when in readline not intended to invoke the QUIT machinery?
[It may be that more is needed to make it work, I'm just a bit surprised
and am looking for guidance on how things are expected to work.]

e.g.

(gdb) b functi<tab><^c>

Is that ^c intended to terminate all the symbol completion machinery?

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

* Re: Is readline's SIGINT handler supposed to set quit_flag?
  2011-11-06 20:29 Is readline's SIGINT handler supposed to set quit_flag? Doug Evans
@ 2011-11-06 21:17 ` Jan Kratochvil
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kratochvil @ 2011-11-06 21:17 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb

On Sun, 06 Nov 2011 21:28:51 +0100, Doug Evans wrote:
> Or is ^c when in readline not intended to invoke the QUIT machinery?

I find it working in general.  The idea is that:

GDB has handle_sigint installed which sets QUIT_FLAG.

readline has _rl_handle_signal installed which will do some readline cleanups
and call also rl_cleanup_after_signal which restores back the SIGINT handler
to GDB and rethrows the SIGINT signal, so that GBD catches it.

readline also aborts some completion operations it does thanks to the work
_rl_handle_signal does.

Offtopic here is that various functions are called from that signal handler
which are not signal-safe in POSIX and sometimes really crash GDB.


> (gdb) b functi<tab><^c>
> 
> Is that ^c intended to terminate all the symbol completion machinery?

It works for me, for

(gdb) b f<tab><^c>

FSF GDB HEAD aborts for me leaving on screen:
(gdb) b fQuit
(gdb) _


Regards,
Jan

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

end of thread, other threads:[~2011-11-06 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06 20:29 Is readline's SIGINT handler supposed to set quit_flag? Doug Evans
2011-11-06 21:17 ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).