forked from OSchip/llvm-project
[lldb] [Process/FreeBSD] Do not send SIGSTOP to stopped process
Do not send SIGSTOP when requested to halt a process that's already stopped. This results in the signal being queued for delivery once the process is resumed, and unexpectedly stopping it again. This is necessary for non-stop protocol patches to land. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D126770
This commit is contained in:
parent
1896df18cc
commit
aed179f5f5
|
@ -497,6 +497,10 @@ Status NativeProcessFreeBSD::Resume(const ResumeActionList &resume_actions) {
|
|||
Status NativeProcessFreeBSD::Halt() {
|
||||
Status error;
|
||||
|
||||
// Do not try to stop a process that's already stopped, this may cause
|
||||
// the SIGSTOP to get queued and stop the process again once resumed.
|
||||
if (StateIsStoppedState(m_state, false))
|
||||
return error;
|
||||
if (kill(GetID(), SIGSTOP) != 0)
|
||||
error.SetErrorToErrno();
|
||||
return error;
|
||||
|
|
Loading…
Reference in New Issue