diff options
author | Pedro Alves <pedro@palves.net> | 2022-07-05 12:21:50 +0100 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2022-12-12 19:04:15 +0000 |
commit | da1fac18727e4cb0ac2a764de81fc4212af95f21 (patch) | |
tree | 6a076c1c9a21e608b2935c39f6758a87fe6f0f5f | |
parent | 925d3dc8a1b2eecab82bbcaffbf9b4c86883b17f (diff) | |
download | gdb-da1fac18727e4cb0ac2a764de81fc4212af95f21.zip gdb-da1fac18727e4cb0ac2a764de81fc4212af95f21.tar.gz gdb-da1fac18727e4cb0ac2a764de81fc4212af95f21.tar.bz2 |
gdbserver/linux-low.cc: Ignore event_ptid if TARGET_WAITKIND_IGNORE
gdbserver's linux_process_target::wait loops if called sync mode, and
wait_1 returns TARGET_WAITKIND_IGNORE, _and_ wait_1 also returns
null_ptid. The null_ptid check fails however when this path is taken:
ptid_t
linux_process_target::filter_exit_event (lwp_info *event_child,
target_waitstatus *ourstatus)
{
...
if (!is_leader (thread))
{
if (report_exit_events_for (thread))
ourstatus->set_thread_exited (0);
else
ourstatus->set_ignore (); <<<<<<<
delete_lwp (event_child);
}
return ptid;
}
This makes linux_process_target::wait return TARGET_WAITKIND_IGNORE in
sync mode, which is unexpected by the core and fails an assertion.
This commit fixes it by just making linux_process_target::wait loop if
it got a TARGET_WAITKIND_IGNORE, irrespective of event_ptid.
Change-Id: I39776908a6c75cbd68aa04139ffcf7be334868cf
-rw-r--r-- | gdbserver/linux-low.cc | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index a7c3102..8c0d310 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -3636,7 +3636,6 @@ linux_process_target::wait (ptid_t ptid, event_ptid = wait_1 (ptid, ourstatus, target_options); } while ((target_options & TARGET_WNOHANG) == 0 - && event_ptid == null_ptid && ourstatus->kind () == TARGET_WAITKIND_IGNORE); /* If at least one stop was reported, there may be more. A single |