[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / lldb / tools / debugserver / source / DNBThreadResumeActions.h
blob2970b7636c541d341d807efea3d7efda3fb576bd
1 //===-- DNBThreadResumeActions.h --------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
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
16 #include <vector>
18 #include "DNBDefs.h"
20 class DNBThreadResumeActions {
21 public:
22 DNBThreadResumeActions();
24 DNBThreadResumeActions(nub_state_t default_action, int signal);
26 DNBThreadResumeActions(const DNBThreadResumeAction *actions,
27 size_t num_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(); }
55 void Clear() {
56 m_actions.clear();
57 m_signal_handled.clear();
60 protected:
61 std::vector<DNBThreadResumeAction> m_actions;
62 mutable std::vector<bool> m_signal_handled;
65 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBTHREADRESUMEACTIONS_H