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 "lldb/API/SBDefines.h"
11#include "lldb/API/SBModule.h"
12#include "lldb/API/SBStream.h"
14#include "lldb/Core/Mangled.h"
16#include "lldb/Symbol/Type.h"
20#include "lldb/Utility/Stream.h"
21
22#include "llvm/ADT/APSInt.h"
23
24#include <memory>
25#include <optional>
26
27using namespace lldb;
28using namespace lldb_private;
29
31
32SBType::SBType(const CompilerType &type) : m_opaque_sp(new TypeImpl(type)) {}
33
34SBType::SBType(const lldb::TypeSP &type_sp)
35 : m_opaque_sp(new TypeImpl(type_sp)) {}
36
37SBType::SBType(const lldb::TypeImplSP &type_impl_sp)
38 : m_opaque_sp(type_impl_sp) {}
39
41 LLDB_INSTRUMENT_VA(this, rhs);
42
43 if (this != &rhs) {
45 }
46}
47
48// SBType::SBType (TypeImpl* impl) :
49// m_opaque_up(impl)
50//{}
51//
53 LLDB_INSTRUMENT_VA(this, rhs);
54
55 if (!IsValid())
56 return !rhs.IsValid();
57
58 if (!rhs.IsValid())
59 return false;
60
61 return *m_opaque_sp.get() == *rhs.m_opaque_sp.get();
62}
63
65 LLDB_INSTRUMENT_VA(this, rhs);
66
67 if (!IsValid())
68 return rhs.IsValid();
69
70 if (!rhs.IsValid())
71 return true;
72
73 return *m_opaque_sp.get() != *rhs.m_opaque_sp.get();
74}
75
76lldb::TypeImplSP SBType::GetSP() { return m_opaque_sp; }
77
78void SBType::SetSP(const lldb::TypeImplSP &type_impl_sp) {
79 m_opaque_sp = type_impl_sp;
80}
81
83 LLDB_INSTRUMENT_VA(this, rhs);
84
85 if (this != &rhs) {
87 }
88 return *this;
89}
90
91SBType::~SBType() = default;
92
94 if (m_opaque_sp.get() == nullptr)
95 m_opaque_sp = std::make_shared<TypeImpl>();
96 return *m_opaque_sp;
97}
98
99const TypeImpl &SBType::ref() const {
100 // "const SBAddress &addr" should already have checked "addr.IsValid()" prior
101 // to calling this function. In case you didn't we will assert and die to let
102 // you know.
103 assert(m_opaque_sp.get());
104 return *m_opaque_sp;
105}
106
107bool SBType::IsValid() const {
108 LLDB_INSTRUMENT_VA(this);
109 return this->operator bool();
110}
111SBType::operator bool() const {
112 LLDB_INSTRUMENT_VA(this);
113
114 if (m_opaque_sp.get() == nullptr)
115 return false;
116
117 return m_opaque_sp->IsValid();
118}
119
121 LLDB_INSTRUMENT_VA(this);
122
123 if (IsValid())
124 if (std::optional<uint64_t> size =
125 m_opaque_sp->GetCompilerType(false).GetByteSize(nullptr))
126 return *size;
127 return 0;
128}
129
131 LLDB_INSTRUMENT_VA(this);
132
133 if (!IsValid())
134 return false;
135 return m_opaque_sp->GetCompilerType(true).IsPointerType();
136}
137
139 LLDB_INSTRUMENT_VA(this);
140
141 if (!IsValid())
142 return false;
143 return m_opaque_sp->GetCompilerType(true).IsArrayType(nullptr, nullptr,
144 nullptr);
145}
146
148 LLDB_INSTRUMENT_VA(this);
149
150 if (!IsValid())
151 return false;
152 return m_opaque_sp->GetCompilerType(true).IsVectorType(nullptr, nullptr);
153}
154
156 LLDB_INSTRUMENT_VA(this);
157
158 if (!IsValid())
159 return false;
160 return m_opaque_sp->GetCompilerType(true).IsReferenceType();
161}
162
164 LLDB_INSTRUMENT_VA(this);
165
166 if (!IsValid())
167 return SBType();
168
169 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointerType())));
170}
171
173 LLDB_INSTRUMENT_VA(this);
174
175 if (!IsValid())
176 return SBType();
177 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointeeType())));
178}
179
181 LLDB_INSTRUMENT_VA(this);
182
183 if (!IsValid())
184 return SBType();
185 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetReferenceType())));
186}
187
189 LLDB_INSTRUMENT_VA(this);
190
191 if (!IsValid())
192 return SBType();
193 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetTypedefedType())));
194}
195
197 LLDB_INSTRUMENT_VA(this);
198
199 if (!IsValid())
200 return SBType();
201 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetDereferencedType())));
202}
203
205 LLDB_INSTRUMENT_VA(this);
206
207 if (!IsValid())
208 return SBType();
209 return SBType(TypeImplSP(new TypeImpl(
210 m_opaque_sp->GetCompilerType(true).GetArrayElementType(nullptr))));
211}
212
214 LLDB_INSTRUMENT_VA(this, size);
215
216 if (!IsValid())
217 return SBType();
218 return SBType(TypeImplSP(
219 new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayType(size))));
220}
221
223 LLDB_INSTRUMENT_VA(this);
224
225 SBType type_sb;
226 if (IsValid()) {
227 CompilerType vector_element_type;
228 if (m_opaque_sp->GetCompilerType(true).IsVectorType(&vector_element_type,
229 nullptr))
230 type_sb.SetSP(TypeImplSP(new TypeImpl(vector_element_type)));
231 }
232 return type_sb;
233}
234
236 LLDB_INSTRUMENT_VA(this);
237
238 if (!IsValid())
239 return false;
240 return m_opaque_sp->GetCompilerType(true).IsFunctionType();
241}
242
244 LLDB_INSTRUMENT_VA(this);
245
246 if (!IsValid())
247 return false;
248 return m_opaque_sp->GetCompilerType(true).IsPolymorphicClass();
249}
250
252 LLDB_INSTRUMENT_VA(this);
253
254 if (!IsValid())
255 return false;
256 return m_opaque_sp->GetCompilerType(true).IsTypedefType();
257}
258
260 LLDB_INSTRUMENT_VA(this);
261
262 if (!IsValid())
263 return false;
264 return m_opaque_sp->GetCompilerType(true).IsAnonymousType();
265}
266
268 LLDB_INSTRUMENT_VA(this);
269
270 if (!IsValid())
271 return false;
272 return m_opaque_sp->GetCompilerType(true).IsScopedEnumerationType();
273}
274
276 LLDB_INSTRUMENT_VA(this);
277
278 if (!IsValid())
279 return false;
280 return m_opaque_sp->GetCompilerType(true).IsAggregateType();
281}
282
284 LLDB_INSTRUMENT_VA(this);
285
286 if (IsValid()) {
287 CompilerType return_type(
288 m_opaque_sp->GetCompilerType(true).GetFunctionReturnType());
289 if (return_type.IsValid())
290 return SBType(return_type);
291 }
292 return lldb::SBType();
293}
294
296 LLDB_INSTRUMENT_VA(this);
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 sb_type_list;
307}
308
310 LLDB_INSTRUMENT_VA(this);
311
312 if (IsValid()) {
313 return m_opaque_sp->GetCompilerType(true).GetNumMemberFunctions();
314 }
315 return 0;
316}
317
319 LLDB_INSTRUMENT_VA(this, idx);
320
321 SBTypeMemberFunction sb_func_type;
322 if (IsValid())
323 sb_func_type.reset(new TypeMemberFunctionImpl(
324 m_opaque_sp->GetCompilerType(true).GetMemberFunctionAtIndex(idx)));
325 return sb_func_type;
326}
327
329 LLDB_INSTRUMENT_VA(this);
330
331 if (!IsValid())
332 return SBType();
333 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetUnqualifiedType())));
334}
335
337 LLDB_INSTRUMENT_VA(this);
338
339 if (IsValid())
340 return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCanonicalType())));
341 return SBType();
342}
343
345 LLDB_INSTRUMENT_VA(this);
346
347 if (IsValid()) {
348 return SBType(
349 m_opaque_sp->GetCompilerType(true).GetEnumerationIntegerType());
350 }
351 return SBType();
352}
353
355 LLDB_INSTRUMENT_VA(this);
356
357 if (IsValid())
358 return m_opaque_sp->GetCompilerType(false).GetBasicTypeEnumeration();
359 return eBasicTypeInvalid;
360}
361
363 LLDB_INSTRUMENT_VA(this, basic_type);
364
365 if (IsValid() && m_opaque_sp->IsValid())
366 if (auto ts = m_opaque_sp->GetTypeSystem(false))
367 return SBType(ts->GetBasicTypeFromAST(basic_type));
368 return SBType();
369}
370
372 LLDB_INSTRUMENT_VA(this);
373
374 if (IsValid())
375 return m_opaque_sp->GetCompilerType(true).GetNumDirectBaseClasses();
376 return 0;
377}
378
380 LLDB_INSTRUMENT_VA(this);
381
382 if (IsValid())
383 return m_opaque_sp->GetCompilerType(true).GetNumVirtualBaseClasses();
384 return 0;
385}
386
388 LLDB_INSTRUMENT_VA(this);
389
390 if (IsValid())
391 return m_opaque_sp->GetCompilerType(true).GetNumFields();
392 return 0;
393}
394
396 lldb::DescriptionLevel description_level) {
397 LLDB_INSTRUMENT_VA(this, description, description_level);
398
399 Stream &strm = description.ref();
400
401 if (m_opaque_sp) {
402 m_opaque_sp->GetDescription(strm, description_level);
403 } else
404 strm.PutCString("No value");
405
406 return true;
407}
408
410 LLDB_INSTRUMENT_VA(this, idx);
411
412 SBTypeMember sb_type_member;
413 if (IsValid()) {
414 uint32_t bit_offset = 0;
415 CompilerType base_class_type =
416 m_opaque_sp->GetCompilerType(true).GetDirectBaseClassAtIndex(
417 idx, &bit_offset);
418 if (base_class_type.IsValid())
419 sb_type_member.reset(new TypeMemberImpl(
420 TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
421 }
422 return sb_type_member;
423}
424
426 LLDB_INSTRUMENT_VA(this, idx);
427
428 SBTypeMember sb_type_member;
429 if (IsValid()) {
430 uint32_t bit_offset = 0;
431 CompilerType base_class_type =
432 m_opaque_sp->GetCompilerType(true).GetVirtualBaseClassAtIndex(
433 idx, &bit_offset);
434 if (base_class_type.IsValid())
435 sb_type_member.reset(new TypeMemberImpl(
436 TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
437 }
438 return sb_type_member;
439}
440
442 LLDB_INSTRUMENT_VA(this);
443
444 SBTypeEnumMemberList sb_enum_member_list;
445 if (IsValid()) {
446 CompilerType this_type(m_opaque_sp->GetCompilerType(true));
447 if (this_type.IsValid()) {
448 this_type.ForEachEnumerator([&sb_enum_member_list](
449 const CompilerType &integer_type,
450 ConstString name,
451 const llvm::APSInt &value) -> bool {
452 SBTypeEnumMember enum_member(
453 lldb::TypeEnumMemberImplSP(new TypeEnumMemberImpl(
454 lldb::TypeImplSP(new TypeImpl(integer_type)), name, value)));
455 sb_enum_member_list.Append(enum_member);
456 return true; // Keep iterating
457 });
458 }
459 }
460 return sb_enum_member_list;
461}
462
464 LLDB_INSTRUMENT_VA(this, idx);
465
466 SBTypeMember sb_type_member;
467 if (IsValid()) {
468 CompilerType this_type(m_opaque_sp->GetCompilerType(false));
469 if (this_type.IsValid()) {
470 uint64_t bit_offset = 0;
471 uint32_t bitfield_bit_size = 0;
472 bool is_bitfield = false;
473 std::string name_sstr;
474 CompilerType field_type(this_type.GetFieldAtIndex(
475 idx, name_sstr, &bit_offset, &bitfield_bit_size, &is_bitfield));
476 if (field_type.IsValid()) {
477 ConstString name;
478 if (!name_sstr.empty())
479 name.SetCString(name_sstr.c_str());
480 sb_type_member.reset(
481 new TypeMemberImpl(TypeImplSP(new TypeImpl(field_type)), bit_offset,
482 name, bitfield_bit_size, is_bitfield));
483 }
484 }
485 }
486 return sb_type_member;
487}
488
490 LLDB_INSTRUMENT_VA(this);
491
492 if (!IsValid())
493 return false;
494 CompilerType compiler_type = m_opaque_sp->GetCompilerType(false);
495 // Only return true if we have a complete type and it wasn't forcefully
496 // completed.
497 if (compiler_type.IsCompleteType())
498 return !compiler_type.IsForcefullyCompleted();
499 return false;
500}
501
503 LLDB_INSTRUMENT_VA(this);
504
505 if (!IsValid())
506 return 0;
507 return m_opaque_sp->GetCompilerType(true).GetTypeInfo();
508}
509
511 LLDB_INSTRUMENT_VA(this);
512
513 lldb::SBModule sb_module;
514 if (!IsValid())
515 return sb_module;
516
517 sb_module.SetSP(m_opaque_sp->GetModule());
518 return sb_module;
519}
520
521const char *SBType::GetName() {
522 LLDB_INSTRUMENT_VA(this);
523
524 if (!IsValid())
525 return "";
526 return m_opaque_sp->GetName().GetCString();
527}
528
530 LLDB_INSTRUMENT_VA(this);
531
532 if (!IsValid())
533 return "";
534 return m_opaque_sp->GetDisplayTypeName().GetCString();
535}
536
537lldb::TypeClass SBType::GetTypeClass() {
538 LLDB_INSTRUMENT_VA(this);
539
540 if (IsValid())
541 return m_opaque_sp->GetCompilerType(true).GetTypeClass();
542 return lldb::eTypeClassInvalid;
543}
544
546 LLDB_INSTRUMENT_VA(this);
547
548 if (IsValid())
549 return m_opaque_sp->GetCompilerType(false).GetNumTemplateArguments(
550 /*expand_pack=*/true);
551 return 0;
552}
553
555 LLDB_INSTRUMENT_VA(this, idx);
556
557 if (!IsValid())
558 return SBType();
559
560 CompilerType type;
561 const bool expand_pack = true;
562 switch(GetTemplateArgumentKind(idx)) {
564 type = m_opaque_sp->GetCompilerType(false).GetTypeTemplateArgument(
565 idx, expand_pack);
566 break;
568 type = m_opaque_sp->GetCompilerType(false)
569 .GetIntegralTemplateArgument(idx, expand_pack)
570 ->type;
571 break;
572 default:
573 break;
574 }
575 if (type.IsValid())
576 return SBType(type);
577 return SBType();
578}
579
581 LLDB_INSTRUMENT_VA(this, idx);
582
583 if (IsValid())
584 return m_opaque_sp->GetCompilerType(false).GetTemplateArgumentKind(
585 idx, /*expand_pack=*/true);
587}
588
589SBTypeList::SBTypeList() : m_opaque_up(new TypeListImpl()) {
590 LLDB_INSTRUMENT_VA(this);
591}
592
594 : m_opaque_up(new TypeListImpl()) {
595 LLDB_INSTRUMENT_VA(this, rhs);
596
597 for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
598 i < rhs_size; i++)
599 Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
600}
601
603 LLDB_INSTRUMENT_VA(this);
604 return this->operator bool();
605}
606SBTypeList::operator bool() const {
607 LLDB_INSTRUMENT_VA(this);
608
609 return (m_opaque_up != nullptr);
610}
611
613 LLDB_INSTRUMENT_VA(this, rhs);
614
615 if (this != &rhs) {
616 m_opaque_up = std::make_unique<TypeListImpl>();
617 for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
618 i < rhs_size; i++)
619 Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
620 }
621 return *this;
622}
623
625 LLDB_INSTRUMENT_VA(this, type);
626
627 if (type.IsValid())
628 m_opaque_up->Append(type.m_opaque_sp);
629}
630
632 LLDB_INSTRUMENT_VA(this, index);
633
634 if (m_opaque_up)
635 return SBType(m_opaque_up->GetTypeAtIndex(index));
636 return SBType();
637}
638
640 LLDB_INSTRUMENT_VA(this);
641
642 return m_opaque_up->GetSize();
643}
644
645SBTypeList::~SBTypeList() = default;
646
648
650
652 LLDB_INSTRUMENT_VA(this, rhs);
653
654 if (this != &rhs) {
655 if (rhs.IsValid())
656 m_opaque_up = std::make_unique<TypeMemberImpl>(rhs.ref());
657 }
658}
659
661 LLDB_INSTRUMENT_VA(this, rhs);
662
663 if (this != &rhs) {
664 if (rhs.IsValid())
665 m_opaque_up = std::make_unique<TypeMemberImpl>(rhs.ref());
666 }
667 return *this;
668}
669
671 LLDB_INSTRUMENT_VA(this);
672 return this->operator bool();
673}
674SBTypeMember::operator bool() const {
675 LLDB_INSTRUMENT_VA(this);
676
677 return m_opaque_up.get();
678}
679
681 LLDB_INSTRUMENT_VA(this);
682
683 if (m_opaque_up)
684 return m_opaque_up->GetName().GetCString();
685 return nullptr;
686}
687
689 LLDB_INSTRUMENT_VA(this);
690
691 SBType sb_type;
692 if (m_opaque_up) {
693 sb_type.SetSP(m_opaque_up->GetTypeImpl());
694 }
695 return sb_type;
696}
697
699 LLDB_INSTRUMENT_VA(this);
700
701 if (m_opaque_up)
702 return m_opaque_up->GetBitOffset() / 8u;
703 return 0;
704}
705
707 LLDB_INSTRUMENT_VA(this);
708
709 if (m_opaque_up)
710 return m_opaque_up->GetBitOffset();
711 return 0;
712}
713
715 LLDB_INSTRUMENT_VA(this);
716
717 if (m_opaque_up)
718 return m_opaque_up->GetIsBitfield();
719 return false;
720}
721
723 LLDB_INSTRUMENT_VA(this);
724
725 if (m_opaque_up)
726 return m_opaque_up->GetBitfieldBitSize();
727 return 0;
728}
729
731 lldb::DescriptionLevel description_level) {
732 LLDB_INSTRUMENT_VA(this, description, description_level);
733
734 Stream &strm = description.ref();
735
736 if (m_opaque_up) {
737 const uint32_t bit_offset = m_opaque_up->GetBitOffset();
738 const uint32_t byte_offset = bit_offset / 8u;
739 const uint32_t byte_bit_offset = bit_offset % 8u;
740 const char *name = m_opaque_up->GetName().GetCString();
741 if (byte_bit_offset)
742 strm.Printf("+%u + %u bits: (", byte_offset, byte_bit_offset);
743 else
744 strm.Printf("+%u: (", byte_offset);
745
746 TypeImplSP type_impl_sp(m_opaque_up->GetTypeImpl());
747 if (type_impl_sp)
748 type_impl_sp->GetDescription(strm, description_level);
749
750 strm.Printf(") %s", name);
751 if (m_opaque_up->GetIsBitfield()) {
752 const uint32_t bitfield_bit_size = m_opaque_up->GetBitfieldBitSize();
753 strm.Printf(" : %u", bitfield_bit_size);
754 }
755 } else {
756 strm.PutCString("No value");
757 }
758 return true;
759}
760
761void SBTypeMember::reset(TypeMemberImpl *type_member_impl) {
762 m_opaque_up.reset(type_member_impl);
763}
764
766 if (m_opaque_up == nullptr)
767 m_opaque_up = std::make_unique<TypeMemberImpl>();
768 return *m_opaque_up;
769}
770
772
774
776
778 : m_opaque_sp(rhs.m_opaque_sp) {
779 LLDB_INSTRUMENT_VA(this, rhs);
780}
781
784 LLDB_INSTRUMENT_VA(this, rhs);
785
786 if (this != &rhs)
788 return *this;
789}
790
792 LLDB_INSTRUMENT_VA(this);
793 return this->operator bool();
794}
795SBTypeMemberFunction::operator bool() const {
796 LLDB_INSTRUMENT_VA(this);
797
798 return m_opaque_sp.get();
799}
800
802 LLDB_INSTRUMENT_VA(this);
803
804 if (m_opaque_sp)
805 return m_opaque_sp->GetName().GetCString();
806 return nullptr;
807}
808
810 LLDB_INSTRUMENT_VA(this);
811
812 if (!m_opaque_sp)
813 return nullptr;
814
815 ConstString mangled_str = m_opaque_sp->GetMangledName();
816 if (!mangled_str)
817 return nullptr;
818
819 Mangled mangled(mangled_str);
820 return mangled.GetDemangledName().GetCString();
821}
822
824 LLDB_INSTRUMENT_VA(this);
825
826 if (m_opaque_sp)
827 return m_opaque_sp->GetMangledName().GetCString();
828 return nullptr;
829}
830
832 LLDB_INSTRUMENT_VA(this);
833
834 SBType sb_type;
835 if (m_opaque_sp) {
836 sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetType())));
837 }
838 return sb_type;
839}
840
842 LLDB_INSTRUMENT_VA(this);
843
844 SBType sb_type;
845 if (m_opaque_sp) {
846 sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetReturnType())));
847 }
848 return sb_type;
849}
850
852 LLDB_INSTRUMENT_VA(this);
853
854 if (m_opaque_sp)
855 return m_opaque_sp->GetNumArguments();
856 return 0;
857}
858
860 LLDB_INSTRUMENT_VA(this, i);
861
862 SBType sb_type;
863 if (m_opaque_sp) {
864 sb_type.SetSP(
865 lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetArgumentAtIndex(i))));
866 }
867 return sb_type;
868}
869
871 LLDB_INSTRUMENT_VA(this);
872
873 if (m_opaque_sp)
874 return m_opaque_sp->GetKind();
876}
877
879 lldb::SBStream &description, lldb::DescriptionLevel description_level) {
880 LLDB_INSTRUMENT_VA(this, description, description_level);
881
882 Stream &strm = description.ref();
883
884 if (m_opaque_sp)
885 return m_opaque_sp->GetDescription(strm);
886
887 return false;
888}
889
891 m_opaque_sp.reset(type_member_impl);
892}
893
895 if (!m_opaque_sp)
896 m_opaque_sp = std::make_shared<TypeMemberFunctionImpl>();
897 return *m_opaque_sp.get();
898}
899
901 return *m_opaque_sp.get();
902}
#define LLDB_INSTRUMENT_VA(...)
void SetSP(const ModuleSP &module_sp)
Definition: SBModule.cpp:211
lldb_private::Stream & ref()
Definition: SBStream.cpp:177
void Append(SBTypeEnumMember entry)
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition: SBType.h:275
lldb::SBType GetTypeAtIndex(uint32_t index)
Definition: SBType.cpp:631
uint32_t GetSize()
Definition: SBType.cpp:639
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
Definition: SBType.cpp:612
bool IsValid()
Definition: SBType.cpp:602
void Append(lldb::SBType type)
Definition: SBType.cpp:624
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
Definition: SBType.cpp:859
const char * GetMangledName()
Definition: SBType.cpp:823
void reset(lldb_private::TypeMemberFunctionImpl *)
Definition: SBType.cpp:890
lldb::MemberFunctionKind GetKind()
Definition: SBType.cpp:870
lldb::SBType GetReturnType()
Definition: SBType.cpp:841
const char * GetName()
Definition: SBType.cpp:801
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
Definition: SBType.cpp:783
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:878
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:107
uint32_t GetNumberOfArguments()
Definition: SBType.cpp:851
lldb::SBType GetType()
Definition: SBType.cpp:831
const char * GetDemangledName()
Definition: SBType.cpp:809
lldb_private::TypeMemberFunctionImpl & ref()
Definition: SBType.cpp:894
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
Definition: SBType.h:62
void reset(lldb_private::TypeMemberImpl *)
Definition: SBType.cpp:761
lldb::SBTypeMember & operator=(const lldb::SBTypeMember &rhs)
Definition: SBType.cpp:660
const char * GetName()
Definition: SBType.cpp:680
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:730
uint64_t GetOffsetInBits()
Definition: SBType.cpp:706
uint64_t GetOffsetInBytes()
Definition: SBType.cpp:698
lldb::SBType GetType()
Definition: SBType.cpp:688
uint32_t GetBitfieldSizeInBits()
Definition: SBType.cpp:722
bool IsValid() const
Definition: SBType.cpp:670
lldb_private::TypeMemberImpl & ref()
Definition: SBType.cpp:765
bool IsArrayType()
Definition: SBType.cpp:138
uint32_t GetNumberOfTemplateArguments()
Definition: SBType.cpp:545
uint32_t GetNumberOfDirectBaseClasses()
Definition: SBType.cpp:371
lldb::SBType GetReferenceType()
Definition: SBType.cpp:180
lldb::SBType GetArrayType(uint64_t size)
Definition: SBType.cpp:213
lldb::SBType GetVectorElementType()
Definition: SBType.cpp:222
uint32_t GetNumberOfFields()
Definition: SBType.cpp:387
lldb::SBType GetDereferencedType()
Definition: SBType.cpp:196
lldb::SBModule GetModule()
Definition: SBType.cpp:510
lldb::BasicType GetBasicType()
Definition: SBType.cpp:354
bool IsPolymorphicClass()
Definition: SBType.cpp:243
uint32_t GetTypeFlags()
Definition: SBType.cpp:502
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:76
bool IsAggregateType()
Definition: SBType.cpp:275
bool IsReferenceType()
Definition: SBType.cpp:155
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:409
bool IsVectorType()
Definition: SBType.cpp:147
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Return the TemplateArgumentKind of the template argument at index idx.
Definition: SBType.cpp:580
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
Definition: SBType.cpp:318
lldb::SBType GetPointerType()
Definition: SBType.cpp:163
uint32_t GetNumberOfMemberFunctions()
Definition: SBType.cpp:309
lldb::SBType GetTemplateArgumentType(uint32_t idx)
Definition: SBType.cpp:554
lldb::TypeClass GetTypeClass()
Definition: SBType.cpp:537
lldb::SBType GetCanonicalType()
Definition: SBType.cpp:336
bool operator!=(lldb::SBType &rhs)
Definition: SBType.cpp:64
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:395
lldb::SBTypeList GetFunctionArgumentTypes()
Definition: SBType.cpp:295
uint32_t GetNumberOfVirtualBaseClasses()
Definition: SBType.cpp:379
lldb::SBType GetTypedefedType()
Definition: SBType.cpp:188
lldb_private::TypeImpl & ref()
Definition: SBType.cpp:93
lldb::SBType & operator=(const lldb::SBType &rhs)
Definition: SBType.cpp:82
lldb::SBType GetFunctionReturnType()
Definition: SBType.cpp:283
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:233
lldb::SBType GetUnqualifiedType()
Definition: SBType.cpp:328
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:425
bool IsTypeComplete()
Definition: SBType.cpp:489
const char * GetDisplayTypeName()
Definition: SBType.cpp:529
lldb::SBType GetArrayElementType()
Definition: SBType.cpp:204
bool IsTypedefType()
Definition: SBType.cpp:251
bool IsAnonymousType()
Definition: SBType.cpp:259
bool IsPointerType()
Definition: SBType.cpp:130
const char * GetName()
Definition: SBType.cpp:521
lldb::SBType GetPointeeType()
Definition: SBType.cpp:172
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
Definition: SBType.cpp:463
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:78
uint64_t GetByteSize()
Definition: SBType.cpp:120
bool IsValid() const
Definition: SBType.cpp:107
bool operator==(lldb::SBType &rhs)
Definition: SBType.cpp:52
lldb::SBType GetEnumerationIntegerType()
Definition: SBType.cpp:344
lldb::SBTypeEnumMemberList GetEnumMembers()
Definition: SBType.cpp:441
bool IsFunctionType()
Definition: SBType.cpp:235
bool IsScopedEnumerationType()
Definition: SBType.cpp:267
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
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.
size_t GetNumberOfFunctionArguments() const
bool IsForcefullyCompleted() const
A uniqued constant string class.
Definition: ConstString.h:39
void SetCString(const char *cstr)
Set the C string value.
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Definition: SBAddress.h:15
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eBasicTypeInvalid
@ eTemplateArgumentKindNull
@ eTemplateArgumentKindIntegral
@ eTemplateArgumentKindType
MemberFunctionKind
Kind of member function.
@ eMemberFunctionKindUnknown
Not sure what the type of this is.