1 | //===-- BreakpointIDList.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 | #ifndef LLDB_BREAKPOINT_BREAKPOINTIDLIST_H |
10 | #define LLDB_BREAKPOINT_BREAKPOINTIDLIST_H |
11 | |
12 | #include <utility> |
13 | #include <vector> |
14 | |
15 | #include "lldb/Breakpoint/BreakpointID.h" |
16 | #include "lldb/Breakpoint/BreakpointName.h" |
17 | #include "lldb/lldb-enumerations.h" |
18 | #include "lldb/lldb-private.h" |
19 | |
20 | #include "llvm/Support/Error.h" |
21 | |
22 | namespace lldb_private { |
23 | |
24 | // class BreakpointIDList |
25 | |
26 | class BreakpointIDList { |
27 | public: |
28 | // TODO: Convert this class to StringRef. |
29 | typedef std::vector<BreakpointID> BreakpointIDArray; |
30 | |
31 | BreakpointIDList(); |
32 | |
33 | virtual ~BreakpointIDList(); |
34 | |
35 | size_t GetSize() const; |
36 | |
37 | BreakpointID GetBreakpointIDAtIndex(size_t index) const; |
38 | |
39 | bool RemoveBreakpointIDAtIndex(size_t index); |
40 | |
41 | void Clear(); |
42 | |
43 | bool AddBreakpointID(BreakpointID bp_id); |
44 | |
45 | bool Contains(BreakpointID bp_id) const; |
46 | |
47 | // Returns a pair consisting of the beginning and end of a breakpoint |
48 | // ID range expression. If the input string is not a valid specification, |
49 | // returns an empty pair. |
50 | static std::pair<llvm::StringRef, llvm::StringRef> |
51 | SplitIDRangeExpression(llvm::StringRef in_string); |
52 | |
53 | static llvm::Error |
54 | FindAndReplaceIDRanges(Args &old_args, Target *target, bool allow_locations, |
55 | BreakpointName::Permissions ::PermissionKinds purpose, |
56 | Args &new_args); |
57 | |
58 | private: |
59 | BreakpointIDArray m_breakpoint_ids; |
60 | |
61 | BreakpointIDList(const BreakpointIDList &) = delete; |
62 | const BreakpointIDList &operator=(const BreakpointIDList &) = delete; |
63 | }; |
64 | |
65 | } // namespace lldb_private |
66 | |
67 | #endif // LLDB_BREAKPOINT_BREAKPOINTIDLIST_H |
68 | |