]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Windows gdb: Change serial_event management
authorPedro Alves <pedro@palves.net>
Mon, 22 May 2023 10:29:44 +0000 (11:29 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 17:09:15 +0000 (18:09 +0100)
commitad7ecb7741d5c434f5f2e178b84195e46bd39c40
tree452dafe7916db19f9d1f86a3ac442a872e8188fd
parentc639573dc2da83a6fdc07d895b60ba23dc68e58e
Windows gdb: Change serial_event management

windows_nat_target::windows_continue, when it finds a resumed thread
that has a pending event, does:

  /* There's no need to really continue, because there's already
     another event pending.  However, we do need to inform the
     event loop of this.  */
  serial_event_set (m_wait_event);
  return TRUE;

If we have more than one pending event ready to be consumed, and,
windows_nat_target::wait returns without calling
windows_nat_target::windows_continue, which it will with the non-stop
support in the following patch, then we will miss waking up the event
loop.

This patch makes windows-nat.c manage the serial_event similarly to
how linux-nat.c does it.  Clear it on entry to
windows_nat_target::wait, and set it if there may be more events to
process.  With this, there's no need to set it from
windows_nat_target::wait_for_debug_event_main_thread, so the patch
also makes us not do it.

Change-Id: I44e1682721aa4866f1dbb052b3cfb4870fb13579
gdb/windows-nat.c