1 //===-- BreakpointIDList.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 #ifndef liblldb_BreakpointIDList_h_
10 #define liblldb_BreakpointIDList_h_
16 #include "lldb/lldb-enumerations.h"
17 #include "lldb/Breakpoint/BreakpointID.h"
18 #include "lldb/Breakpoint/BreakpointName.h"
19 #include "lldb/lldb-private.h"
21 namespace lldb_private {
23 // class BreakpointIDList
25 class BreakpointIDList {
27 // TODO: Convert this class to StringRef.
28 typedef std::vector<BreakpointID> BreakpointIDArray;
32 virtual ~BreakpointIDList();
34 size_t GetSize() const;
36 const BreakpointID &GetBreakpointIDAtIndex(size_t index) const;
38 bool RemoveBreakpointIDAtIndex(size_t index);
42 bool AddBreakpointID(BreakpointID bp_id);
44 bool AddBreakpointID(const char *bp_id);
46 // TODO: This should take a const BreakpointID.
47 bool FindBreakpointID(BreakpointID &bp_id, size_t *position) const;
49 bool FindBreakpointID(const char *bp_id, size_t *position) const;
51 void InsertStringArray(llvm::ArrayRef<const char *> string_array,
52 CommandReturnObject &result);
54 // Returns a pair consisting of the beginning and end of a breakpoint
55 // ID range expression. If the input string is not a valid specification,
56 // returns an empty pair.
57 static std::pair<llvm::StringRef, llvm::StringRef>
58 SplitIDRangeExpression(llvm::StringRef in_string);
60 static void FindAndReplaceIDRanges(Args &old_args, Target *target,
62 BreakpointName::Permissions
63 ::PermissionKinds purpose,
64 CommandReturnObject &result,
68 BreakpointIDArray m_breakpoint_ids;
69 BreakpointID m_invalid_id;
71 DISALLOW_COPY_AND_ASSIGN(BreakpointIDList);
74 } // namespace lldb_private
76 #endif // liblldb_BreakpointIDList_h_