1 //===-- OptionGroupWatchpoint.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_OptionGroupWatchpoint_h_
11 #define liblldb_OptionGroupWatchpoint_h_
12 
13 #include "lldb/Interpreter/Options.h"
14 
15 namespace lldb_private {
16 
17 //-------------------------------------------------------------------------
18 // OptionGroupWatchpoint
19 //-------------------------------------------------------------------------
20 
21 class OptionGroupWatchpoint : public OptionGroup {
22 public:
23   OptionGroupWatchpoint();
24 
25   ~OptionGroupWatchpoint() override;
26 
27   static bool IsWatchSizeSupported(uint32_t watch_size);
28 
29   llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
30 
31   Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
32                         ExecutionContext *execution_context) override;
33   Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
34 
35   void OptionParsingStarting(ExecutionContext *execution_context) override;
36 
37   // Note:
38   // eWatchRead == LLDB_WATCH_TYPE_READ; and
39   // eWatchWrite == LLDB_WATCH_TYPE_WRITE
40   typedef enum WatchType {
41     eWatchInvalid = 0,
42     eWatchRead,
43     eWatchWrite,
44     eWatchReadWrite
45   } WatchType;
46 
47   WatchType watch_type;
48   uint32_t watch_size;
49   bool watch_type_specified;
50 
51 private:
52   DISALLOW_COPY_AND_ASSIGN(OptionGroupWatchpoint);
53 };
54 
55 } // namespace lldb_private
56 
57 #endif // liblldb_OptionGroupWatchpoint_h_
58