LLDB  mainline
TypeSynthetic.h
Go to the documentation of this file.
1 //===-- TypeSynthetic.h -----------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_DATAFORMATTERS_TYPESYNTHETIC_H
10 #define LLDB_DATAFORMATTERS_TYPESYNTHETIC_H
11 
12 #include <cstdint>
13 
14 #include <functional>
15 #include <initializer_list>
16 #include <memory>
17 #include <string>
18 #include <vector>
19 
20 #include "lldb/lldb-enumerations.h"
21 #include "lldb/lldb-public.h"
22 
23 #include "lldb/Core/ValueObject.h"
25 
26 namespace lldb_private {
28 protected:
30 
31  void SetValid(bool valid) { m_valid = valid; }
32 
33  bool IsValid() { return m_valid; }
34 
35 public:
37  : m_backend(backend), m_valid(true) {}
38 
39  virtual ~SyntheticChildrenFrontEnd() = default;
40 
41  virtual size_t CalculateNumChildren() = 0;
42 
43  virtual size_t CalculateNumChildren(uint32_t max) {
44  auto count = CalculateNumChildren();
45  return count <= max ? count : max;
46  }
47 
48  virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx) = 0;
49 
50  virtual size_t GetIndexOfChildWithName(ConstString name) = 0;
51 
52  // this function is assumed to always succeed and it if fails, the front-end
53  // should know to deal with it in the correct way (most probably, by refusing
54  // to return any children) the return value of Update() should actually be
55  // interpreted as "ValueObjectSyntheticFilter cache is good/bad" if =true,
56  // ValueObjectSyntheticFilter is allowed to use the children it fetched
57  // previously and cached if =false, ValueObjectSyntheticFilter must throw
58  // away its cache, and query again for children
59  virtual bool Update() = 0;
60 
61  // if this function returns false, then CalculateNumChildren() MUST return 0
62  // since UI frontends might validly decide not to inquire for children given
63  // a false return value from this call if it returns true, then
64  // CalculateNumChildren() can return any number >= 0 (0 being valid) it
65  // should if at all possible be more efficient than CalculateNumChildren()
66  virtual bool MightHaveChildren() = 0;
67 
68  // if this function returns a non-null ValueObject, then the returned
69  // ValueObject will stand for this ValueObject whenever a "value" request is
70  // made to this ValueObject
71  virtual lldb::ValueObjectSP GetSyntheticValue() { return nullptr; }
72 
73  // if this function returns a non-empty ConstString, then clients are
74  // expected to use the return as the name of the type of this ValueObject for
75  // display purposes
77 
78  typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
79  typedef std::unique_ptr<SyntheticChildrenFrontEnd> AutoPointer;
80 
81 protected:
82  lldb::ValueObjectSP
83  CreateValueObjectFromExpression(llvm::StringRef name,
84  llvm::StringRef expression,
85  const ExecutionContext &exe_ctx);
86 
87  lldb::ValueObjectSP
88  CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address,
89  const ExecutionContext &exe_ctx,
90  CompilerType type);
91 
92  lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name,
93  const DataExtractor &data,
94  const ExecutionContext &exe_ctx,
95  CompilerType type);
96 
97 private:
98  bool m_valid;
101  operator=(const SyntheticChildrenFrontEnd &) = delete;
102 };
103 
105 public:
107  : SyntheticChildrenFrontEnd(backend) {}
108 
109  ~SyntheticValueProviderFrontEnd() override = default;
110 
111  size_t CalculateNumChildren() override { return 0; }
112 
113  lldb::ValueObjectSP GetChildAtIndex(size_t idx) override { return nullptr; }
114 
115  size_t GetIndexOfChildWithName(ConstString name) override {
116  return UINT32_MAX;
117  }
118 
119  bool Update() override { return false; }
120 
121  bool MightHaveChildren() override { return false; }
122 
123  lldb::ValueObjectSP GetSyntheticValue() override = 0;
124 
125 private:
127  delete;
129  operator=(const SyntheticValueProviderFrontEnd &) = delete;
130 };
131 
133 public:
134  class Flags {
135  public:
136  Flags() = default;
137 
138  Flags(const Flags &other) : m_flags(other.m_flags) {}
139 
140  Flags(uint32_t value) : m_flags(value) {}
141 
142  Flags &operator=(const Flags &rhs) {
143  if (&rhs != this)
144  m_flags = rhs.m_flags;
145 
146  return *this;
147  }
148 
149  Flags &operator=(const uint32_t &rhs) {
150  m_flags = rhs;
151  return *this;
152  }
153 
155  m_flags = 0;
156  return *this;
157  }
158 
159  bool GetCascades() const {
160  return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;
161  }
162 
163  Flags &SetCascades(bool value = true) {
164  if (value)
165  m_flags |= lldb::eTypeOptionCascade;
166  else
167  m_flags &= ~lldb::eTypeOptionCascade;
168  return *this;
169  }
170 
171  bool GetSkipPointers() const {
172  return (m_flags & lldb::eTypeOptionSkipPointers) ==
173  lldb::eTypeOptionSkipPointers;
174  }
175 
176  Flags &SetSkipPointers(bool value = true) {
177  if (value)
178  m_flags |= lldb::eTypeOptionSkipPointers;
179  else
180  m_flags &= ~lldb::eTypeOptionSkipPointers;
181  return *this;
182  }
183 
184  bool GetSkipReferences() const {
185  return (m_flags & lldb::eTypeOptionSkipReferences) ==
186  lldb::eTypeOptionSkipReferences;
187  }
188 
189  Flags &SetSkipReferences(bool value = true) {
190  if (value)
191  m_flags |= lldb::eTypeOptionSkipReferences;
192  else
193  m_flags &= ~lldb::eTypeOptionSkipReferences;
194  return *this;
195  }
196 
197  bool GetNonCacheable() const {
198  return (m_flags & lldb::eTypeOptionNonCacheable) ==
199  lldb::eTypeOptionNonCacheable;
200  }
201 
202  Flags &SetNonCacheable(bool value = true) {
203  if (value)
204  m_flags |= lldb::eTypeOptionNonCacheable;
205  else
206  m_flags &= ~lldb::eTypeOptionNonCacheable;
207  return *this;
208  }
209 
211  return (m_flags & lldb::eTypeOptionFrontEndWantsDereference) ==
212  lldb::eTypeOptionFrontEndWantsDereference;
213  }
214 
215  Flags &SetFrontEndWantsDereference(bool value = true) {
216  if (value)
217  m_flags |= lldb::eTypeOptionFrontEndWantsDereference;
218  else
219  m_flags &= ~lldb::eTypeOptionFrontEndWantsDereference;
220  return *this;
221  }
222 
223  uint32_t GetValue() { return m_flags; }
224 
225  void SetValue(uint32_t value) { m_flags = value; }
226 
227  private:
228  uint32_t m_flags = lldb::eTypeOptionCascade;
229  };
230 
231  SyntheticChildren(const Flags &flags) : m_flags(flags) {}
232 
233  virtual ~SyntheticChildren() = default;
234 
235  bool Cascades() const { return m_flags.GetCascades(); }
236 
237  bool SkipsPointers() const { return m_flags.GetSkipPointers(); }
238 
239  bool SkipsReferences() const { return m_flags.GetSkipReferences(); }
240 
241  bool NonCacheable() const { return m_flags.GetNonCacheable(); }
242 
244 
245  void SetCascades(bool value) { m_flags.SetCascades(value); }
246 
247  void SetSkipsPointers(bool value) { m_flags.SetSkipPointers(value); }
248 
249  void SetSkipsReferences(bool value) { m_flags.SetSkipReferences(value); }
250 
251  void SetNonCacheable(bool value) { m_flags.SetNonCacheable(value); }
252 
254 
255  void SetOptions(uint32_t value) { m_flags.SetValue(value); }
256 
257  virtual bool IsScripted() = 0;
258 
259  virtual std::string GetDescription() = 0;
260 
262  GetFrontEnd(ValueObject &backend) = 0;
263 
264  typedef std::shared_ptr<SyntheticChildren> SharedPointer;
265 
267 
268 protected:
271 
272 private:
273  SyntheticChildren(const SyntheticChildren &) = delete;
274  const SyntheticChildren &operator=(const SyntheticChildren &) = delete;
275 };
276 
278  std::vector<std::string> m_expression_paths;
279 
280 public:
283 
285  const std::initializer_list<const char *> items)
287  for (auto path : items)
288  AddExpressionPath(path);
289  }
290 
291  void AddExpressionPath(const char *path) {
293  }
294 
295  void Clear() { m_expression_paths.clear(); }
296 
297  size_t GetCount() const { return m_expression_paths.size(); }
298 
299  const char *GetExpressionPathAtIndex(size_t i) const {
300  return m_expression_paths[i].c_str();
301  }
302 
303  bool SetExpressionPathAtIndex(size_t i, const char *path) {
304  return SetExpressionPathAtIndex(i, std::string(path));
305  }
306 
307  void AddExpressionPath(const std::string &path);
308 
309  bool SetExpressionPathAtIndex(size_t i, const std::string &path);
310 
311  bool IsScripted() override { return false; }
312 
313  std::string GetDescription() override;
314 
316  public:
318  : SyntheticChildrenFrontEnd(backend), filter(flt) {}
319 
320  ~FrontEnd() override = default;
321 
322  size_t CalculateNumChildren() override { return filter->GetCount(); }
323 
324  lldb::ValueObjectSP GetChildAtIndex(size_t idx) override {
325  if (idx >= filter->GetCount())
326  return lldb::ValueObjectSP();
328  filter->GetExpressionPathAtIndex(idx), true);
329  }
330 
331  bool Update() override { return false; }
332 
333  bool MightHaveChildren() override { return filter->GetCount() > 0; }
334 
335  size_t GetIndexOfChildWithName(ConstString name) override;
336 
337  typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
338 
339  private:
341 
342  FrontEnd(const FrontEnd &) = delete;
343  const FrontEnd &operator=(const FrontEnd &) = delete;
344  };
345 
347  GetFrontEnd(ValueObject &backend) override {
348  return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));
349  }
350 
351  typedef std::shared_ptr<TypeFilterImpl> SharedPointer;
352 
353 private:
354  TypeFilterImpl(const TypeFilterImpl &) = delete;
355  const TypeFilterImpl &operator=(const TypeFilterImpl &) = delete;
356 };
357 
359 public:
360  typedef std::function<SyntheticChildrenFrontEnd *(CXXSyntheticChildren *,
361  lldb::ValueObjectSP)>
364  const char *description, CreateFrontEndCallback callback)
365  : SyntheticChildren(flags), m_create_callback(std::move(callback)),
366  m_description(description ? description : "") {}
367 
368  bool IsScripted() override { return false; }
369 
370  std::string GetDescription() override;
371 
373  GetFrontEnd(ValueObject &backend) override {
375  m_create_callback(this, backend.GetSP()));
376  }
377 
378 protected:
381 
382 private:
383  CXXSyntheticChildren(const CXXSyntheticChildren &) = delete;
384  const CXXSyntheticChildren &operator=(const CXXSyntheticChildren &) = delete;
385 };
386 
390 
391 public:
393  const char *pclass, const char *pcode = nullptr)
395  if (pclass)
396  m_python_class = pclass;
397  if (pcode)
398  m_python_code = pcode;
399  }
400 
401  const char *GetPythonClassName() { return m_python_class.c_str(); }
402 
403  const char *GetPythonCode() { return m_python_code.c_str(); }
404 
405  void SetPythonClassName(const char *fname) {
406  m_python_class.assign(fname);
407  m_python_code.clear();
408  }
409 
410  void SetPythonCode(const char *script) { m_python_code.assign(script); }
411 
412  std::string GetDescription() override;
413 
414  bool IsScripted() override { return true; }
415 
417  public:
418  FrontEnd(std::string pclass, ValueObject &backend);
419 
420  ~FrontEnd() override;
421 
422  bool IsValid();
423 
424  size_t CalculateNumChildren() override;
425 
426  size_t CalculateNumChildren(uint32_t max) override;
427 
428  lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
429 
430  bool Update() override;
431 
432  bool MightHaveChildren() override;
433 
434  size_t GetIndexOfChildWithName(ConstString name) override;
435 
436  lldb::ValueObjectSP GetSyntheticValue() override;
437 
439 
440  typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
441 
442  private:
446 
447  FrontEnd(const FrontEnd &) = delete;
448  const FrontEnd &operator=(const FrontEnd &) = delete;
449  };
450 
452  GetFrontEnd(ValueObject &backend) override {
454  new FrontEnd(m_python_class, backend));
455  if (synth_ptr && ((FrontEnd *)synth_ptr.get())->IsValid())
456  return synth_ptr;
457  return nullptr;
458  }
459 
460 private:
463  operator=(const ScriptedSyntheticChildren &) = delete;
464 };
465 } // namespace lldb_private
466 
467 #endif // LLDB_DATAFORMATTERS_TYPESYNTHETIC_H
lldb_private::SyntheticChildren::Flags
Definition: TypeSynthetic.h:134
lldb_private::ScriptedSyntheticChildren::FrontEnd::m_interpreter
ScriptInterpreter * m_interpreter
Definition: TypeSynthetic.h:445
lldb_private::ScriptedSyntheticChildren
Definition: TypeSynthetic.h:387
lldb_private::SyntheticChildren::Flags::GetSkipReferences
bool GetSkipReferences() const
Definition: TypeSynthetic.h:184
lldb_private::ScriptedSyntheticChildren::FrontEnd::GetChildAtIndex
lldb::ValueObjectSP GetChildAtIndex(size_t idx) override
Definition: TypeSynthetic.cpp:149
lldb_private::TypeFilterImpl::FrontEnd::SharedPointer
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
Definition: TypeSynthetic.h:337
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb-public.h
lldb_private::SyntheticChildrenFrontEnd::AutoPointer
std::unique_ptr< SyntheticChildrenFrontEnd > AutoPointer
Definition: TypeSynthetic.h:79
lldb_private::TypeFilterImpl::FrontEnd::CalculateNumChildren
size_t CalculateNumChildren() override
Definition: TypeSynthetic.h:322
lldb_private::SyntheticChildren::Flags::SetSkipReferences
Flags & SetSkipReferences(bool value=true)
Definition: TypeSynthetic.h:189
lldb_private::SyntheticChildren::SetOptions
void SetOptions(uint32_t value)
Definition: TypeSynthetic.h:255
lldb_private::SyntheticValueProviderFrontEnd::CalculateNumChildren
size_t CalculateNumChildren() override
Definition: TypeSynthetic.h:111
lldb_private::SyntheticChildren::GetDescription
virtual std::string GetDescription()=0
lldb_private::SyntheticChildren::SyntheticChildren
SyntheticChildren(const Flags &flags)
Definition: TypeSynthetic.h:231
lldb_private::ScriptedSyntheticChildren::SetPythonClassName
void SetPythonClassName(const char *fname)
Definition: TypeSynthetic.h:405
StructuredData.h
lldb_private::ScriptedSyntheticChildren::FrontEnd
Definition: TypeSynthetic.h:416
lldb_private::SyntheticChildren::Flags::SetNonCacheable
Flags & SetNonCacheable(bool value=true)
Definition: TypeSynthetic.h:202
lldb_private::SyntheticChildren::Flags::GetSkipPointers
bool GetSkipPointers() const
Definition: TypeSynthetic.h:171
lldb_private::CXXSyntheticChildren::CreateFrontEndCallback
std::function< SyntheticChildrenFrontEnd *(CXXSyntheticChildren *, lldb::ValueObjectSP)> CreateFrontEndCallback
Definition: TypeSynthetic.h:362
lldb_private::ScriptedSyntheticChildren::FrontEnd::Update
bool Update() override
Definition: TypeSynthetic.cpp:172
lldb_private::TypeFilterImpl::FrontEnd::operator=
const FrontEnd & operator=(const FrontEnd &)=delete
lldb_private::ScriptedSyntheticChildren::FrontEnd::GetIndexOfChildWithName
size_t GetIndexOfChildWithName(ConstString name) override
Definition: TypeSynthetic.cpp:186
lldb_private::TypeFilterImpl::operator=
const TypeFilterImpl & operator=(const TypeFilterImpl &)=delete
lldb_private::ScriptedSyntheticChildren::FrontEnd::FrontEnd
FrontEnd(std::string pclass, ValueObject &backend)
Definition: TypeSynthetic.cpp:127
lldb_private::SyntheticChildrenFrontEnd::SetValid
void SetValid(bool valid)
Definition: TypeSynthetic.h:31
lldb_private::CXXSyntheticChildren::IsScripted
bool IsScripted() override
Definition: TypeSynthetic.h:368
lldb_private::SyntheticChildrenFrontEnd::IsValid
bool IsValid()
Definition: TypeSynthetic.h:33
lldb_private::SyntheticChildrenFrontEnd
Definition: TypeSynthetic.h:27
lldb_private::SyntheticChildrenFrontEnd::operator=
const SyntheticChildrenFrontEnd & operator=(const SyntheticChildrenFrontEnd &)=delete
lldb_private::ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren
size_t CalculateNumChildren() override
Definition: TypeSynthetic.cpp:160
lldb_private::TypeFilterImpl
Definition: TypeSynthetic.h:277
lldb_private::TypeFilterImpl::GetDescription
std::string GetDescription() override
Definition: TypeSynthetic.cpp:73
lldb_private::SyntheticChildren::Flags::GetCascades
bool GetCascades() const
Definition: TypeSynthetic.h:159
lldb_private::SyntheticChildren::m_flags
Flags m_flags
Definition: TypeSynthetic.h:270
lldb_private::TypeFilterImpl::IsScripted
bool IsScripted() override
Definition: TypeSynthetic.h:311
lldb_private::SyntheticChildren::Flags::Flags
Flags(const Flags &other)
Definition: TypeSynthetic.h:138
lldb_private::SyntheticChildren::Flags::GetValue
uint32_t GetValue()
Definition: TypeSynthetic.h:223
lldb_private::TypeFilterImpl::FrontEnd::GetChildAtIndex
lldb::ValueObjectSP GetChildAtIndex(size_t idx) override
Definition: TypeSynthetic.h:324
lldb_private::SyntheticChildren::Flags::operator=
Flags & operator=(const uint32_t &rhs)
Definition: TypeSynthetic.h:149
lldb_private::SyntheticChildrenFrontEnd::GetSyntheticTypeName
virtual ConstString GetSyntheticTypeName()
Definition: TypeSynthetic.h:76
lldb_private::ScriptedSyntheticChildren::GetDescription
std::string GetDescription() override
Definition: TypeSynthetic.cpp:208
lldb_private::ScriptedSyntheticChildren::FrontEnd::GetSyntheticValue
lldb::ValueObjectSP GetSyntheticValue() override
Definition: TypeSynthetic.cpp:194
lldb_private::SyntheticChildrenFrontEnd::CalculateNumChildren
virtual size_t CalculateNumChildren(uint32_t max)
Definition: TypeSynthetic.h:43
lldb_private::SyntheticValueProviderFrontEnd::~SyntheticValueProviderFrontEnd
~SyntheticValueProviderFrontEnd() override=default
lldb_private::TypeFilterImpl::GetExpressionPathAtIndex
const char * GetExpressionPathAtIndex(size_t i) const
Definition: TypeSynthetic.h:299
lldb_private::SyntheticChildrenFrontEnd::SharedPointer
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
Definition: TypeSynthetic.h:78
lldb_private::SyntheticChildren::SetCascades
void SetCascades(bool value)
Definition: TypeSynthetic.h:245
lldb_private::SyntheticChildren::Flags::Clear
Flags & Clear()
Definition: TypeSynthetic.h:154
lldb_private::SyntheticChildren::~SyntheticChildren
virtual ~SyntheticChildren()=default
lldb_private::ScriptedSyntheticChildren::GetPythonCode
const char * GetPythonCode()
Definition: TypeSynthetic.h:403
lldb_private::TypeFilterImpl::Clear
void Clear()
Definition: TypeSynthetic.h:295
lldb_private::ScriptedSyntheticChildren::FrontEnd::m_wrapper_sp
StructuredData::ObjectSP m_wrapper_sp
Definition: TypeSynthetic.h:444
lldb_private::TypeFilterImpl::FrontEnd::FrontEnd
FrontEnd(TypeFilterImpl *flt, ValueObject &backend)
Definition: TypeSynthetic.h:317
lldb_private::ScriptedSyntheticChildren::IsScripted
bool IsScripted() override
Definition: TypeSynthetic.h:414
lldb_private::TypeFilterImpl::FrontEnd::GetIndexOfChildWithName
size_t GetIndexOfChildWithName(ConstString name) override
Definition: TypeSynthetic.cpp:53
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ScriptedSyntheticChildren::SetPythonCode
void SetPythonCode(const char *script)
Definition: TypeSynthetic.h:410
lldb_private::CXXSyntheticChildren::operator=
const CXXSyntheticChildren & operator=(const CXXSyntheticChildren &)=delete
lldb_private::SyntheticChildrenFrontEnd::GetChildAtIndex
virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx)=0
lldb_private::ScriptedSyntheticChildren::FrontEnd::~FrontEnd
~FrontEnd() override
lldb_private::SyntheticValueProviderFrontEnd
Definition: TypeSynthetic.h:104
lldb_private::ScriptedSyntheticChildren::GetFrontEnd
SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend) override
Definition: TypeSynthetic.h:452
lldb_private::ValueObject::GetSP
lldb::ValueObjectSP GetSP()
Definition: ValueObject.h:555
lldb_private::SyntheticChildren::operator=
const SyntheticChildren & operator=(const SyntheticChildren &)=delete
lldb_private::SyntheticChildren::Flags::Flags
Flags()=default
lldb_private::SyntheticChildrenFrontEnd::CalculateNumChildren
virtual size_t CalculateNumChildren()=0
lldb_private::SyntheticChildren::Flags::GetFrontEndWantsDereference
bool GetFrontEndWantsDereference() const
Definition: TypeSynthetic.h:210
lldb_private::SyntheticChildren::Flags::SetFrontEndWantsDereference
Flags & SetFrontEndWantsDereference(bool value=true)
Definition: TypeSynthetic.h:215
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::CXXSyntheticChildren::GetDescription
std::string GetDescription() override
Definition: TypeSynthetic.cpp:87
lldb_private::SyntheticChildren::GetRevision
uint32_t & GetRevision()
Definition: TypeSynthetic.h:266
lldb_private::SyntheticChildren::Flags::m_flags
uint32_t m_flags
Definition: TypeSynthetic.h:228
lldb_private::ConstString
Definition: ConstString.h:40
lldb-enumerations.h
lldb_private::SyntheticChildrenFrontEnd::SyntheticChildrenFrontEnd
SyntheticChildrenFrontEnd(ValueObject &backend)
Definition: TypeSynthetic.h:36
lldb_private::TypeFilterImpl::FrontEnd::~FrontEnd
~FrontEnd() override=default
lldb_private::SyntheticChildrenFrontEnd::GetSyntheticValue
virtual lldb::ValueObjectSP GetSyntheticValue()
Definition: TypeSynthetic.h:71
lldb_private::TypeFilterImpl::FrontEnd
Definition: TypeSynthetic.h:315
lldb_private::ScriptedSyntheticChildren::FrontEnd::GetSyntheticTypeName
ConstString GetSyntheticTypeName() override
Definition: TypeSynthetic.cpp:201
lldb_private::ScriptedSyntheticChildren::ScriptedSyntheticChildren
ScriptedSyntheticChildren(const SyntheticChildren::Flags &flags, const char *pclass, const char *pcode=nullptr)
Definition: TypeSynthetic.h:392
lldb_private::ScriptedSyntheticChildren::FrontEnd::m_python_class
std::string m_python_class
Definition: TypeSynthetic.h:443
lldb_private::TypeFilterImpl::m_expression_paths
std::vector< std::string > m_expression_paths
Definition: TypeSynthetic.h:278
lldb_private::SyntheticChildren::IsScripted
virtual bool IsScripted()=0
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::SyntheticChildren::Flags::SetValue
void SetValue(uint32_t value)
Definition: TypeSynthetic.h:225
lldb_private::SyntheticChildren::SkipsPointers
bool SkipsPointers() const
Definition: TypeSynthetic.h:237
ValueObject.h
lldb_private::SyntheticChildren::SharedPointer
std::shared_ptr< SyntheticChildren > SharedPointer
Definition: TypeSynthetic.h:264
lldb_private::SyntheticChildren::WantsDereference
bool WantsDereference() const
Definition: TypeSynthetic.h:243
lldb_private::SyntheticChildrenFrontEnd::CreateValueObjectFromExpression
lldb::ValueObjectSP CreateValueObjectFromExpression(llvm::StringRef name, llvm::StringRef expression, const ExecutionContext &exe_ctx)
Definition: TypeSynthetic.cpp:97
lldb_private::ScriptedSyntheticChildren::FrontEnd::operator=
const FrontEnd & operator=(const FrontEnd &)=delete
lldb_private::SyntheticValueProviderFrontEnd::GetIndexOfChildWithName
size_t GetIndexOfChildWithName(ConstString name) override
Definition: TypeSynthetic.h:115
lldb_private::SyntheticChildren::GetFrontEnd
virtual SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend)=0
lldb_private::SyntheticChildren::Flags::Flags
Flags(uint32_t value)
Definition: TypeSynthetic.h:140
lldb_private::SyntheticChildrenFrontEnd::m_backend
ValueObject & m_backend
Definition: TypeSynthetic.h:29
lldb_private::SyntheticChildren::SetNonCacheable
void SetNonCacheable(bool value)
Definition: TypeSynthetic.h:251
lldb_private::SyntheticValueProviderFrontEnd::GetSyntheticValue
lldb::ValueObjectSP GetSyntheticValue() override=0
lldb_private::SyntheticChildren::SkipsReferences
bool SkipsReferences() const
Definition: TypeSynthetic.h:239
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
uint32_t
lldb_private::ScriptedSyntheticChildren::FrontEnd::IsValid
bool IsValid()
Definition: TypeSynthetic.cpp:156
lldb_private::SyntheticChildrenFrontEnd::CreateValueObjectFromData
lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
Definition: TypeSynthetic.cpp:117
lldb_private::TypeFilterImpl::SharedPointer
std::shared_ptr< TypeFilterImpl > SharedPointer
Definition: TypeSynthetic.h:351
lldb_private::SyntheticValueProviderFrontEnd::GetChildAtIndex
lldb::ValueObjectSP GetChildAtIndex(size_t idx) override
Definition: TypeSynthetic.h:113
lldb_private::SyntheticChildrenFrontEnd::CreateValueObjectFromAddress
lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type)
Definition: TypeSynthetic.cpp:107
lldb_private::ScriptedSyntheticChildren::GetPythonClassName
const char * GetPythonClassName()
Definition: TypeSynthetic.h:401
lldb_private::SyntheticValueProviderFrontEnd::operator=
const SyntheticValueProviderFrontEnd & operator=(const SyntheticValueProviderFrontEnd &)=delete
lldb_private::SyntheticChildren::NonCacheable
bool NonCacheable() const
Definition: TypeSynthetic.h:241
lldb_private::TypeFilterImpl::AddExpressionPath
void AddExpressionPath(const char *path)
Definition: TypeSynthetic.h:291
lldb_private::CXXSyntheticChildren::CXXSyntheticChildren
CXXSyntheticChildren(const SyntheticChildren::Flags &flags, const char *description, CreateFrontEndCallback callback)
Definition: TypeSynthetic.h:363
lldb_private::SyntheticChildrenFrontEnd::~SyntheticChildrenFrontEnd
virtual ~SyntheticChildrenFrontEnd()=default
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::TypeFilterImpl::TypeFilterImpl
TypeFilterImpl(const SyntheticChildren::Flags &flags, const std::initializer_list< const char * > items)
Definition: TypeSynthetic.h:284
lldb_private::ScriptedSyntheticChildren::m_python_code
std::string m_python_code
Definition: TypeSynthetic.h:389
lldb_private::CXXSyntheticChildren::m_create_callback
CreateFrontEndCallback m_create_callback
Definition: TypeSynthetic.h:379
lldb_private::ScriptInterpreter
Definition: ScriptInterpreter.h:126
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::SyntheticChildren::GetOptions
uint32_t GetOptions()
Definition: TypeSynthetic.h:253
lldb_private::CXXSyntheticChildren::GetFrontEnd
SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend) override
Definition: TypeSynthetic.h:373
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeFilterImpl::FrontEnd::filter
TypeFilterImpl * filter
Definition: TypeSynthetic.h:340
lldb_private::SyntheticChildren::Flags::SetSkipPointers
Flags & SetSkipPointers(bool value=true)
Definition: TypeSynthetic.h:176
lldb_private::ScriptedSyntheticChildren::FrontEnd::MightHaveChildren
bool MightHaveChildren() override
Definition: TypeSynthetic.cpp:179
lldb_private::TypeFilterImpl::TypeFilterImpl
TypeFilterImpl(const SyntheticChildren::Flags &flags)
Definition: TypeSynthetic.h:281
lldb_private::SyntheticChildrenFrontEnd::GetIndexOfChildWithName
virtual size_t GetIndexOfChildWithName(ConstString name)=0
lldb_private::TypeFilterImpl::FrontEnd::Update
bool Update() override
Definition: TypeSynthetic.h:331
lldb_private::SyntheticChildrenFrontEnd::Update
virtual bool Update()=0
lldb_private::TypeFilterImpl::FrontEnd::MightHaveChildren
bool MightHaveChildren() override
Definition: TypeSynthetic.h:333
lldb_private::SyntheticChildren::SetSkipsReferences
void SetSkipsReferences(bool value)
Definition: TypeSynthetic.h:249
lldb_private::SyntheticValueProviderFrontEnd::Update
bool Update() override
Definition: TypeSynthetic.h:119
lldb_private::SyntheticChildren
Definition: TypeSynthetic.h:132
lldb_private::CXXSyntheticChildren::m_description
std::string m_description
Definition: TypeSynthetic.h:380
lldb_private::SyntheticValueProviderFrontEnd::SyntheticValueProviderFrontEnd
SyntheticValueProviderFrontEnd(ValueObject &backend)
Definition: TypeSynthetic.h:106
lldb_private::ScriptedSyntheticChildren::FrontEnd::SharedPointer
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
Definition: TypeSynthetic.h:440
lldb_private::SyntheticChildren::SetSkipsPointers
void SetSkipsPointers(bool value)
Definition: TypeSynthetic.h:247
lldb_private::ScriptedSyntheticChildren::m_python_class
std::string m_python_class
Definition: TypeSynthetic.h:388
lldb_private::CXXSyntheticChildren
Definition: TypeSynthetic.h:358
lldb_private::TypeFilterImpl::GetCount
size_t GetCount() const
Definition: TypeSynthetic.h:297
lldb_private::SyntheticChildrenFrontEnd::MightHaveChildren
virtual bool MightHaveChildren()=0
lldb_private::SyntheticChildren::Flags::GetNonCacheable
bool GetNonCacheable() const
Definition: TypeSynthetic.h:197
lldb
Definition: SBAddress.h:15
lldb_private::SyntheticChildren::Flags::operator=
Flags & operator=(const Flags &rhs)
Definition: TypeSynthetic.h:142
lldb_private::SyntheticChildrenFrontEnd::m_valid
bool m_valid
Definition: TypeSynthetic.h:98
lldb_private::SyntheticValueProviderFrontEnd::MightHaveChildren
bool MightHaveChildren() override
Definition: TypeSynthetic.h:121
lldb_private::ScriptedSyntheticChildren::operator=
const ScriptedSyntheticChildren & operator=(const ScriptedSyntheticChildren &)=delete
lldb_private::ValueObject::GetSyntheticExpressionPathChild
lldb::ValueObjectSP GetSyntheticExpressionPathChild(const char *expression, bool can_create)
Definition: ValueObject.cpp:1772
lldb_private::SyntheticChildren::m_my_revision
uint32_t m_my_revision
Definition: TypeSynthetic.h:269
lldb_private::SyntheticChildren::Flags::SetCascades
Flags & SetCascades(bool value=true)
Definition: TypeSynthetic.h:163
lldb_private::SyntheticChildren::Cascades
bool Cascades() const
Definition: TypeSynthetic.h:235
lldb_private::TypeFilterImpl::SetExpressionPathAtIndex
bool SetExpressionPathAtIndex(size_t i, const char *path)
Definition: TypeSynthetic.h:303
lldb_private::TypeFilterImpl::GetFrontEnd
SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend) override
Definition: TypeSynthetic.h:347