This is the mail archive of the
mailing list for the GDB project.
Re: exceptions.KeyboardInterrupt is thrown in gdb.base/random-signal.exp
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 03 Dec 2015 17:09:39 +0000
- Subject: Re: exceptions.KeyboardInterrupt is thrown in gdb.base/random-signal.exp
- Authentication-results: sourceware.org; auth=none
- References: <86ziy2xdt7 dot fsf at gmail dot com> <5655E141 dot 7030503 at redhat dot com> <86zixut7ju dot fsf at gmail dot com> <566039BF dot 5000207 at redhat dot com>
Pedro Alves <firstname.lastname@example.org> writes:
> IMO, if the inferior is running and target_terminal_inferior is not in
> effect (*) then the ctrl-c should _not_ trigger a Python
> KeyboardInterrupt, but instead
> be sent to the target -- if the target is running and we're running some
> not-supposed-to-be-interactive Python unwinder code while processing
> some internal stop
> event, we know that the Python code will finish quickly and the target
> should stop
> for the SIGINT very soon. IOW, we treat the ctrl-c at exactly the
> wrong time as if
> it had been pressed a little sooner or later, outside Python.
> (*) - and it shouldn't, while an internal event is being processed.
If I understand you correctly, ctrl-c shouldn't trigger a Python
KeyboardInterrupt, and we should fix it somewhere in GDB.
> To handle the case of something going wrong and gdb getting stuck in a loop too
> long that the target's SIGINT takes forever to be processed, we could make gdb
> react to a _second_ (impatient) ctrl-c as "okay, I'm sick of waiting,
> please stop
> whatever you're doing". This is like how remote.c handles ctrl-c at exactly the
> wrong moment (while an internal event is processed) nowadays:
I don't know how is this problem related to the second ctrl-c. It is
expected that single ctrl-c should interrupt the target, why do we need
the second ctrl-c in this case?