LLDB  mainline
SBVariablesOptions.cpp
Go to the documentation of this file.
1 //===-- SBVariablesOptions.cpp --------------------------------------*- C++
2 //-*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "SBReproducerPrivate.h"
12 #include "lldb/API/SBTarget.h"
13 #include "lldb/Target/Target.h"
14 
15 #include "lldb/lldb-private.h"
16 
17 using namespace lldb;
18 using namespace lldb_private;
19 
21 public:
23  : m_include_arguments(false), m_include_locals(false),
24  m_include_statics(false), m_in_scope_only(false),
25  m_include_runtime_support_values(false),
26  m_include_recognized_arguments(eLazyBoolCalculate),
27  m_use_dynamic(lldb::eNoDynamicValues) {}
28 
29  VariablesOptionsImpl(const VariablesOptionsImpl &) = default;
30 
31  ~VariablesOptionsImpl() = default;
32 
33  VariablesOptionsImpl &operator=(const VariablesOptionsImpl &) = default;
34 
35  bool GetIncludeArguments() const { return m_include_arguments; }
36 
37  void SetIncludeArguments(bool b) { m_include_arguments = b; }
38 
39  bool GetIncludeRecognizedArguments(const lldb::TargetSP &target_sp) const {
40  if (m_include_recognized_arguments != eLazyBoolCalculate)
41  return m_include_recognized_arguments;
42  return target_sp ? target_sp->GetDisplayRecognizedArguments() : false;
43  }
44 
46  m_include_recognized_arguments = b ? eLazyBoolYes : eLazyBoolNo;
47  }
48 
49  bool GetIncludeLocals() const { return m_include_locals; }
50 
51  void SetIncludeLocals(bool b) { m_include_locals = b; }
52 
53  bool GetIncludeStatics() const { return m_include_statics; }
54 
55  void SetIncludeStatics(bool b) { m_include_statics = b; }
56 
57  bool GetInScopeOnly() const { return m_in_scope_only; }
58 
59  void SetInScopeOnly(bool b) { m_in_scope_only = b; }
60 
62  return m_include_runtime_support_values;
63  }
64 
66  m_include_runtime_support_values = b;
67  }
68 
69  lldb::DynamicValueType GetUseDynamic() const { return m_use_dynamic; }
70 
71  void SetUseDynamic(lldb::DynamicValueType d) { m_use_dynamic = d; }
72 
73 private:
74  bool m_include_arguments : 1;
75  bool m_include_locals : 1;
76  bool m_include_statics : 1;
77  bool m_in_scope_only : 1;
78  bool m_include_runtime_support_values : 1;
79  LazyBool m_include_recognized_arguments; // can be overridden with a setting
80  lldb::DynamicValueType m_use_dynamic;
81 };
82 
84  : m_opaque_up(new VariablesOptionsImpl()) {
86 }
87 
89  : m_opaque_up(new VariablesOptionsImpl(options.ref())) {
91  (const lldb::SBVariablesOptions &), options);
92 }
93 
95 operator=(const SBVariablesOptions &options) {
98  SBVariablesOptions, operator=,(const lldb::SBVariablesOptions &),
99  options);
100 
101  m_opaque_up.reset(new VariablesOptionsImpl(options.ref()));
102  return LLDB_RECORD_RESULT(*this);
103 }
104 
106 
109  return this->operator bool();
110 }
111 SBVariablesOptions::operator bool() const {
113 
114  return m_opaque_up != nullptr;
115 }
116 
120 
121  return m_opaque_up->GetIncludeArguments();
122 }
123 
126  arguments);
127 
128  m_opaque_up->SetIncludeArguments(arguments);
129 }
130 
132  const lldb::SBTarget &target) const {
135  (const lldb::SBTarget &), target);
136 
137  return m_opaque_up->GetIncludeRecognizedArguments(target.GetSP());
138 }
139 
142  (bool), arguments);
143 
144  m_opaque_up->SetIncludeRecognizedArguments(arguments);
145 }
146 
149 
150  return m_opaque_up->GetIncludeLocals();
151 }
152 
155  locals);
156 
157  m_opaque_up->SetIncludeLocals(locals);
158 }
159 
162 
163  return m_opaque_up->GetIncludeStatics();
164 }
165 
168  statics);
169 
170  m_opaque_up->SetIncludeStatics(statics);
171 }
172 
175 
176  return m_opaque_up->GetInScopeOnly();
177 }
178 
179 void SBVariablesOptions::SetInScopeOnly(bool in_scope_only) {
181  in_scope_only);
182 
183  m_opaque_up->SetInScopeOnly(in_scope_only);
184 }
185 
189 
190  return m_opaque_up->GetIncludeRuntimeSupportValues();
191 }
192 
194  bool runtime_support_values) {
196  (bool), runtime_support_values);
197 
198  m_opaque_up->SetIncludeRuntimeSupportValues(runtime_support_values);
199 }
200 
203  GetUseDynamic);
204 
205  return m_opaque_up->GetUseDynamic();
206 }
207 
210  (lldb::DynamicValueType), dynamic);
211 
212  m_opaque_up->SetUseDynamic(dynamic);
213 }
214 
216  return m_opaque_up.operator->();
217 }
218 
220  return m_opaque_up.operator->();
221 }
222 
223 VariablesOptionsImpl *SBVariablesOptions::get() { return m_opaque_up.get(); }
224 
226 
228  return *m_opaque_up;
229 }
230 
232  : m_opaque_up(std::move(lldb_object_ptr)) {}
233 
235  m_opaque_up.reset(std::move(lldb_object_ptr));
236 }
237 
238 namespace lldb_private {
239 namespace repro {
240 
241 template <>
245  (const lldb::SBVariablesOptions &));
248  SBVariablesOptions, operator=,(const lldb::SBVariablesOptions &));
250  LLDB_REGISTER_METHOD_CONST(bool, SBVariablesOptions, operator bool, ());
252  ());
256  (const lldb::SBTarget &));
270  GetUseDynamic, ());
273 }
274 
275 }
276 }
The registry contains a unique mapping between functions and their ID.
VariablesOptionsImpl * get()
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
void SetIncludeArguments(bool b)
void SetUseDynamic(lldb::DynamicValueType d)
bool GetIncludeRecognizedArguments(const lldb::SBTarget &) const
bool GetIncludeRecognizedArguments(const lldb::TargetSP &target_sp) const
lldb::DynamicValueType GetUseDynamic() const
void SetUseDynamic(lldb::DynamicValueType)
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
lldb::TargetSP GetSP() const
Definition: SBTarget.cpp:600
void RegisterMethods< SBVariablesOptions >(Registry &R)
void SetIncludeRecognizedArguments(bool b)
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
bool GetIncludeArguments() const
VariablesOptionsImpl * operator->()
#define LLDB_RECORD_METHOD_CONST(Result, Class, Method, Signature,...)
bool GetIncludeRuntimeSupportValues() const
VariablesOptionsImpl & ref()
SBVariablesOptions & operator=(const SBVariablesOptions &options)
lldb::DynamicValueType GetUseDynamic() const
void SetOptions(VariablesOptionsImpl *lldb_object_ptr)
Definition: SBAddress.h:15
bool GetIncludeRuntimeSupportValues() const
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
void SetIncludeRuntimeSupportValues(bool b)
#define LLDB_RECORD_RESULT(Result)
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)