]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointIDList.h
Merge lldb trunk r321017 to contrib/llvm/tools/lldb.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Breakpoint / BreakpointIDList.h
1 //===-- BreakpointIDList.h --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_BreakpointIDList_h_
11 #define liblldb_BreakpointIDList_h_
12
13 // C Includes
14 // C++ Includes
15 #include <utility>
16 #include <vector>
17
18 // Other libraries and framework includes
19 // Project includes
20
21 #include "lldb/lldb-enumerations.h"
22 #include "lldb/Breakpoint/BreakpointID.h"
23 #include "lldb/Breakpoint/BreakpointName.h"
24 #include "lldb/lldb-private.h"
25
26 namespace lldb_private {
27
28 //----------------------------------------------------------------------
29 // class BreakpointIDList
30 //----------------------------------------------------------------------
31
32 class BreakpointIDList {
33 public:
34   // TODO: Convert this class to StringRef.
35   typedef std::vector<BreakpointID> BreakpointIDArray;
36
37   BreakpointIDList();
38
39   virtual ~BreakpointIDList();
40
41   size_t GetSize() const;
42
43   const BreakpointID &GetBreakpointIDAtIndex(size_t index) const;
44
45   bool RemoveBreakpointIDAtIndex(size_t index);
46
47   void Clear();
48
49   bool AddBreakpointID(BreakpointID bp_id);
50
51   bool AddBreakpointID(const char *bp_id);
52
53   // TODO: This should take a const BreakpointID.
54   bool FindBreakpointID(BreakpointID &bp_id, size_t *position) const;
55
56   bool FindBreakpointID(const char *bp_id, size_t *position) const;
57
58   void InsertStringArray(const char **string_array, size_t array_size,
59                          CommandReturnObject &result);
60
61   // Returns a pair consisting of the beginning and end of a breakpoint
62   // ID range expression.  If the input string is not a valid specification,
63   // returns an empty pair.
64   static std::pair<llvm::StringRef, llvm::StringRef>
65   SplitIDRangeExpression(llvm::StringRef in_string);
66
67   static void FindAndReplaceIDRanges(Args &old_args, Target *target,
68                                      bool allow_locations,
69                                      BreakpointName::Permissions
70                                        ::PermissionKinds purpose,
71                                      CommandReturnObject &result,
72                                      Args &new_args);
73
74 private:
75   BreakpointIDArray m_breakpoint_ids;
76   BreakpointID m_invalid_id;
77
78   DISALLOW_COPY_AND_ASSIGN(BreakpointIDList);
79 };
80
81 } // namespace lldb_private
82
83 #endif // liblldb_BreakpointIDList_h_