1 //===-- BreakpointIDList.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_BreakpointIDList_h_
11 #define liblldb_BreakpointIDList_h_
17 #include "lldb/lldb-enumerations.h"
18 #include "lldb/Breakpoint/BreakpointID.h"
19 #include "lldb/Breakpoint/BreakpointName.h"
20 #include "lldb/lldb-private.h"
22 namespace lldb_private {
24 //----------------------------------------------------------------------
25 // class BreakpointIDList
26 //----------------------------------------------------------------------
28 class BreakpointIDList {
30 // TODO: Convert this class to StringRef.
31 typedef std::vector<BreakpointID> BreakpointIDArray;
35 virtual ~BreakpointIDList();
37 size_t GetSize() const;
39 const BreakpointID &GetBreakpointIDAtIndex(size_t index) const;
41 bool RemoveBreakpointIDAtIndex(size_t index);
45 bool AddBreakpointID(BreakpointID bp_id);
47 bool AddBreakpointID(const char *bp_id);
49 // TODO: This should take a const BreakpointID.
50 bool FindBreakpointID(BreakpointID &bp_id, size_t *position) const;
52 bool FindBreakpointID(const char *bp_id, size_t *position) const;
54 void InsertStringArray(llvm::ArrayRef<const char *> string_array,
55 CommandReturnObject &result);
57 // Returns a pair consisting of the beginning and end of a breakpoint
58 // ID range expression. If the input string is not a valid specification,
59 // returns an empty pair.
60 static std::pair<llvm::StringRef, llvm::StringRef>
61 SplitIDRangeExpression(llvm::StringRef in_string);
63 static void FindAndReplaceIDRanges(Args &old_args, Target *target,
65 BreakpointName::Permissions
66 ::PermissionKinds purpose,
67 CommandReturnObject &result,
71 BreakpointIDArray m_breakpoint_ids;
72 BreakpointID m_invalid_id;
74 DISALLOW_COPY_AND_ASSIGN(BreakpointIDList);
77 } // namespace lldb_private
79 #endif // liblldb_BreakpointIDList_h_