| 902 | |
| 903 | |
| 904 | void DebuggerController::QuitAndWait() |
| 905 | { |
| 906 | bool locked = false; |
| 907 | if (m_targetControlMutex.try_lock()) |
| 908 | locked = true; |
| 909 | |
| 910 | if (!m_state->IsConnected()) |
| 911 | return; |
| 912 | |
| 913 | if (m_state->IsRunning()) |
| 914 | { |
| 915 | // We must pause the target if it is currently running, at least for DbgEngAdapter |
| 916 | PauseAndWait(); |
| 917 | } |
| 918 | |
| 919 | // TODO: return whether the operation is successful |
| 920 | ExecuteAdapterAndWait(DebugAdapterQuit); |
| 921 | |
| 922 | // There is no need to notify a TargetExitedEvent at this point, since the exit event is already processed |
| 923 | // by all the callback |
| 924 | |
| 925 | if (locked) |
| 926 | m_targetControlMutex.unlock(); |
| 927 | } |
| 928 | |
| 929 | |
| 930 | bool DebuggerController::Pause() |
no test coverage detected