This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: exceptions.KeyboardInterrupt is thrown in gdb.base/random-signal.exp

Pedro Alves <> 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?

Yao (éå)

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