1 //===-- DNBThreadResumeActions.h --------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Created by Greg Clayton on 03/13/2010
11 //===----------------------------------------------------------------------===//
13 #ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBTHREADRESUMEACTIONS_H
14 #define LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBTHREADRESUMEACTIONS_H
20 class DNBThreadResumeActions
{
22 DNBThreadResumeActions();
24 DNBThreadResumeActions(nub_state_t default_action
, int signal
);
26 DNBThreadResumeActions(const DNBThreadResumeAction
*actions
,
29 bool IsEmpty() const { return m_actions
.empty(); }
31 void Append(const DNBThreadResumeAction
&action
);
33 void AppendAction(nub_thread_t tid
, nub_state_t state
, int signal
= 0,
34 nub_addr_t addr
= INVALID_NUB_ADDRESS
);
36 void AppendResumeAll() { AppendAction(INVALID_NUB_THREAD
, eStateRunning
); }
38 void AppendSuspendAll() { AppendAction(INVALID_NUB_THREAD
, eStateStopped
); }
40 void AppendStepAll() { AppendAction(INVALID_NUB_THREAD
, eStateStepping
); }
42 const DNBThreadResumeAction
*GetActionForThread(nub_thread_t tid
,
43 bool default_ok
) const;
45 size_t NumActionsWithState(nub_state_t state
) const;
47 bool SetDefaultThreadActionIfNeeded(nub_state_t action
, int signal
);
49 void SetSignalHandledForThread(nub_thread_t tid
) const;
51 const DNBThreadResumeAction
*GetFirst() const { return m_actions
.data(); }
53 size_t GetSize() const { return m_actions
.size(); }
57 m_signal_handled
.clear();
61 std::vector
<DNBThreadResumeAction
> m_actions
;
62 mutable std::vector
<bool> m_signal_handled
;
65 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBTHREADRESUMEACTIONS_H