LLDB  mainline
Type.h
Go to the documentation of this file.
1 //===-- Type.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_SYMBOL_TYPE_H
10 #define LLDB_SYMBOL_TYPE_H
11 
12 #include "lldb/Core/Declaration.h"
16 #include "lldb/Utility/UserID.h"
17 #include "lldb/lldb-private.h"
18 
19 #include "llvm/ADT/APSInt.h"
20 
21 #include <set>
22 
23 namespace lldb_private {
24 
25 /// CompilerContext allows an array of these items to be passed to perform
26 /// detailed lookups in SymbolVendor and SymbolFile functions.
29 
30  bool operator==(const CompilerContext &rhs) const {
31  return kind == rhs.kind && name == rhs.name;
32  }
33  bool operator!=(const CompilerContext &rhs) const { return !(*this == rhs); }
34 
35  void Dump() const;
36 
39 };
40 
41 /// Match \p context_chain against \p pattern, which may contain "Any"
42 /// kinds. The \p context_chain should *not* contain any "Any" kinds.
43 bool contextMatches(llvm::ArrayRef<CompilerContext> context_chain,
44  llvm::ArrayRef<CompilerContext> pattern);
45 
46 class SymbolFileType : public std::enable_shared_from_this<SymbolFileType>,
47  public UserID {
48 public:
50  : UserID(uid), m_symbol_file(symbol_file) {}
51 
52  SymbolFileType(SymbolFile &symbol_file, const lldb::TypeSP &type_sp);
53 
54  ~SymbolFileType() = default;
55 
56  Type *operator->() { return GetType(); }
57 
58  Type *GetType();
59  SymbolFile &GetSymbolFile() const { return m_symbol_file; }
60 
61 protected:
63  lldb::TypeSP m_type_sp;
64 };
65 
66 class Type : public std::enable_shared_from_this<Type>, public UserID {
67 public:
69  /// Invalid encoding.
71  /// This type is the type whose UID is m_encoding_uid.
73  /// This type is the type whose UID is m_encoding_uid with the const
74  /// qualifier added.
76  /// This type is the type whose UID is m_encoding_uid with the restrict
77  /// qualifier added.
79  /// This type is the type whose UID is m_encoding_uid with the volatile
80  /// qualifier added.
82  /// This type is alias to a type whose UID is m_encoding_uid.
84  /// This type is pointer to a type whose UID is m_encoding_uid.
86  /// This type is L value reference to a type whose UID is m_encoding_uid.
88  /// This type is R value reference to a type whose UID is m_encoding_uid.
90  /// This type is the type whose UID is m_encoding_uid as an atomic type.
92  /// This type is the synthetic type whose UID is m_encoding_uid.
94  };
95 
96  enum class ResolveState : unsigned char {
97  Unresolved = 0,
98  Forward = 1,
99  Layout = 2,
100  Full = 3
101  };
102 
103  Type(lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name,
104  llvm::Optional<uint64_t> byte_size, SymbolContextScope *context,
105  lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type,
106  const Declaration &decl, const CompilerType &compiler_qual_type,
107  ResolveState compiler_type_resolve_state, uint32_t opaque_payload = 0);
108 
109  // This makes an invalid type. Used for functions that return a Type when
110  // they get an error.
111  Type();
112 
113  void Dump(Stream *s, bool show_context,
115 
116  void DumpTypeName(Stream *s);
117 
118  /// Since Type instances only keep a "SymbolFile *" internally, other classes
119  /// like TypeImpl need make sure the module is still around before playing
120  /// with
121  /// Type instances. They can store a weak pointer to the Module;
122  lldb::ModuleSP GetModule();
123 
124  /// GetModule may return module for compile unit's object file.
125  /// GetExeModule returns module for executable object file that contains
126  /// compile unit where type was actualy defined.
127  /// GetModule and GetExeModule may return the same value.
128  lldb::ModuleSP GetExeModule();
129 
130  void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name,
131  ExecutionContextScope *exe_scope);
132 
134  const SymbolFile *GetSymbolFile() const { return m_symbol_file; }
135 
137 
138  llvm::Optional<uint64_t> GetByteSize(ExecutionContextScope *exe_scope);
139 
140  uint32_t GetNumChildren(bool omit_empty_base_classes);
141 
142  bool IsAggregateType();
143 
145 
147 
148  lldb::TypeSP GetTypedefType();
149 
150  ConstString GetName() const { return m_name; }
151 
153 
154  void DumpValue(ExecutionContext *exe_ctx, Stream *s,
155  const DataExtractor &data, uint32_t data_offset,
156  bool show_type, bool show_summary, bool verbose,
158 
159  bool DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s,
160  lldb::addr_t address, AddressType address_type,
161  bool show_types, bool show_summary, bool verbose);
162 
163  bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address,
164  AddressType address_type, DataExtractor &data);
165 
166  bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address,
167  AddressType address_type, DataExtractor &data);
168 
169  bool GetIsDeclaration() const;
170 
171  void SetIsDeclaration(bool b);
172 
173  bool GetIsExternal() const;
174 
175  void SetIsExternal(bool b);
176 
178 
179  lldb::Encoding GetEncoding(uint64_t &count);
180 
184  m_context = context;
185  }
186 
188 
189  // Get the clang type, and resolve definitions for any
190  // class/struct/union/enum types completely.
192 
193  // Get the clang type, and resolve definitions enough so that the type could
194  // have layout performed. This allows ptrs and refs to
195  // class/struct/union/enum types remain forward declarations.
197 
198  // Get the clang type and leave class/struct/union/enum types as forward
199  // declarations if they haven't already been fully defined.
201 
202  static int Compare(const Type &a, const Type &b);
203 
204  // From a fully qualified typename, split the type into the type basename and
205  // the remaining type scope (namespaces/classes).
206  static bool GetTypeScopeAndBasename(llvm::StringRef name,
207  llvm::StringRef &scope,
208  llvm::StringRef &basename,
209  lldb::TypeClass &type_class);
210  void SetEncodingType(Type *encoding_type) { m_encoding_type = encoding_type; }
211 
213 
214  typedef uint32_t Payload;
215  /// Return the language-specific payload.
217  /// Return the language-specific payload.
218  void SetPayload(Payload opaque_payload) { m_payload = opaque_payload; }
219 
220 protected:
223  /// The symbol context in which this type is defined.
225  Type *m_encoding_type = nullptr;
228  uint64_t m_byte_size : 63;
229  uint64_t m_byte_size_has_value : 1;
233  /// Language-specific flags.
235 
237 
238  bool ResolveCompilerType(ResolveState compiler_type_resolve_state);
239 };
240 
241 // the two classes here are used by the public API as a backend to the SBType
242 // and SBTypeList classes
243 
244 class TypeImpl {
245 public:
246  TypeImpl() = default;
247 
248  ~TypeImpl() = default;
249 
250  TypeImpl(const lldb::TypeSP &type_sp);
251 
252  TypeImpl(const CompilerType &compiler_type);
253 
254  TypeImpl(const lldb::TypeSP &type_sp, const CompilerType &dynamic);
255 
256  TypeImpl(const CompilerType &compiler_type, const CompilerType &dynamic);
257 
258  void SetType(const lldb::TypeSP &type_sp);
259 
260  void SetType(const CompilerType &compiler_type);
261 
262  void SetType(const lldb::TypeSP &type_sp, const CompilerType &dynamic);
263 
264  void SetType(const CompilerType &compiler_type, const CompilerType &dynamic);
265 
266  bool operator==(const TypeImpl &rhs) const;
267 
268  bool operator!=(const TypeImpl &rhs) const;
269 
270  bool IsValid() const;
271 
272  explicit operator bool() const;
273 
274  void Clear();
275 
276  lldb::ModuleSP GetModule() const;
277 
278  ConstString GetName() const;
279 
281 
282  TypeImpl GetPointerType() const;
283 
284  TypeImpl GetPointeeType() const;
285 
286  TypeImpl GetReferenceType() const;
287 
288  TypeImpl GetTypedefedType() const;
289 
291 
293 
294  TypeImpl GetCanonicalType() const;
295 
296  CompilerType GetCompilerType(bool prefer_dynamic);
297 
298  TypeSystem *GetTypeSystem(bool prefer_dynamic);
299 
301  lldb::DescriptionLevel description_level);
302 
303 private:
304  bool CheckModule(lldb::ModuleSP &module_sp) const;
305  bool CheckExeModule(lldb::ModuleSP &module_sp) const;
306  bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp,
307  lldb::ModuleSP &module_sp) const;
308 
309  lldb::ModuleWP m_module_wp;
310  lldb::ModuleWP m_exe_module_wp;
313 };
314 
316 public:
318 
319  void Append(const lldb::TypeImplSP &type) { m_content.push_back(type); }
320 
322  public:
323  AppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
324 
325  void operator()(const lldb::TypeImplSP &type) { m_type_list.Append(type); }
326 
327  private:
329  };
330 
331  void Append(const lldb_private::TypeList &type_list);
332 
333  lldb::TypeImplSP GetTypeAtIndex(size_t idx) {
334  lldb::TypeImplSP type_sp;
335  if (idx < GetSize())
336  type_sp = m_content[idx];
337  return type_sp;
338  }
339 
340  size_t GetSize() { return m_content.size(); }
341 
342 private:
343  std::vector<lldb::TypeImplSP> m_content;
344 };
345 
347 public:
349 
350  TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset,
351  ConstString name, uint32_t bitfield_bit_size = 0,
352  bool is_bitfield = false)
353  : m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset), m_name(name),
354  m_bitfield_bit_size(bitfield_bit_size), m_is_bitfield(is_bitfield) {}
355 
356  TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
357  : m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset),
359  if (m_type_impl_sp)
360  m_name = m_type_impl_sp->GetName();
361  }
362 
363  const lldb::TypeImplSP &GetTypeImpl() { return m_type_impl_sp; }
364 
365  ConstString GetName() const { return m_name; }
366 
367  uint64_t GetBitOffset() const { return m_bit_offset; }
368 
370 
371  void SetBitfieldBitSize(uint32_t bitfield_bit_size) {
372  m_bitfield_bit_size = bitfield_bit_size;
373  }
374 
375  bool GetIsBitfield() const { return m_is_bitfield; }
376 
377  void SetIsBitfield(bool is_bitfield) { m_is_bitfield = is_bitfield; }
378 
379 protected:
380  lldb::TypeImplSP m_type_impl_sp;
381  uint64_t m_bit_offset = 0;
383  uint32_t m_bitfield_bit_size = 0; // Bit size for bitfield members only
384  bool m_is_bitfield = false;
385 };
386 
387 ///
388 /// Sometimes you can find the name of the type corresponding to an object, but
389 /// we don't have debug
390 /// information for it. If that is the case, you can return one of these
391 /// objects, and then if it
392 /// has a full type, you can use that, but if not at least you can print the
393 /// name for informational
394 /// purposes.
395 ///
396 
398 public:
399  TypeAndOrName() = default;
400  TypeAndOrName(lldb::TypeSP &type_sp);
401  TypeAndOrName(const CompilerType &compiler_type);
402  TypeAndOrName(const char *type_str);
403  TypeAndOrName(ConstString &type_const_string);
404 
405  bool operator==(const TypeAndOrName &other) const;
406 
407  bool operator!=(const TypeAndOrName &other) const;
408 
409  ConstString GetName() const;
410 
412 
413  void SetName(ConstString type_name);
414 
415  void SetName(const char *type_name_cstr);
416 
417  void SetTypeSP(lldb::TypeSP type_sp);
418 
419  void SetCompilerType(CompilerType compiler_type);
420 
421  bool IsEmpty() const;
422 
423  bool HasName() const;
424 
425  bool HasCompilerType() const;
426 
427  bool HasType() const { return HasCompilerType(); }
428 
429  void Clear();
430 
431  explicit operator bool() { return !IsEmpty(); }
432 
433 private:
436 };
437 
439 public:
441 
443  const std::string &name,
444  const lldb::MemberFunctionKind &kind)
445  : m_type(type), m_decl(decl), m_name(name), m_kind(kind) {}
446 
447  bool IsValid();
448 
449  ConstString GetName() const;
450 
451  ConstString GetMangledName() const;
452 
453  CompilerType GetType() const;
454 
455  CompilerType GetReturnType() const;
456 
457  size_t GetNumArguments() const;
458 
459  CompilerType GetArgumentAtIndex(size_t idx) const;
460 
462 
463  bool GetDescription(Stream &stream);
464 
465 protected:
467 
468 private:
473 };
474 
476 public:
477  TypeEnumMemberImpl() : m_name("<invalid>") {}
478 
479  TypeEnumMemberImpl(const lldb::TypeImplSP &integer_type_sp, ConstString name,
480  const llvm::APSInt &value);
481 
482  TypeEnumMemberImpl(const TypeEnumMemberImpl &rhs) = default;
483 
485 
486  bool IsValid() { return m_valid; }
487 
488  ConstString GetName() const { return m_name; }
489 
490  const lldb::TypeImplSP &GetIntegerType() const { return m_integer_type_sp; }
491 
492  uint64_t GetValueAsUnsigned() const { return m_value.getZExtValue(); }
493 
494  int64_t GetValueAsSigned() const { return m_value.getSExtValue(); }
495 
496 protected:
497  lldb::TypeImplSP m_integer_type_sp;
499  llvm::APSInt m_value;
500  bool m_valid = false;
501 };
502 
504 public:
506 
507  void Append(const lldb::TypeEnumMemberImplSP &type) {
508  m_content.push_back(type);
509  }
510 
511  void Append(const lldb_private::TypeEnumMemberListImpl &type_list);
512 
513  lldb::TypeEnumMemberImplSP GetTypeEnumMemberAtIndex(size_t idx) {
514  lldb::TypeEnumMemberImplSP enum_member;
515  if (idx < GetSize())
516  enum_member = m_content[idx];
517  return enum_member;
518  }
519 
520  size_t GetSize() { return m_content.size(); }
521 
522 private:
523  std::vector<lldb::TypeEnumMemberImplSP> m_content;
524 };
525 
526 } // namespace lldb_private
527 
528 #endif // LLDB_SYMBOL_TYPE_H
lldb_private::TypeMemberFunctionImpl::m_kind
lldb::MemberFunctionKind m_kind
Definition: Type.h:472
lldb_private::Type::GetSymbolContextScope
const SymbolContextScope * GetSymbolContextScope() const
Definition: Type.h:182
lldb_private::TypeMemberFunctionImpl::m_type
CompilerType m_type
Definition: Type.h:469
lldb_private::SymbolFile
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:45
lldb_private::TypeAndOrName::IsEmpty
bool IsEmpty() const
Definition: Type.cpp:791
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::TypeMemberImpl
Definition: Type.h:346
lldb_private::Type::EncodingDataType
EncodingDataType
Definition: Type.h:68
lldb_private::TypeEnumMemberImpl::m_value
llvm::APSInt m_value
Definition: Type.h:499
lldb_private::TypeImpl::CheckModuleCommon
bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp, lldb::ModuleSP &module_sp) const
Definition: Type.cpp:864
lldb_private::TypeImpl::GetCanonicalType
TypeImpl GetCanonicalType() const
Definition: Type.cpp:1017
lldb_private::TypeEnumMemberImpl::m_valid
bool m_valid
Definition: Type.h:500
lldb_private::TypeAndOrName::GetCompilerType
CompilerType GetCompilerType() const
Definition: Type.h:411
lldb_private::TypeEnumMemberImpl
Definition: Type.h:475
lldb_private::Type::DumpValue
void DumpValue(ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, uint32_t data_offset, bool show_type, bool show_summary, bool verbose, lldb::Format format=lldb::eFormatDefault)
Definition: Type.cpp:310
lldb_private::Type::eEncodingIsSyntheticUID
@ eEncodingIsSyntheticUID
This type is the synthetic type whose UID is m_encoding_uid.
Definition: Type.h:93
lldb_private::TypeImpl::operator==
bool operator==(const TypeImpl &rhs) const
Definition: Type.cpp:893
CompilerDecl.h
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::TypeMemberImpl::m_bit_offset
uint64_t m_bit_offset
Definition: Type.h:381
lldb_private::Type::eEncodingIsConstUID
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
Definition: Type.h:75
lldb_private::TypeAndOrName::SetName
void SetName(ConstString type_name)
Definition: Type.cpp:769
lldb_private::TypeMemberImpl::GetBitfieldBitSize
uint32_t GetBitfieldBitSize() const
Definition: Type.h:369
lldb_private::Type::GetFormat
lldb::Format GetFormat()
Definition: Type.cpp:402
lldb_private::Type::eEncodingIsTypedefUID
@ eEncodingIsTypedefUID
This type is alias to a type whose UID is m_encoding_uid.
Definition: Type.h:83
lldb_private::TypeMemberImpl::TypeMemberImpl
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
Definition: Type.h:356
lldb_private::TypeEnumMemberImpl::GetIntegerType
const lldb::TypeImplSP & GetIntegerType() const
Definition: Type.h:490
lldb_private::TypeAndOrName::HasName
bool HasName() const
Definition: Type.cpp:800
lldb_private::contextMatches
bool contextMatches(llvm::ArrayRef< CompilerContext > context_chain, llvm::ArrayRef< CompilerContext > pattern)
Match context_chain against pattern, which may contain "Any" kinds.
Definition: Type.cpp:37
lldb_private::TypeAndOrName::SetCompilerType
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:785
lldb_private::TypeImpl::CheckModule
bool CheckModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:856
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Type::GetEncodingType
Type * GetEncodingType()
Definition: Type.cpp:334
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
lldb_private::TypeEnumMemberListImpl::TypeEnumMemberListImpl
TypeEnumMemberListImpl()
Definition: Type.h:505
lldb_private::Type::GetLayoutCompilerType
CompilerType GetLayoutCompilerType()
Definition: Type.cpp:650
lldb_private::TypeMemberFunctionImpl::m_decl
CompilerDecl m_decl
Definition: Type.h:470
lldb_private::Type::m_compiler_type_resolve_state
ResolveState m_compiler_type_resolve_state
Definition: Type.h:232
lldb_private::TypeMemberImpl::GetTypeImpl
const lldb::TypeImplSP & GetTypeImpl()
Definition: Type.h:363
lldb_private::TypeImpl::GetModule
lldb::ModuleSP GetModule() const
Definition: Type.cpp:918
LLDB_INVALID_UID
#define LLDB_INVALID_UID
Definition: lldb-defines.h:80
lldb_private::TypeEnumMemberListImpl::GetTypeEnumMemberAtIndex
lldb::TypeEnumMemberImplSP GetTypeEnumMemberAtIndex(size_t idx)
Definition: Type.h:513
lldb_private::CompilerContext::name
ConstString name
Definition: Type.h:38
lldb_private::Type::SetIsDeclaration
void SetIsDeclaration(bool b)
lldb::eMemberFunctionKindUnknown
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
Definition: lldb-enumerations.h:1022
lldb_private::Type::m_payload
Payload m_payload
Language-specific flags.
Definition: Type.h:234
lldb_private::Type::GetModule
lldb::ModuleSP GetModule()
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sur...
Definition: Type.cpp:721
lldb_private::Type::SetPayload
void SetPayload(Payload opaque_payload)
Return the language-specific payload.
Definition: Type.h:218
lldb_private::Type::m_byte_size_has_value
uint64_t m_byte_size_has_value
Definition: Type.h:229
lldb_private::TypeMemberFunctionImpl::GetMangledName
ConstString GetMangledName() const
Definition: Type.cpp:1075
lldb_private::CompilerDecl
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
lldb_private::TypeImpl::GetDisplayTypeName
ConstString GetDisplayTypeName() const
Definition: Type.cpp:935
lldb_private::Type::GetName
ConstString GetName() const
Definition: Type.h:150
lldb_private::TypeMemberFunctionImpl::m_name
ConstString m_name
Definition: Type.h:471
lldb_private::Type::m_encoding_uid_type
EncodingDataType m_encoding_uid_type
Definition: Type.h:227
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Type::GetName
ConstString GetName()
Definition: Type.cpp:302
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::TypeAndOrName::Clear
void Clear()
Definition: Type.cpp:795
lldb_private::TypeListImpl::GetSize
size_t GetSize()
Definition: Type.h:340
lldb_private::Type::GetIsDeclaration
bool GetIsDeclaration() const
lldb_private::Type::Dump
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:236
lldb_private::TypeEnumMemberImpl::GetValueAsUnsigned
uint64_t GetValueAsUnsigned() const
Definition: Type.h:492
lldb_private::TypeMemberFunctionImpl::TypeMemberFunctionImpl
TypeMemberFunctionImpl()
Definition: Type.h:440
lldb_private::Type::GetEncoding
lldb::Encoding GetEncoding(uint64_t &count)
Definition: Type.cpp:404
lldb_private::Type::eEncodingIsRValueReferenceUID
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:89
lldb_private::TypeEnumMemberImpl::IsValid
bool IsValid()
Definition: Type.h:486
lldb_private::TypeListImpl::Append
void Append(const lldb::TypeImplSP &type)
Definition: Type.h:319
lldb_private::SymbolFileType
Definition: Type.h:46
lldb_private::TypeImpl::TypeImpl
TypeImpl()=default
lldb_private::Type::ResolveCompilerType
bool ResolveCompilerType(ResolveState compiler_type_resolve_state)
Definition: Type.cpp:472
lldb_private::TypeImpl::IsValid
bool IsValid() const
Definition: Type.cpp:902
lldb_private::TypeImpl::m_dynamic_type
CompilerType m_dynamic_type
Definition: Type.h:312
lldb_private::Type::Type
Type()
Definition: Type.cpp:164
lldb_private::TypeMemberFunctionImpl::GetName
ConstString GetName() const
Definition: Type.cpp:1073
lldb_private::Type::GetByteSize
llvm::Optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
Definition: Type.cpp:340
lldb_private::Type::ResolveState
ResolveState
Definition: Type.h:96
lldb_private::Type::eEncodingInvalid
@ eEncodingInvalid
Invalid encoding.
Definition: Type.h:70
lldb_private::TypeMemberFunctionImpl::GetKind
lldb::MemberFunctionKind GetKind() const
Definition: Type.cpp:1081
lldb_private::CompilerContext
CompilerContext allows an array of these items to be passed to perform detailed lookups in SymbolVend...
Definition: Type.h:27
lldb_private::Type::m_symbol_file
SymbolFile * m_symbol_file
Definition: Type.h:222
lldb_private::SymbolFileType::GetType
Type * GetType()
Definition: Type.cpp:134
lldb_private::TypeMemberImpl::TypeMemberImpl
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset, ConstString name, uint32_t bitfield_bit_size=0, bool is_bitfield=false)
Definition: Type.h:350
lldb_private::TypeAndOrName::GetName
ConstString GetName() const
Definition: Type.cpp:761
lldb_private::TypeMemberImpl::m_type_impl_sp
lldb::TypeImplSP m_type_impl_sp
Definition: Type.h:380
lldb_private::Type::eEncodingIsRestrictUID
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
Definition: Type.h:78
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::Type::ResolveState::Unresolved
@ Unresolved
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::TypeMemberFunctionImpl::GetType
CompilerType GetType() const
Definition: Type.cpp:1079
lldb_private::CompilerContext::Dump
void Dump() const
Definition: Type.cpp:66
lldb_private::TypeMemberImpl::SetBitfieldBitSize
void SetBitfieldBitSize(uint32_t bitfield_bit_size)
Definition: Type.h:371
lldb_private::SymbolFileType::m_type_sp
lldb::TypeSP m_type_sp
Definition: Type.h:63
lldb_private::TypeAndOrName::HasCompilerType
bool HasCompilerType() const
Definition: Type.cpp:802
lldb_private::Type::eEncodingIsVolatileUID
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
Definition: Type.h:81
lldb_private::CompilerContext::operator==
bool operator==(const CompilerContext &rhs) const
Definition: Type.h:30
lldb_private::Type::GetTypedefType
lldb::TypeSP GetTypedefType()
Definition: Type.cpp:392
Declaration.h
lldb_private::TypeMemberFunctionImpl::GetPrintableTypeName
std::string GetPrintableTypeName()
lldb_private::Type::IsValidType
bool IsValidType()
Definition: Type.h:144
lldb_private::Type::GetPayload
Payload GetPayload()
Return the language-specific payload.
Definition: Type.h:216
lldb_private::TypeEnumMemberImpl::GetValueAsSigned
int64_t GetValueAsSigned() const
Definition: Type.h:494
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Type::DumpTypeName
void DumpTypeName(Stream *s)
Definition: Type.cpp:308
lldb_private::SymbolFileType::operator->
Type * operator->()
Definition: Type.h:56
lldb_private::Type::GetExeModule
lldb::ModuleSP GetExeModule()
GetModule may return module for compile unit's object file.
Definition: Type.cpp:727
lldb::eDescriptionLevelFull
@ eDescriptionLevelFull
Definition: lldb-enumerations.h:209
lldb_private::Type::GetDeclaration
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:470
lldb_private::Type::GetSymbolFile
SymbolFile * GetSymbolFile()
Definition: Type.h:133
lldb_private::CompilerContext::operator!=
bool operator!=(const CompilerContext &rhs) const
Definition: Type.h:33
lldb_private::Type::SetSymbolContextScope
void SetSymbolContextScope(SymbolContextScope *context)
Definition: Type.h:183
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::TypeImpl::GetPointeeType
TypeImpl GetPointeeType() const
Definition: Type.cpp:957
lldb_private::TypeImpl::GetDereferencedType
TypeImpl GetDereferencedType() const
Definition: Type.cpp:993
lldb_private::Type::WriteToMemory
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:465
lldb_private::TypeMemberImpl::TypeMemberImpl
TypeMemberImpl()
Definition: Type.h:348
lldb_private::TypeListImpl::AppendVisitor::m_type_list
TypeListImpl & m_type_list
Definition: Type.h:328
CompilerType.h
lldb_private::Type::ResolveState::Full
@ Full
lldb_private::TypeListImpl::AppendVisitor::operator()
void operator()(const lldb::TypeImplSP &type)
Definition: Type.h:325
UserID.h
lldb_private::Type::GetSymbolFile
const SymbolFile * GetSymbolFile() const
Definition: Type.h:134
lldb_private::Type::m_context
SymbolContextScope * m_context
The symbol context in which this type is defined.
Definition: Type.h:224
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
lldb_private::TypeMemberImpl::GetName
ConstString GetName() const
Definition: Type.h:365
lldb_private::Type::m_encoding_type
Type * m_encoding_type
Definition: Type.h:225
lldb_private::TypeImpl::GetName
ConstString GetName() const
Definition: Type.cpp:925
lldb-private.h
lldb_private::SymbolFileType::GetSymbolFile
SymbolFile & GetSymbolFile() const
Definition: Type.h:59
lldb_private::Type::GetEncodingMask
uint32_t GetEncodingMask()
Definition: Type.cpp:636
lldb_private::Type::eEncodingIsPointerUID
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:85
lldb_private::Type::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:171
lldb_private::TypeEnumMemberListImpl::m_content
std::vector< lldb::TypeEnumMemberImplSP > m_content
Definition: Type.h:523
lldb_private::TypeMemberImpl::m_bitfield_bit_size
uint32_t m_bitfield_bit_size
Definition: Type.h:383
lldb_private::TypeListImpl::AppendVisitor
Definition: Type.h:321
lldb_private::CompilerContextKind
CompilerContextKind
Definition: lldb-private-enumerations.h:195
lldb_private::Type::m_encoding_uid
lldb::user_id_t m_encoding_uid
Definition: Type.h:226
lldb_private::Type::GetIsExternal
bool GetIsExternal() const
lldb_private::Type::SetIsExternal
void SetIsExternal(bool b)
lldb_private::TypeMemberImpl::GetIsBitfield
bool GetIsBitfield() const
Definition: Type.h:375
lldb_private::TypeEnumMemberImpl::m_integer_type_sp
lldb::TypeImplSP m_integer_type_sp
Definition: Type.h:497
lldb_private::Type::IsAggregateType
bool IsAggregateType()
Definition: Type.cpp:388
lldb_private::TypeImpl::GetUnqualifiedType
TypeImpl GetUnqualifiedType() const
Definition: Type.cpp:1005
lldb_private::TypeEnumMemberImpl::m_name
ConstString m_name
Definition: Type.h:498
lldb_private::Type::GetQualifiedName
ConstString GetQualifiedName()
Definition: Type.cpp:660
lldb_private::Type::ResolveState::Layout
@ Layout
lldb_private::TypeEnumMemberListImpl
Definition: Type.h:503
uint32_t
lldb_private::Type::Payload
uint32_t Payload
Definition: Type.h:214
lldb_private::Type::eEncodingIsLValueReferenceUID
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:87
lldb_private::TypeMemberFunctionImpl::GetArgumentAtIndex
CompilerType GetArgumentAtIndex(size_t idx) const
Definition: Type.cpp:1122
lldb_private::TypeMemberFunctionImpl::GetReturnType
CompilerType GetReturnType() const
Definition: Type.cpp:1109
lldb_private::Type::IsTypedef
bool IsTypedef()
Definition: Type.h:146
lldb_private::TypeImpl::SetType
void SetType(const lldb::TypeSP &type_sp)
Definition: Type.cpp:827
lldb_private::Type::Compare
static int Compare(const Type &a, const Type &b)
lldb_private::TypeAndOrName::SetTypeSP
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:777
lldb_private::TypeImpl::GetDescription
bool GetDescription(lldb_private::Stream &strm, lldb::DescriptionLevel description_level)
Definition: Type.cpp:1053
lldb_private::Type::ReadFromMemory
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:427
lldb_private::Type::SetEncodingType
void SetEncodingType(Type *encoding_type)
Definition: Type.h:210
lldb_private::TypeImpl::m_exe_module_wp
lldb::ModuleWP m_exe_module_wp
Definition: Type.h:310
lldb_private::Type::DumpValueInMemory
bool DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s, lldb::addr_t address, AddressType address_type, bool show_types, bool show_summary, bool verbose)
Definition: Type.cpp:409
lldb_private::Type
Definition: Type.h:66
lldb_private::TypeAndOrName::operator!=
bool operator!=(const TypeAndOrName &other) const
Definition: Type.cpp:757
lldb_private::TypeImpl::GetCompilerType
CompilerType GetCompilerType(bool prefer_dynamic)
Definition: Type.cpp:1029
lldb_private::Type::GetForwardCompilerType
CompilerType GetForwardCompilerType()
Definition: Type.cpp:655
lldb_private::TypeListImpl::TypeListImpl
TypeListImpl()
Definition: Type.h:317
lldb_private::TypeListImpl::m_content
std::vector< lldb::TypeImplSP > m_content
Definition: Type.h:343
lldb_private::TypeAndOrName::operator==
bool operator==(const TypeAndOrName &other) const
Definition: Type.cpp:749
lldb_private::TypeImpl::Clear
void Clear()
Definition: Type.cpp:912
lldb_private::SymbolFileType::SymbolFileType
SymbolFileType(SymbolFile &symbol_file, lldb::user_id_t uid)
Definition: Type.h:49
lldb_private::TypeImpl::GetTypeSystem
TypeSystem * GetTypeSystem(bool prefer_dynamic)
Definition: Type.cpp:1041
lldb::Encoding
Encoding
Register encoding definitions.
Definition: lldb-enumerations.h:146
lldb_private::TypeImpl::~TypeImpl
~TypeImpl()=default
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::TypeMemberFunctionImpl::GetNumArguments
size_t GetNumArguments() const
Definition: Type.cpp:1115
lldb_private::TypeMemberImpl::m_name
ConstString m_name
Definition: Type.h:382
lldb_private::Type::m_decl
Declaration m_decl
Definition: Type.h:230
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::TypeListImpl::AppendVisitor::AppendVisitor
AppendVisitor(TypeListImpl &type_list)
Definition: Type.h:323
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Type::ResolveState::Forward
@ Forward
lldb_private::TypeImpl
Definition: Type.h:244
lldb_private::CompilerContext::kind
CompilerContextKind kind
Definition: Type.h:37
lldb_private::TypeImpl::GetPointerType
TypeImpl GetPointerType() const
Definition: Type.cpp:945
lldb_private::TypeAndOrName::HasType
bool HasType() const
Definition: Type.h:427
lldb_private::TypeSystem
Interface for representing a type system.
Definition: TypeSystem.h:71
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::TypeImpl::GetTypedefedType
TypeImpl GetTypedefedType() const
Definition: Type.cpp:981
ConstString.h
lldb_private::TypeAndOrName::TypeAndOrName
TypeAndOrName()=default
lldb::MemberFunctionKind
MemberFunctionKind
Kind of member function.
Definition: lldb-enumerations.h:1021
lldb_private::TypeEnumMemberImpl::operator=
TypeEnumMemberImpl & operator=(const TypeEnumMemberImpl &rhs)
lldb_private::TypeEnumMemberListImpl::Append
void Append(const lldb::TypeEnumMemberImplSP &type)
Definition: Type.h:507
lldb_private::TypeEnumMemberListImpl::GetSize
size_t GetSize()
Definition: Type.h:520
lldb_private::TypeMemberImpl::m_is_bitfield
bool m_is_bitfield
Definition: Type.h:384
lldb_private::TypeImpl::GetReferenceType
TypeImpl GetReferenceType() const
Definition: Type.cpp:969
lldb_private::SymbolFileType::m_symbol_file
SymbolFile & m_symbol_file
Definition: Type.h:62
lldb_private::TypeImpl::m_module_wp
lldb::ModuleWP m_module_wp
Definition: Type.h:309
lldb_private::Type::m_name
ConstString m_name
Definition: Type.h:221
lldb_private::TypeMemberFunctionImpl::IsValid
bool IsValid()
Definition: Type.cpp:1069
lldb_private::Type::eEncodingIsAtomicUID
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
Definition: Type.h:91
lldb_private::TypeListImpl::GetTypeAtIndex
lldb::TypeImplSP GetTypeAtIndex(size_t idx)
Definition: Type.h:333
lldb_private::TypeMemberImpl::GetBitOffset
uint64_t GetBitOffset() const
Definition: Type.h:367
lldb_private::TypeAndOrName
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:397
lldb_private::TypeMemberFunctionImpl
Definition: Type.h:438
lldb_private::TypeMemberFunctionImpl::TypeMemberFunctionImpl
TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl, const std::string &name, const lldb::MemberFunctionKind &kind)
Definition: Type.h:442
lldb_private::TypeImpl::CheckExeModule
bool CheckExeModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:860
lldb_private::SymbolFileType::~SymbolFileType
~SymbolFileType()=default
lldb_private::TypeMemberImpl::SetIsBitfield
void SetIsBitfield(bool is_bitfield)
Definition: Type.h:377
lldb_private::TypeAndOrName::m_type_name
ConstString m_type_name
Definition: Type.h:435
lldb_private::TypeMemberFunctionImpl::GetDescription
bool GetDescription(Stream &stream)
Definition: Type.cpp:1085
lldb_private::Declaration
Definition: Declaration.h:24
lldb_private::Type::m_byte_size
uint64_t m_byte_size
Definition: Type.h:228
lldb_private::Type::GetSymbolContextScope
SymbolContextScope * GetSymbolContextScope()
Definition: Type.h:181
lldb_private::TypeImpl::operator!=
bool operator!=(const TypeImpl &rhs) const
Definition: Type.cpp:898
lldb_private::Type::m_compiler_type
CompilerType m_compiler_type
Definition: Type.h:231
lldb_private::Type::GetFullCompilerType
CompilerType GetFullCompilerType()
Definition: Type.cpp:645
lldb_private::CompilerContext::CompilerContext
CompilerContext(CompilerContextKind t, ConstString n)
Definition: Type.h:28
lldb_private::TypeEnumMemberImpl::TypeEnumMemberImpl
TypeEnumMemberImpl()
Definition: Type.h:477
lldb::eFormatDefault
@ eFormatDefault
Definition: lldb-enumerations.h:156
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Type::eEncodingIsUID
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
Definition: Type.h:72
lldb_private::TypeAndOrName::m_compiler_type
CompilerType m_compiler_type
Definition: Type.h:434
lldb_private::TypeListImpl
Definition: Type.h:315
lldb_private::TypeImpl::m_static_type
CompilerType m_static_type
Definition: Type.h:311
lldb_private::TypeEnumMemberImpl::GetName
ConstString GetName() const
Definition: Type.h:488
lldb_private::Type::GetNumChildren
uint32_t GetNumChildren(bool omit_empty_base_classes)
Definition: Type.cpp:384
lldb_private::Type::GetTypeScopeAndBasename
static bool GetTypeScopeAndBasename(llvm::StringRef name, llvm::StringRef &scope, llvm::StringRef &basename, lldb::TypeClass &type_class)
Definition: Type.cpp:664