LLDB  mainline
SBType.cpp
Go to the documentation of this file.
1 //===-- SBType.cpp --------------------------------------------------------===//
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 #include "lldb/API/SBType.h"
10 #include "SBReproducerPrivate.h"
11 #include "lldb/API/SBDefines.h"
12 #include "lldb/API/SBModule.h"
13 #include "lldb/API/SBStream.h"
15 #include "lldb/Core/Mangled.h"
17 #include "lldb/Symbol/Type.h"
18 #include "lldb/Symbol/TypeSystem.h"
20 #include "lldb/Utility/Stream.h"
21 
22 #include "llvm/ADT/APSInt.h"
23 
24 #include <memory>
25 
26 using namespace lldb;
27 using namespace lldb_private;
28 
30 
32  : m_opaque_sp(new TypeImpl(
33  CompilerType(type.GetTypeSystem(), type.GetOpaqueQualType()))) {}
34 
35 SBType::SBType(const lldb::TypeSP &type_sp)
36  : m_opaque_sp(new TypeImpl(type_sp)) {}
37 
38 SBType::SBType(const lldb::TypeImplSP &type_impl_sp)
39  : m_opaque_sp(type_impl_sp) {}
40 
41 SBType::SBType(const SBType &rhs) : m_opaque_sp() {
43 
44  if (this != &rhs) {
46  }
47 }
48 
49 // SBType::SBType (TypeImpl* impl) :
50 // m_opaque_up(impl)
51 //{}
52 //
54  LLDB_RECORD_METHOD(bool, SBType, operator==,(lldb::SBType &), rhs);
55 
56  if (!IsValid())
57  return !rhs.IsValid();
58 
59  if (!rhs.IsValid())
60  return false;
61 
62  return *m_opaque_sp.get() == *rhs.m_opaque_sp.get();
63 }
64 
66  LLDB_RECORD_METHOD(bool, SBType, operator!=,(lldb::SBType &), rhs);
67 
68  if (!IsValid())
69  return rhs.IsValid();
70 
71  if (!rhs.IsValid())
72  return true;
73 
74  return *m_opaque_sp.get() != *rhs.m_opaque_sp.get();
75 }
76 
77 lldb::TypeImplSP SBType::GetSP() { return m_opaque_sp; }
78 
79 void SBType::SetSP(const lldb::TypeImplSP &type_impl_sp) {
80  m_opaque_sp = type_impl_sp;
81 }
82 
84  LLDB_RECORD_METHOD(lldb::SBType &, SBType, operator=,(const lldb::SBType &),
85  rhs);
86 
87  if (this != &rhs) {
89  }
90  return LLDB_RECORD_RESULT(*this);
91 }
92 
93 SBType::~SBType() = default;
94 
96  if (m_opaque_sp.get() == nullptr)
97  m_opaque_sp = std::make_shared<TypeImpl>();
98  return *m_opaque_sp;
99 }
100 
101 const TypeImpl &SBType::ref() const {
102  // "const SBAddress &addr" should already have checked "addr.IsValid()" prior
103  // to calling this function. In case you didn't we will assert and die to let
104  // you know.
105  assert(m_opaque_sp.get());
106  return *m_opaque_sp;
107 }
108 
109 bool SBType::IsValid() const {
111  return this->operator bool();
112 }
113 SBType::operator bool() const {
114  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBType, operator bool);
115 
116  if (m_opaque_sp.get() == nullptr)
117  return false;
118 
119  return m_opaque_sp->IsValid();
120 }
121 
124 
125  if (IsValid())
126  if (llvm::Optional<uint64_t> size =
127  m_opaque_sp->GetCompilerType(false).GetByteSize(nullptr))
128  return *size;
129  return 0;
130 }
131 
134 
135  if (!IsValid())
136  return false;
137  return m_opaque_sp->GetCompilerType(true).IsPointerType();
138 }
139 
142 
143  if (!IsValid())
144  return false;
145  return m_opaque_sp->GetCompilerType(true).IsArrayType(nullptr, nullptr,
146  nullptr);
147 }
148 
151 
152  if (!IsValid())
153  return false;
154  return m_opaque_sp->GetCompilerType(true).IsVectorType(nullptr, nullptr);
155 }
156 
159 
160  if (!IsValid())
161  return false;
162  return m_opaque_sp->GetCompilerType(true).IsReferenceType();
163 }
164 
167 
168  if (!IsValid())
169  return LLDB_RECORD_RESULT(SBType());
170 
171  return LLDB_RECORD_RESULT(
172  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointerType()))));
173 }
174 
177 
178  if (!IsValid())
179  return LLDB_RECORD_RESULT(SBType());
180  return LLDB_RECORD_RESULT(
181  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointeeType()))));
182 }
183 
186 
187  if (!IsValid())
188  return LLDB_RECORD_RESULT(SBType());
189  return LLDB_RECORD_RESULT(
190  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetReferenceType()))));
191 }
192 
195 
196  if (!IsValid())
197  return LLDB_RECORD_RESULT(SBType());
198  return LLDB_RECORD_RESULT(
199  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetTypedefedType()))));
200 }
201 
204 
205  if (!IsValid())
206  return LLDB_RECORD_RESULT(SBType());
207  return LLDB_RECORD_RESULT(
208  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetDereferencedType()))));
209 }
210 
213 
214  if (!IsValid())
215  return LLDB_RECORD_RESULT(SBType());
216  return LLDB_RECORD_RESULT(SBType(TypeImplSP(new TypeImpl(
217  m_opaque_sp->GetCompilerType(true).GetArrayElementType(nullptr)))));
218 }
219 
220 SBType SBType::GetArrayType(uint64_t size) {
221  LLDB_RECORD_METHOD(lldb::SBType, SBType, GetArrayType, (uint64_t), size);
222 
223  if (!IsValid())
224  return LLDB_RECORD_RESULT(SBType());
225  return LLDB_RECORD_RESULT(SBType(TypeImplSP(
226  new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayType(size)))));
227 }
228 
231 
232  SBType type_sb;
233  if (IsValid()) {
234  CompilerType vector_element_type;
235  if (m_opaque_sp->GetCompilerType(true).IsVectorType(&vector_element_type,
236  nullptr))
237  type_sb.SetSP(TypeImplSP(new TypeImpl(vector_element_type)));
238  }
239  return LLDB_RECORD_RESULT(type_sb);
240 }
241 
244 
245  if (!IsValid())
246  return false;
247  return m_opaque_sp->GetCompilerType(true).IsFunctionType();
248 }
249 
252 
253  if (!IsValid())
254  return false;
255  return m_opaque_sp->GetCompilerType(true).IsPolymorphicClass();
256 }
257 
260 
261  if (!IsValid())
262  return false;
263  return m_opaque_sp->GetCompilerType(true).IsTypedefType();
264 }
265 
268 
269  if (!IsValid())
270  return false;
271  return m_opaque_sp->GetCompilerType(true).IsAnonymousType();
272 }
273 
276 
277  if (!IsValid())
278  return false;
279  return m_opaque_sp->GetCompilerType(true).IsScopedEnumerationType();
280 }
281 
284 
285  if (IsValid()) {
286  CompilerType return_type(
287  m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
288  if (return_type.IsValid())
289  return LLDB_RECORD_RESULT(SBType(return_type));
290  }
292 }
293 
297 
298  SBTypeList sb_type_list;
299  if (IsValid()) {
300  CompilerType func_type(m_opaque_sp->GetCompilerType(true));
301  size_t count = func_type.GetNumberOfFunctionArguments();
302  for (size_t i = 0; i < count; i++) {
303  sb_type_list.Append(SBType(func_type.GetFunctionArgumentAtIndex(i)));
304  }
305  }
306  return LLDB_RECORD_RESULT(sb_type_list);
307 }
308 
311 
312  if (IsValid()) {
313  return m_opaque_sp->GetCompilerType(true).GetNumMemberFunctions();
314  }
315  return 0;
316 }
317 
321 
322  SBTypeMemberFunction sb_func_type;
323  if (IsValid())
324  sb_func_type.reset(new TypeMemberFunctionImpl(
325  m_opaque_sp->GetCompilerType(true).GetMemberFunctionAtIndex(idx)));
326  return LLDB_RECORD_RESULT(sb_func_type);
327 }
328 
331 
332  if (!IsValid())
333  return LLDB_RECORD_RESULT(SBType());
334  return LLDB_RECORD_RESULT(
335  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetUnqualifiedType()))));
336 }
337 
340 
341  if (IsValid())
342  return LLDB_RECORD_RESULT(
343  SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCanonicalType()))));
344  return LLDB_RECORD_RESULT(SBType());
345 }
346 
349 
350  if (IsValid()) {
351  return LLDB_RECORD_RESULT(
352  SBType(m_opaque_sp->GetCompilerType(true).GetEnumerationIntegerType()));
353  }
354  return LLDB_RECORD_RESULT(SBType());
355 }
356 
359 
360  if (IsValid())
361  return m_opaque_sp->GetCompilerType(false).GetBasicTypeEnumeration();
362  return eBasicTypeInvalid;
363 }
364 
367  basic_type);
368 
369  if (IsValid() && m_opaque_sp->IsValid())
370  return LLDB_RECORD_RESULT(SBType(
371  m_opaque_sp->GetTypeSystem(false)->GetBasicTypeFromAST(basic_type)));
372  return LLDB_RECORD_RESULT(SBType());
373 }
374 
377 
378  if (IsValid())
379  return m_opaque_sp->GetCompilerType(true).GetNumDirectBaseClasses();
380  return 0;
381 }
382 
385 
386  if (IsValid())
387  return m_opaque_sp->GetCompilerType(true).GetNumVirtualBaseClasses();
388  return 0;
389 }
390 
393 
394  if (IsValid())
395  return m_opaque_sp->GetCompilerType(true).GetNumFields();
396  return 0;
397 }
398 
400  lldb::DescriptionLevel description_level) {
402  (lldb::SBStream &, lldb::DescriptionLevel), description,
403  description_level);
404 
405  Stream &strm = description.ref();
406 
407  if (m_opaque_sp) {
408  m_opaque_sp->GetDescription(strm, description_level);
409  } else
410  strm.PutCString("No value");
411 
412  return true;
413 }
414 
417  (uint32_t), idx);
418 
419  SBTypeMember sb_type_member;
420  if (IsValid()) {
421  uint32_t bit_offset = 0;
422  CompilerType base_class_type =
423  m_opaque_sp->GetCompilerType(true).GetDirectBaseClassAtIndex(
424  idx, &bit_offset);
425  if (base_class_type.IsValid())
426  sb_type_member.reset(new TypeMemberImpl(
427  TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
428  }
429  return LLDB_RECORD_RESULT(sb_type_member);
430 }
431 
434  (uint32_t), idx);
435 
436  SBTypeMember sb_type_member;
437  if (IsValid()) {
438  uint32_t bit_offset = 0;
439  CompilerType base_class_type =
440  m_opaque_sp->GetCompilerType(true).GetVirtualBaseClassAtIndex(
441  idx, &bit_offset);
442  if (base_class_type.IsValid())
443  sb_type_member.reset(new TypeMemberImpl(
444  TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
445  }
446  return LLDB_RECORD_RESULT(sb_type_member);
447 }
448 
452 
453  SBTypeEnumMemberList sb_enum_member_list;
454  if (IsValid()) {
455  CompilerType this_type(m_opaque_sp->GetCompilerType(true));
456  if (this_type.IsValid()) {
457  this_type.ForEachEnumerator([&sb_enum_member_list](
458  const CompilerType &integer_type,
459  ConstString name,
460  const llvm::APSInt &value) -> bool {
461  SBTypeEnumMember enum_member(
462  lldb::TypeEnumMemberImplSP(new TypeEnumMemberImpl(
463  lldb::TypeImplSP(new TypeImpl(integer_type)), name, value)));
464  sb_enum_member_list.Append(enum_member);
465  return true; // Keep iterating
466  });
467  }
468  }
469  return LLDB_RECORD_RESULT(sb_enum_member_list);
470 }
471 
474  idx);
475 
476  SBTypeMember sb_type_member;
477  if (IsValid()) {
478  CompilerType this_type(m_opaque_sp->GetCompilerType(false));
479  if (this_type.IsValid()) {
480  uint64_t bit_offset = 0;
481  uint32_t bitfield_bit_size = 0;
482  bool is_bitfield = false;
483  std::string name_sstr;
484  CompilerType field_type(this_type.GetFieldAtIndex(
485  idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
486  if (field_type.IsValid()) {
487  ConstString name;
488  if (!name_sstr.empty())
489  name.SetCString(name_sstr.c_str());
490  sb_type_member.reset(
491  new TypeMemberImpl(TypeImplSP(new TypeImpl(field_type)), bit_offset,
492  name, bitfield_bit_size, is_bitfield));
493  }
494  }
495  }
496  return LLDB_RECORD_RESULT(sb_type_member);
497 }
498 
501 
502  if (!IsValid())
503  return false;
504  return m_opaque_sp->GetCompilerType(false).IsCompleteType();
505 }
506 
509 
510  if (!IsValid())
511  return 0;
512  return m_opaque_sp->GetCompilerType(true).GetTypeInfo();
513 }
514 
517 
518  lldb::SBModule sb_module;
519  if (!IsValid())
520  return LLDB_RECORD_RESULT(sb_module);
521 
522  sb_module.SetSP(m_opaque_sp->GetModule());
523  return LLDB_RECORD_RESULT(sb_module);
524 }
525 
526 const char *SBType::GetName() {
527  LLDB_RECORD_METHOD_NO_ARGS(const char *, SBType, GetName);
528 
529  if (!IsValid())
530  return "";
531  return m_opaque_sp->GetName().GetCString();
532 }
533 
536 
537  if (!IsValid())
538  return "";
539  return m_opaque_sp->GetDisplayTypeName().GetCString();
540 }
541 
542 lldb::TypeClass SBType::GetTypeClass() {
544 
545  if (IsValid())
546  return m_opaque_sp->GetCompilerType(true).GetTypeClass();
547  return lldb::eTypeClassInvalid;
548 }
549 
552 
553  if (IsValid())
554  return m_opaque_sp->GetCompilerType(false).GetNumTemplateArguments();
555  return 0;
556 }
557 
560  idx);
561 
562  if (!IsValid())
563  return LLDB_RECORD_RESULT(SBType());
564 
565  CompilerType type;
566  switch(GetTemplateArgumentKind(idx)) {
568  type = m_opaque_sp->GetCompilerType(false).GetTypeTemplateArgument(idx);
569  break;
571  type = m_opaque_sp->GetCompilerType(false)
572  .GetIntegralTemplateArgument(idx)
573  ->type;
574  break;
575  default:
576  break;
577  }
578  if (type.IsValid())
579  return LLDB_RECORD_RESULT(SBType(type));
580  return LLDB_RECORD_RESULT(SBType());
581 }
582 
586 
587  if (IsValid())
588  return m_opaque_sp->GetCompilerType(false).GetTemplateArgumentKind(idx);
590 }
591 
592 SBTypeList::SBTypeList() : m_opaque_up(new TypeListImpl()) {
594 }
595 
597  : m_opaque_up(new TypeListImpl()) {
599 
600  for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
601  i < rhs_size; i++)
602  Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
603 }
604 
607  return this->operator bool();
608 }
609 SBTypeList::operator bool() const {
610  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeList, operator bool);
611 
612  return (m_opaque_up != nullptr);
613 }
614 
617  SBTypeList, operator=,(const lldb::SBTypeList &), rhs);
618 
619  if (this != &rhs) {
620  m_opaque_up = std::make_unique<TypeListImpl>();
621  for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
622  i < rhs_size; i++)
623  Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
624  }
625  return LLDB_RECORD_RESULT(*this);
626 }
627 
630 
631  if (type.IsValid())
632  m_opaque_up->Append(type.m_opaque_sp);
633 }
634 
637  index);
638 
639  if (m_opaque_up)
640  return LLDB_RECORD_RESULT(SBType(m_opaque_up->GetTypeAtIndex(index)));
641  return LLDB_RECORD_RESULT(SBType());
642 }
643 
646 
647  return m_opaque_up->GetSize();
648 }
649 
650 SBTypeList::~SBTypeList() = default;
651 
652 SBTypeMember::SBTypeMember() : m_opaque_up() {
654 }
655 
656 SBTypeMember::~SBTypeMember() = default;
657 
658 SBTypeMember::SBTypeMember(const SBTypeMember &rhs) : m_opaque_up() {
660 
661  if (this != &rhs) {
662  if (rhs.IsValid())
663  m_opaque_up = std::make_unique<TypeMemberImpl>(rhs.ref());
664  }
665 }
666 
669  SBTypeMember, operator=,(const lldb::SBTypeMember &), rhs);
670 
671  if (this != &rhs) {
672  if (rhs.IsValid())
673  m_opaque_up = std::make_unique<TypeMemberImpl>(rhs.ref());
674  }
675  return LLDB_RECORD_RESULT(*this);
676 }
677 
678 bool SBTypeMember::IsValid() const {
680  return this->operator bool();
681 }
682 SBTypeMember::operator bool() const {
683  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeMember, operator bool);
684 
685  return m_opaque_up.get();
686 }
687 
688 const char *SBTypeMember::GetName() {
690 
691  if (m_opaque_up)
692  return m_opaque_up->GetName().GetCString();
693  return nullptr;
694 }
695 
698 
699  SBType sb_type;
700  if (m_opaque_up) {
701  sb_type.SetSP(m_opaque_up->GetTypeImpl());
702  }
703  return LLDB_RECORD_RESULT(sb_type);
704 }
705 
708 
709  if (m_opaque_up)
710  return m_opaque_up->GetBitOffset() / 8u;
711  return 0;
712 }
713 
716 
717  if (m_opaque_up)
718  return m_opaque_up->GetBitOffset();
719  return 0;
720 }
721 
724 
725  if (m_opaque_up)
726  return m_opaque_up->GetIsBitfield();
727  return false;
728 }
729 
732 
733  if (m_opaque_up)
734  return m_opaque_up->GetBitfieldBitSize();
735  return 0;
736 }
737 
739  lldb::DescriptionLevel description_level) {
741  (lldb::SBStream &, lldb::DescriptionLevel), description,
742  description_level);
743 
744  Stream &strm = description.ref();
745 
746  if (m_opaque_up) {
747  const uint32_t bit_offset = m_opaque_up->GetBitOffset();
748  const uint32_t byte_offset = bit_offset / 8u;
749  const uint32_t byte_bit_offset = bit_offset % 8u;
750  const char *name = m_opaque_up->GetName().GetCString();
751  if (byte_bit_offset)
752  strm.Printf("+%u + %u bits: (", byte_offset, byte_bit_offset);
753  else
754  strm.Printf("+%u: (", byte_offset);
755 
756  TypeImplSP type_impl_sp(m_opaque_up->GetTypeImpl());
757  if (type_impl_sp)
758  type_impl_sp->GetDescription(strm, description_level);
759 
760  strm.Printf(") %s", name);
761  if (m_opaque_up->GetIsBitfield()) {
762  const uint32_t bitfield_bit_size = m_opaque_up->GetBitfieldBitSize();
763  strm.Printf(" : %u", bitfield_bit_size);
764  }
765  } else {
766  strm.PutCString("No value");
767  }
768  return true;
769 }
770 
771 void SBTypeMember::reset(TypeMemberImpl *type_member_impl) {
772  m_opaque_up.reset(type_member_impl);
773 }
774 
776  if (m_opaque_up == nullptr)
777  m_opaque_up = std::make_unique<TypeMemberImpl>();
778  return *m_opaque_up;
779 }
780 
781 const TypeMemberImpl &SBTypeMember::ref() const { return *m_opaque_up; }
782 
785 }
786 
788 
790  : m_opaque_sp(rhs.m_opaque_sp) {
792  (const lldb::SBTypeMemberFunction &), rhs);
793 }
794 
800  rhs);
801 
802  if (this != &rhs)
803  m_opaque_sp = rhs.m_opaque_sp;
804  return LLDB_RECORD_RESULT(*this);
805 }
806 
809  return this->operator bool();
810 }
811 SBTypeMemberFunction::operator bool() const {
813 
814  return m_opaque_sp.get();
815 }
816 
819 
820  if (m_opaque_sp)
821  return m_opaque_sp->GetName().GetCString();
822  return nullptr;
823 }
824 
828 
829  if (m_opaque_sp) {
830  ConstString mangled_str = m_opaque_sp->GetMangledName();
831  if (mangled_str) {
832  Mangled mangled(mangled_str);
833  return mangled.GetDemangledName().GetCString();
834  }
835  }
836  return nullptr;
837 }
838 
842 
843  if (m_opaque_sp)
844  return m_opaque_sp->GetMangledName().GetCString();
845  return nullptr;
846 }
847 
850 
851  SBType sb_type;
852  if (m_opaque_sp) {
853  sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetType())));
854  }
855  return LLDB_RECORD_RESULT(sb_type);
856 }
857 
860 
861  SBType sb_type;
862  if (m_opaque_sp) {
863  sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetReturnType())));
864  }
865  return LLDB_RECORD_RESULT(sb_type);
866 }
867 
871 
872  if (m_opaque_sp)
873  return m_opaque_sp->GetNumArguments();
874  return 0;
875 }
876 
879  (uint32_t), i);
880 
881  SBType sb_type;
882  if (m_opaque_sp) {
883  sb_type.SetSP(
884  lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetArgumentAtIndex(i))));
885  }
886  return LLDB_RECORD_RESULT(sb_type);
887 }
888 
891  GetKind);
892 
893  if (m_opaque_sp)
894  return m_opaque_sp->GetKind();
896 }
897 
899  lldb::SBStream &description, lldb::DescriptionLevel description_level) {
901  (lldb::SBStream &, lldb::DescriptionLevel), description,
902  description_level);
903 
904  Stream &strm = description.ref();
905 
906  if (m_opaque_sp)
907  return m_opaque_sp->GetDescription(strm);
908 
909  return false;
910 }
911 
913  m_opaque_sp.reset(type_member_impl);
914 }
915 
917  if (!m_opaque_sp)
918  m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
919  return *m_opaque_sp.get();
920 }
921 
923  return *m_opaque_sp.get();
924 }
925 
926 namespace lldb_private {
927 namespace repro {
928 
929 template <>
933  LLDB_REGISTER_METHOD(bool, SBType, operator==,(lldb::SBType &));
934  LLDB_REGISTER_METHOD(bool, SBType, operator!=,(lldb::SBType &));
936  SBType, operator=,(const lldb::SBType &));
937  LLDB_REGISTER_METHOD_CONST(bool, SBType, IsValid, ());
938  LLDB_REGISTER_METHOD_CONST(bool, SBType, operator bool, ());
939  LLDB_REGISTER_METHOD(uint64_t, SBType, GetByteSize, ());
940  LLDB_REGISTER_METHOD(bool, SBType, IsPointerType, ());
941  LLDB_REGISTER_METHOD(bool, SBType, IsArrayType, ());
942  LLDB_REGISTER_METHOD(bool, SBType, IsVectorType, ());
943  LLDB_REGISTER_METHOD(bool, SBType, IsReferenceType, ());
944  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetPointerType, ());
945  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetPointeeType, ());
946  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetReferenceType, ());
947  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetTypedefedType, ());
948  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetDereferencedType, ());
949  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetArrayElementType, ());
950  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetArrayType, (uint64_t));
951  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetVectorElementType, ());
952  LLDB_REGISTER_METHOD(bool, SBType, IsFunctionType, ());
953  LLDB_REGISTER_METHOD(bool, SBType, IsPolymorphicClass, ());
954  LLDB_REGISTER_METHOD(bool, SBType, IsTypedefType, ());
955  LLDB_REGISTER_METHOD(bool, SBType, IsAnonymousType, ());
956  LLDB_REGISTER_METHOD(bool, SBType, IsScopedEnumerationType, ());
957  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetFunctionReturnType, ());
958  LLDB_REGISTER_METHOD(lldb::SBTypeList, SBType, GetFunctionArgumentTypes,
959  ());
960  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfMemberFunctions, ());
962  GetMemberFunctionAtIndex, (uint32_t));
963  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetUnqualifiedType, ());
964  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetCanonicalType, ());
965  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetEnumerationIntegerType, ());
966  LLDB_REGISTER_METHOD(lldb::BasicType, SBType, GetBasicType, ());
968  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfDirectBaseClasses, ());
969  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfVirtualBaseClasses, ());
970  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfFields, ());
971  LLDB_REGISTER_METHOD(bool, SBType, GetDescription,
973  LLDB_REGISTER_METHOD(lldb::SBTypeMember, SBType, GetDirectBaseClassAtIndex,
974  (uint32_t));
975  LLDB_REGISTER_METHOD(lldb::SBTypeMember, SBType, GetVirtualBaseClassAtIndex,
976  (uint32_t));
978  ());
980  (uint32_t));
981  LLDB_REGISTER_METHOD(bool, SBType, IsTypeComplete, ());
982  LLDB_REGISTER_METHOD(uint32_t, SBType, GetTypeFlags, ());
983  LLDB_REGISTER_METHOD(lldb::SBModule, SBType, GetModule, ());
984  LLDB_REGISTER_METHOD(const char *, SBType, GetName, ());
985  LLDB_REGISTER_METHOD(const char *, SBType, GetDisplayTypeName, ());
986  LLDB_REGISTER_METHOD(lldb::TypeClass, SBType, GetTypeClass, ());
987  LLDB_REGISTER_METHOD(uint32_t, SBType, GetNumberOfTemplateArguments, ());
988  LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetTemplateArgumentType,
989  (uint32_t));
991  GetTemplateArgumentKind, (uint32_t));
994  LLDB_REGISTER_METHOD(bool, SBTypeList, IsValid, ());
995  LLDB_REGISTER_METHOD_CONST(bool, SBTypeList, operator bool, ());
997  SBTypeList, operator=,(const lldb::SBTypeList &));
998  LLDB_REGISTER_METHOD(void, SBTypeList, Append, (lldb::SBType));
1000  LLDB_REGISTER_METHOD(uint32_t, SBTypeList, GetSize, ());
1004  SBTypeMember, operator=,(const lldb::SBTypeMember &));
1005  LLDB_REGISTER_METHOD_CONST(bool, SBTypeMember, IsValid, ());
1006  LLDB_REGISTER_METHOD_CONST(bool, SBTypeMember, operator bool, ());
1007  LLDB_REGISTER_METHOD(const char *, SBTypeMember, GetName, ());
1009  LLDB_REGISTER_METHOD(uint64_t, SBTypeMember, GetOffsetInBytes, ());
1010  LLDB_REGISTER_METHOD(uint64_t, SBTypeMember, GetOffsetInBits, ());
1011  LLDB_REGISTER_METHOD(bool, SBTypeMember, IsBitfield, ());
1012  LLDB_REGISTER_METHOD(uint32_t, SBTypeMember, GetBitfieldSizeInBits, ());
1013  LLDB_REGISTER_METHOD(bool, SBTypeMember, GetDescription,
1017  (const lldb::SBTypeMemberFunction &));
1020  SBTypeMemberFunction, operator=,(const lldb::SBTypeMemberFunction &));
1022  LLDB_REGISTER_METHOD_CONST(bool, SBTypeMemberFunction, operator bool, ());
1024  LLDB_REGISTER_METHOD(const char *, SBTypeMemberFunction, GetDemangledName,
1025  ());
1026  LLDB_REGISTER_METHOD(const char *, SBTypeMemberFunction, GetMangledName,
1027  ());
1030  LLDB_REGISTER_METHOD(uint32_t, SBTypeMemberFunction, GetNumberOfArguments,
1031  ());
1033  GetArgumentTypeAtIndex, (uint32_t));
1035  GetKind, ());
1036  LLDB_REGISTER_METHOD(bool, SBTypeMemberFunction, GetDescription,
1038 }
1039 
1040 }
1041 }
lldb::SBTypeMemberFunction::GetType
lldb::SBType GetType()
Definition: SBType.cpp:848
lldb::SBType::GetTemplateArgumentKind
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Definition: SBType.cpp:583
lldb::SBTypeList::GetTypeAtIndex
lldb::SBType GetTypeAtIndex(uint32_t index)
Definition: SBType.cpp:635
lldb::SBTypeMemberFunction::GetNumberOfArguments
uint32_t GetNumberOfArguments()
Definition: SBType.cpp:868
lldb_private::TypeMemberImpl
Definition: Type.h:340
lldb::SBTypeMemberFunction::operator=
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
Definition: SBType.cpp:796
lldb::SBStream::ref
lldb_private::Stream & ref()
Definition: SBStream.cpp:178
lldb::SBTypeList::operator=
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
Definition: SBType.cpp:615
Mangled.h
lldb::SBType::GetReferenceType
lldb::SBType GetReferenceType()
Definition: SBType.cpp:184
lldb_private::TypeEnumMemberImpl
Definition: Type.h:472
lldb::SBType::GetFieldAtIndex
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
Definition: SBType.cpp:472
lldb::SBType::IsVectorType
bool IsVectorType()
Definition: SBType.cpp:149
SBDefines.h
SBModule.h
lldb::SBType::operator==
bool operator==(lldb::SBType &rhs)
Definition: SBType.cpp:53
lldb::SBTypeEnumMemberList
Definition: SBTypeEnumMember.h:57
lldb::SBType::m_opaque_sp
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:223
lldb_private::repro::RegisterMethods< SBType >
void RegisterMethods< SBType >(Registry &R)
Definition: SBType.cpp:930
lldb::SBTypeMember::GetName
const char * GetName()
Definition: SBType.cpp:688
lldb::SBType::operator=
lldb::SBType & operator=(const lldb::SBType &rhs)
Definition: SBType.cpp:83
LLDB_RECORD_RESULT
#define LLDB_RECORD_RESULT(Result)
Definition: ReproducerInstrumentation.h:211
lldb::SBType::GetNumberOfDirectBaseClasses
uint32_t GetNumberOfDirectBaseClasses()
Definition: SBType.cpp:375
LLDB_RECORD_METHOD_CONST_NO_ARGS
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:168
lldb::eBasicTypeInvalid
@ eBasicTypeInvalid
Definition: lldb-enumerations.h:742
lldb::SBType::GetMemberFunctionAtIndex
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
Definition: SBType.cpp:318
lldb::SBTypeMember::GetBitfieldSizeInBits
uint32_t GetBitfieldSizeInBits()
Definition: SBType.cpp:730
lldb::SBTypeMember::operator=
lldb::SBTypeMember & operator=(const lldb::SBTypeMember &rhs)
Definition: SBType.cpp:667
lldb::SBType::GetVirtualBaseClassAtIndex
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:432
LLDB_RECORD_METHOD_NO_ARGS
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:165
lldb::eMemberFunctionKindUnknown
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
Definition: lldb-enumerations.h:1021
lldb::SBTypeMember::m_opaque_up
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
Definition: SBType.h:56
lldb::SBType::IsArrayType
bool IsArrayType()
Definition: SBType.cpp:140
lldb::SBTypeList::SBTypeList
SBTypeList()
Definition: SBType.cpp:592
lldb::SBType::IsTypeComplete
bool IsTypeComplete()
Definition: SBType.cpp:499
LLDB_RECORD_CONSTRUCTOR_NO_ARGS
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
Definition: ReproducerInstrumentation.h:136
lldb_private::ConstString::SetCString
void SetCString(const char *cstr)
Set the C string value.
Definition: ConstString.cpp:302
lldb::SBTypeMember::~SBTypeMember
~SBTypeMember()
lldb::SBType::GetArrayType
lldb::SBType GetArrayType(uint64_t size)
Definition: SBType.cpp:220
LLDB_REGISTER_METHOD_CONST
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:98
lldb::SBTypeMember::IsValid
bool IsValid() const
Definition: SBType.cpp:678
lldb::SBTypeMemberFunction
Definition: SBType.h:59
SBTypeEnumMember.h
lldb_private::Stream
Definition: Stream.h:28
SBReproducerPrivate.h
lldb::BasicType
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Definition: lldb-enumerations.h:741
LLDB_REGISTER_CONSTRUCTOR
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
Definition: ReproducerInstrumentation.h:89
lldb::SBType::GetNumberOfTemplateArguments
uint32_t GetNumberOfTemplateArguments()
Definition: SBType.cpp:550
lldb::eTemplateArgumentKindType
@ eTemplateArgumentKindType
Definition: lldb-enumerations.h:816
lldb::SBType::GetNumberOfMemberFunctions
uint32_t GetNumberOfMemberFunctions()
Definition: SBType.cpp:309
lldb::SBTypeMemberFunction::GetArgumentTypeAtIndex
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
Definition: SBType.cpp:877
lldb::SBType
class LLDB_API SBType
Definition: SBDefines.h:79
lldb_private::CompilerType::GetFunctionArgumentAtIndex
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
Definition: CompilerType.cpp:122
lldb::SBTypeMemberFunction::GetReturnType
lldb::SBType GetReturnType()
Definition: SBType.cpp:858
lldb::SBTypeMember::GetDescription
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:738
lldb::SBType::GetTemplateArgumentType
lldb::SBType GetTemplateArgumentType(uint32_t idx)
Definition: SBType.cpp:558
lldb::SBType::GetDereferencedType
lldb::SBType GetDereferencedType()
Definition: SBType.cpp:202
lldb::SBTypeMember::reset
void reset(lldb_private::TypeMemberImpl *)
Definition: SBType.cpp:771
SBStream.h
LLDB_RECORD_METHOD
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:158
lldb::SBType::GetDescription
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:399
lldb::SBTypeMember::GetType
lldb::SBType GetType()
Definition: SBType.cpp:696
lldb::SBModule::SetSP
void SetSP(const ModuleSP &module_sp)
Definition: SBModule.cpp:208
lldb::SBTypeMemberFunction::SBTypeMemberFunction
SBTypeMemberFunction()
Definition: SBType.cpp:783
lldb::SBType::GetPointeeType
lldb::SBType GetPointeeType()
Definition: SBType.cpp:175
GetName
static llvm::StringRef GetName(XcodeSDK::Type type)
Definition: XcodeSDK.cpp:21
lldb::SBType::GetTypeClass
lldb::TypeClass GetTypeClass()
Definition: SBType.cpp:542
Type.h
lldb::SBType::GetUnqualifiedType
lldb::SBType GetUnqualifiedType()
Definition: SBType.cpp:329
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::CompilerType::GetNumberOfFunctionArguments
size_t GetNumberOfFunctionArguments() const
Definition: CompilerType.cpp:115
lldb::SBType::GetModule
lldb::SBModule GetModule()
Definition: SBType.cpp:515
lldb::SBType::IsAnonymousType
bool IsAnonymousType()
Definition: SBType.cpp:266
lldb::SBType::GetFunctionArgumentTypes
lldb::SBTypeList GetFunctionArgumentTypes()
Definition: SBType.cpp:294
lldb::SBTypeList::IsValid
bool IsValid()
Definition: SBType.cpp:605
lldb::SBType::GetDisplayTypeName
const char * GetDisplayTypeName()
Definition: SBType.cpp:534
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
TypeSystem.h
lldb::SBType::GetNumberOfFields
uint32_t GetNumberOfFields()
Definition: SBType.cpp:391
lldb::SBType::operator!=
bool operator!=(lldb::SBType &rhs)
Definition: SBType.cpp:65
lldb::TemplateArgumentKind
TemplateArgumentKind
Definition: lldb-enumerations.h:814
CompilerType.h
lldb::SBTypeList::m_opaque_up
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition: SBType.h:262
lldb_private::CompilerType::IsValid
bool IsValid() const
Definition: CompilerType.h:72
lldb::SBType
Definition: SBType.h:104
lldb::SBType::ref
lldb_private::TypeImpl & ref()
Definition: SBType.cpp:95
SBType.h
lldb::SBTypeList::GetSize
uint32_t GetSize()
Definition: SBType.cpp:644
lldb::SBType::IsFunctionType
bool IsFunctionType()
Definition: SBType.cpp:242
lldb::SBTypeList
Definition: SBType.h:241
LLDB_RECORD_CONSTRUCTOR
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
Definition: ReproducerInstrumentation.h:133
lldb::SBTypeMemberFunction::GetName
const char * GetName()
Definition: SBType.cpp:817
lldb::SBTypeMemberFunction::ref
lldb_private::TypeMemberFunctionImpl & ref()
Definition: SBType.cpp:916
lldb_private::repro::Registry
The registry contains a unique mapping between functions and their ID.
Definition: ReproducerInstrumentation.h:517
lldb::SBType::IsPointerType
bool IsPointerType()
Definition: SBType.cpp:132
lldb::SBTypeEnumMemberList::Append
void Append(SBTypeEnumMember entry)
Definition: SBTypeEnumMember.cpp:154
lldb::SBType::GetFunctionReturnType
lldb::SBType GetFunctionReturnType()
Definition: SBType.cpp:282
lldb::SBType::GetTypeFlags
uint32_t GetTypeFlags()
Definition: SBType.cpp:507
lldb::SBType::IsPolymorphicClass
bool IsPolymorphicClass()
Definition: SBType.cpp:250
lldb::eTemplateArgumentKindNull
@ eTemplateArgumentKindNull
Definition: lldb-enumerations.h:815
uint32_t
lldb::SBTypeMemberFunction::IsValid
bool IsValid() const
Definition: SBType.cpp:807
lldb::SBTypeMember::ref
lldb_private::TypeMemberImpl & ref()
Definition: SBType.cpp:775
lldb::SBType::SBType
SBType()
Definition: SBType.cpp:29
lldb::SBTypeMemberFunction::reset
void reset(lldb_private::TypeMemberFunctionImpl *)
Definition: SBType.cpp:912
lldb::SBType::GetPointerType
lldb::SBType GetPointerType()
Definition: SBType.cpp:165
lldb::SBModule
Definition: SBModule.h:20
lldb::SBTypeMemberFunction::~SBTypeMemberFunction
~SBTypeMemberFunction()
lldb::SBType::IsTypedefType
bool IsTypedefType()
Definition: SBType.cpp:258
lldb::SBType::GetSP
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:77
lldb::SBTypeMember
Definition: SBType.h:18
lldb::SBTypeMember::IsBitfield
bool IsBitfield()
Definition: SBType.cpp:722
lldb::SBTypeMemberFunction::GetKind
lldb::MemberFunctionKind GetKind()
Definition: SBType.cpp:889
lldb::SBType::IsScopedEnumerationType
bool IsScopedEnumerationType()
Definition: SBType.cpp:274
lldb::SBType::GetNumberOfVirtualBaseClasses
uint32_t GetNumberOfVirtualBaseClasses()
Definition: SBType.cpp:383
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb::SBType::GetTypedefedType
lldb::SBType GetTypedefedType()
Definition: SBType.cpp:193
lldb::SBType::GetName
const char * GetName()
Definition: SBType.cpp:526
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeImpl
Definition: Type.h:238
lldb::SBType::GetEnumerationIntegerType
lldb::SBType GetEnumerationIntegerType()
Definition: SBType.cpp:347
lldb::SBTypeList::~SBTypeList
~SBTypeList()
lldb::SBType::GetCanonicalType
lldb::SBType GetCanonicalType()
Definition: SBType.cpp:338
ConstString.h
lldb::SBType::GetBasicType
lldb::BasicType GetBasicType()
Definition: SBType.cpp:357
lldb::SBType::GetArrayElementType
lldb::SBType GetArrayElementType()
Definition: SBType.cpp:211
lldb::MemberFunctionKind
MemberFunctionKind
Kind of member function.
Definition: lldb-enumerations.h:1020
lldb::SBTypeList::Append
void Append(lldb::SBType type)
Definition: SBType.cpp:628
lldb::SBTypeMemberFunction::GetMangledName
const char * GetMangledName()
Definition: SBType.cpp:839
lldb::SBTypeMember::SBTypeMember
SBTypeMember()
Definition: SBType.cpp:652
Stream.h
lldb_private::CompilerType::GetFieldAtIndex
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
Definition: CompilerType.cpp:543
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb::SBType::IsValid
bool IsValid() const
Definition: SBType.cpp:109
lldb::eTemplateArgumentKindIntegral
@ eTemplateArgumentKindIntegral
Definition: lldb-enumerations.h:818
lldb::SBType::GetEnumMembers
lldb::SBTypeEnumMemberList GetEnumMembers()
Definition: SBType.cpp:449
lldb::SBStream
Definition: SBStream.h:18
lldb::SBType::GetDirectBaseClassAtIndex
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:415
lldb_private::TypeMemberFunctionImpl
Definition: Type.h:435
lldb::SBType::GetVectorElementType
lldb::SBType GetVectorElementType()
Definition: SBType.cpp:229
lldb::SBType::GetByteSize
uint64_t GetByteSize()
Definition: SBType.cpp:122
lldb::SBType::IsReferenceType
bool IsReferenceType()
Definition: SBType.cpp:157
lldb::SBTypeMemberFunction::GetDescription
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:898
lldb_private::CompilerType::ForEachEnumerator
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
If this type is an enumeration, iterate through all of its enumerators using a callback.
Definition: CompilerType.cpp:529
lldb::SBTypeMemberFunction::m_opaque_sp
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:101
lldb
Definition: SBAddress.h:15
lldb::SBType::SetSP
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:79
lldb::SBTypeMember::GetOffsetInBits
uint64_t GetOffsetInBits()
Definition: SBType.cpp:714
lldb::SBTypeEnumMember
Definition: SBTypeEnumMember.h:17
lldb::SBType::~SBType
~SBType()
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb::SBTypeMember::GetOffsetInBytes
uint64_t GetOffsetInBytes()
Definition: SBType.cpp:706
lldb_private::TypeListImpl
Definition: Type.h:309
lldb::SBTypeMemberFunction::GetDemangledName
const char * GetDemangledName()
Definition: SBType.cpp:825
LLDB_REGISTER_METHOD
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:93