Avoid constant stream of TARGET_WAITKIND_NO_RESUMED
authorPedro Alves <pedro@palves.net>
Mon, 6 Jul 2020 19:02:48 +0000 (20:02 +0100)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 8 Jul 2020 18:19:08 +0000 (14:19 -0400)
commit0e2dba2d6d367b23ec744b95f2189482f4e4b188
tree55bcfd44fc9e0b4234a6cfdb3f1031c6c413e99b
parent730f6c2af471e1bfba21dd663eaf9d9d16fe7212
Avoid constant stream of TARGET_WAITKIND_NO_RESUMED

If we hit the synchronous execution command case described by
handle_no_resumed, and handle_no_resumed determines that the event
should be ignored, because it found a thread that is executing, we end
up in prepare_to_wait.

There, if the current target is not registered in the event loop right
now, we call mark_infrun_async_event_handler.  With that event handler
marked, the event loop calls again into fetch_inferior_event, which
calls target_wait, which returns TARGET_WAITKIND_NO_RESUMED, and we
end up in handle_no_resumed, again ignoring the event and marking
infrun_async_event_handler.  The result is that GDB is now always
keeping the CPU 100% busy in this loop, even though it continues to be
able to react to input and to real target events, because we still go
through the event-loop.

The problem is that marking of the infrun_async_event_handler in
prepare_to_wait.  That is there to handle targets that don't support
asynchronous execution.  So the correct predicate is whether async
execution is supported, not whether the target is async right now.

gdb/ChangeLog:

PR gdb/26199
* infrun.c (prepare_to_wait): Check target_can_async_p instead of
target_is_async_p.
gdb/infrun.c
This page took 0.023249 seconds and 4 git commands to generate.