From 91662decf0e8f728b158027feb75a2b86b6c8caf Mon Sep 17 00:00:00 2001 From: TuxSH Date: Thu, 15 Nov 2018 11:56:26 +0100 Subject: [PATCH] meso: add KProcess::SetDebugPauseState --- .../include/mesosphere/processes/KProcess.hpp | 2 ++ mesosphere/source/processes/KProcess.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/mesosphere/include/mesosphere/processes/KProcess.hpp b/mesosphere/include/mesosphere/processes/KProcess.hpp index 58f164117..13cd14bca 100644 --- a/mesosphere/include/mesosphere/processes/KProcess.hpp +++ b/mesosphere/include/mesosphere/processes/KProcess.hpp @@ -39,6 +39,8 @@ class KProcess final : public KSynchronizationObject /* FIXME */ { constexpr State GetState() const { return state; } + void SetDebugPauseState(bool pause); + KDebug *GetDebug() const { return debug; } void SetDebug(KDebug *debug); void ClearDebug(State attachState); diff --git a/mesosphere/source/processes/KProcess.cpp b/mesosphere/source/processes/KProcess.cpp index 35fe15698..eef69396d 100644 --- a/mesosphere/source/processes/KProcess.cpp +++ b/mesosphere/source/processes/KProcess.cpp @@ -42,4 +42,17 @@ void KProcess::ClearDebug(KProcess::State attachState) } } +void KProcess::SetDebugPauseState(bool pause) { + if (pause && state == State::StartedAttached) { + state = State::DebugSuspended; + } else if (!pause && state == State::DebugSuspended) { + state = State::StartedAttached; + } else { + return; + } + + stateChanged = true; + NotifyWaiters(); +} + }