LLDB  mainline
CompilerType.cpp
Go to the documentation of this file.
1 //===-- CompilerType.cpp ----------------------------------------*- 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 
10 
11 #include "lldb/Core/Debugger.h"
12 #include "lldb/Core/StreamFile.h"
15 #include "lldb/Symbol/Type.h"
17 #include "lldb/Target/Process.h"
21 #include "lldb/Utility/Scalar.h"
22 #include "lldb/Utility/Stream.h"
24 
25 #include <iterator>
26 #include <mutex>
27 
28 using namespace lldb;
29 using namespace lldb_private;
30 
31 CompilerType::CompilerType(TypeSystem *type_system,
33  : m_type(type), m_type_system(type_system) {}
34 
35 CompilerType::CompilerType(clang::ASTContext *ast, clang::QualType qual_type)
36  : m_type(qual_type.getAsOpaquePtr()),
37  m_type_system(ClangASTContext::GetASTContext(ast)) {
38  if (m_type)
39  assert(m_type_system != nullptr);
40 }
41 
43 
44 // Tests
45 
47  if (IsValid())
48  return m_type_system->IsAggregateType(m_type);
49  return false;
50 }
51 
53  if (IsValid())
54  return m_type_system->IsAnonymousType(m_type);
55  return false;
56 }
57 
58 bool CompilerType::IsArrayType(CompilerType *element_type_ptr, uint64_t *size,
59  bool *is_incomplete) const {
60  if (IsValid())
61  return m_type_system->IsArrayType(m_type, element_type_ptr, size,
62  is_incomplete);
63 
64  if (element_type_ptr)
65  element_type_ptr->Clear();
66  if (size)
67  *size = 0;
68  if (is_incomplete)
69  *is_incomplete = false;
70  return false;
71 }
72 
74  uint64_t *size) const {
75  if (IsValid())
76  return m_type_system->IsVectorType(m_type, element_type, size);
77  return false;
78 }
79 
81  if (IsValid())
82  return m_type_system->IsRuntimeGeneratedType(m_type);
83  return false;
84 }
85 
87  if (IsValid())
88  return m_type_system->IsCharType(m_type);
89  return false;
90 }
91 
93  if (IsValid())
94  return m_type_system->IsCompleteType(m_type);
95  return false;
96 }
97 
98 bool CompilerType::IsConst() const {
99  if (IsValid())
100  return m_type_system->IsConst(m_type);
101  return false;
102 }
103 
105  if (IsValid())
106  return m_type_system->IsCStringType(m_type, length);
107  return false;
108 }
109 
110 bool CompilerType::IsFunctionType(bool *is_variadic_ptr) const {
111  if (IsValid())
112  return m_type_system->IsFunctionType(m_type, is_variadic_ptr);
113  return false;
114 }
115 
116 // Used to detect "Homogeneous Floating-point Aggregates"
117 uint32_t
119  if (IsValid())
120  return m_type_system->IsHomogeneousAggregate(m_type, base_type_ptr);
121  return 0;
122 }
123 
125  if (IsValid())
126  return m_type_system->GetNumberOfFunctionArguments(m_type);
127  return 0;
128 }
129 
131 CompilerType::GetFunctionArgumentAtIndex(const size_t index) const {
132  if (IsValid())
133  return m_type_system->GetFunctionArgumentAtIndex(m_type, index);
134  return CompilerType();
135 }
136 
138  if (IsValid())
139  return m_type_system->IsFunctionPointerType(m_type);
140  return false;
141 }
142 
144  CompilerType *function_pointer_type_ptr) const {
145  if (IsValid())
146  return m_type_system->IsBlockPointerType(m_type, function_pointer_type_ptr);
147  return 0;
148 }
149 
150 bool CompilerType::IsIntegerType(bool &is_signed) const {
151  if (IsValid())
152  return m_type_system->IsIntegerType(m_type, is_signed);
153  return false;
154 }
155 
156 bool CompilerType::IsEnumerationType(bool &is_signed) const {
157  if (IsValid())
158  return m_type_system->IsEnumerationType(m_type, is_signed);
159  return false;
160 }
161 
162 bool CompilerType::IsIntegerOrEnumerationType(bool &is_signed) const {
163  return IsIntegerType(is_signed) || IsEnumerationType(is_signed);
164 }
165 
166 bool CompilerType::IsPointerType(CompilerType *pointee_type) const {
167  if (IsValid()) {
168  return m_type_system->IsPointerType(m_type, pointee_type);
169  }
170  if (pointee_type)
171  pointee_type->Clear();
172  return false;
173 }
174 
176  if (IsValid()) {
177  return m_type_system->IsPointerOrReferenceType(m_type, pointee_type);
178  }
179  if (pointee_type)
180  pointee_type->Clear();
181  return false;
182 }
183 
185  bool *is_rvalue) const {
186  if (IsValid()) {
187  return m_type_system->IsReferenceType(m_type, pointee_type, is_rvalue);
188  }
189  if (pointee_type)
190  pointee_type->Clear();
191  return false;
192 }
193 
195  if (IsValid())
196  return m_type_system->ShouldTreatScalarValueAsAddress(m_type);
197  return false;
198 }
199 
201  bool &is_complex) const {
202  if (IsValid()) {
203  return m_type_system->IsFloatingPointType(m_type, count, is_complex);
204  }
205  count = 0;
206  is_complex = false;
207  return false;
208 }
209 
211  if (IsValid())
212  return m_type_system->IsDefined(m_type);
213  return true;
214 }
215 
217  if (IsValid()) {
218  return m_type_system->IsPolymorphicClass(m_type);
219  }
220  return false;
221 }
222 
224  bool check_cplusplus,
225  bool check_objc) const {
226  if (IsValid())
227  return m_type_system->IsPossibleDynamicType(m_type, dynamic_pointee_type,
228  check_cplusplus, check_objc);
229  return false;
230 }
231 
233  if (!IsValid())
234  return false;
235 
236  return m_type_system->IsScalarType(m_type);
237 }
238 
240  if (!IsValid())
241  return false;
242  return m_type_system->IsTypedefType(m_type);
243 }
244 
246  if (!IsValid())
247  return false;
248  return m_type_system->IsVoidType(m_type);
249 }
250 
252  if (!IsValid())
253  return false;
254 
255  return IsPointerType() && GetPointeeType().IsScalarType();
256 }
257 
259  CompilerType element_type;
260  if (IsArrayType(&element_type, nullptr, nullptr))
261  return element_type.IsScalarType();
262  return false;
263 }
264 
266  if (!IsValid())
267  return false;
268  return m_type_system->IsBeingDefined(m_type);
269 }
270 
271 // Type Completion
272 
274  if (!IsValid())
275  return false;
276  return m_type_system->GetCompleteType(m_type);
277 }
278 
279 // AST related queries
281  if (m_type_system)
282  return m_type_system->GetPointerByteSize();
283  return 0;
284 }
285 
287  return GetConstTypeName();
288 }
289 
291  if (IsValid()) {
292  ConstString type_name(GetTypeName());
293  if (type_name)
294  return type_name;
295  }
296  return ConstString("<invalid>");
297 }
298 
300  if (IsValid()) {
301  return m_type_system->GetTypeName(m_type);
302  }
303  return ConstString("<invalid>");
304 }
305 
307 
309  CompilerType *pointee_or_element_compiler_type) const {
310  if (!IsValid())
311  return 0;
312 
313  return m_type_system->GetTypeInfo(m_type, pointee_or_element_compiler_type);
314 }
315 
317  if (!IsValid())
318  return lldb::eLanguageTypeC;
319 
320  return m_type_system->GetMinimumLanguage(m_type);
321 }
322 
323 lldb::TypeClass CompilerType::GetTypeClass() const {
324  if (!IsValid())
325  return lldb::eTypeClassInvalid;
326 
327  return m_type_system->GetTypeClass(m_type);
328 }
329 
332  m_type_system = type_system;
333  m_type = type;
334 }
335 
336 void CompilerType::SetCompilerType(clang::ASTContext *ast,
337  clang::QualType qual_type) {
338  m_type_system = ClangASTContext::GetASTContext(ast);
339  m_type = qual_type.getAsOpaquePtr();
340 }
341 
343  if (IsValid())
344  return m_type_system->GetTypeQualifiers(m_type);
345  return 0;
346 }
347 
348 // Creating related types
349 
351  if (IsValid()) {
352  return m_type_system->GetArrayElementType(m_type, stride);
353  }
354  return CompilerType();
355 }
356 
358  if (IsValid()) {
359  return m_type_system->GetArrayType(m_type, size);
360  }
361  return CompilerType();
362 }
363 
365  if (IsValid())
366  return m_type_system->GetCanonicalType(m_type);
367  return CompilerType();
368 }
369 
371  if (IsValid())
372  return m_type_system->GetFullyUnqualifiedType(m_type);
373  return CompilerType();
374 }
375 
377  if (IsValid()) {
378  return m_type_system->GetFunctionArgumentCount(m_type);
379  }
380  return -1;
381 }
382 
384  if (IsValid()) {
385  return m_type_system->GetFunctionArgumentTypeAtIndex(m_type, idx);
386  }
387  return CompilerType();
388 }
389 
391  if (IsValid()) {
392  return m_type_system->GetFunctionReturnType(m_type);
393  }
394  return CompilerType();
395 }
396 
398  if (IsValid()) {
399  return m_type_system->GetNumMemberFunctions(m_type);
400  }
401  return 0;
402 }
403 
405  if (IsValid()) {
406  return m_type_system->GetMemberFunctionAtIndex(m_type, idx);
407  }
408  return TypeMemberFunctionImpl();
409 }
410 
412  if (IsValid())
413  return m_type_system->GetNonReferenceType(m_type);
414  return CompilerType();
415 }
416 
418  if (IsValid()) {
419  return m_type_system->GetPointeeType(m_type);
420  }
421  return CompilerType();
422 }
423 
425  if (IsValid()) {
426  return m_type_system->GetPointerType(m_type);
427  }
428  return CompilerType();
429 }
430 
432  if (IsValid())
433  return m_type_system->GetLValueReferenceType(m_type);
434  else
435  return CompilerType();
436 }
437 
439  if (IsValid())
440  return m_type_system->GetRValueReferenceType(m_type);
441  else
442  return CompilerType();
443 }
444 
446  if (IsValid())
447  return m_type_system->AddConstModifier(m_type);
448  else
449  return CompilerType();
450 }
451 
453  if (IsValid())
454  return m_type_system->AddVolatileModifier(m_type);
455  else
456  return CompilerType();
457 }
458 
460  if (IsValid())
461  return m_type_system->AddRestrictModifier(m_type);
462  else
463  return CompilerType();
464 }
465 
468  const CompilerDeclContext &decl_ctx) const {
469  if (IsValid())
470  return m_type_system->CreateTypedef(m_type, name, decl_ctx);
471  else
472  return CompilerType();
473 }
474 
476  if (IsValid())
477  return m_type_system->GetTypedefedType(m_type);
478  else
479  return CompilerType();
480 }
481 
482 // Create related types using the current type's AST
483 
486  if (IsValid())
487  return m_type_system->GetBasicTypeFromAST(basic_type);
488  return CompilerType();
489 }
490 // Exploring the type
491 
492 llvm::Optional<uint64_t>
494  if (IsValid())
495  return m_type_system->GetBitSize(m_type, exe_scope);
496  return {};
497 }
498 
499 llvm::Optional<uint64_t>
501  if (llvm::Optional<uint64_t> bit_size = GetBitSize(exe_scope))
502  return (*bit_size + 7) / 8;
503  return {};
504 }
505 
507  if (IsValid())
508  return m_type_system->GetTypeBitAlign(m_type);
509  return 0;
510 }
511 
513  if (!IsValid())
514  return lldb::eEncodingInvalid;
515 
516  return m_type_system->GetEncoding(m_type, count);
517 }
518 
520  if (!IsValid())
521  return lldb::eFormatDefault;
522 
523  return m_type_system->GetFormat(m_type);
524 }
525 
526 uint32_t CompilerType::GetNumChildren(bool omit_empty_base_classes,
527  const ExecutionContext *exe_ctx) const {
528  if (!IsValid())
529  return 0;
530  return m_type_system->GetNumChildren(m_type, omit_empty_base_classes,
531  exe_ctx);
532 }
533 
535  if (IsValid())
536  return m_type_system->GetBasicTypeEnumeration(m_type);
537  return eBasicTypeInvalid;
538 }
539 
541  std::function<bool(const CompilerType &integer_type,
542  ConstString name,
543  const llvm::APSInt &value)> const &callback) const {
544  if (IsValid())
545  return m_type_system->ForEachEnumerator(m_type, callback);
546 }
547 
549  if (!IsValid())
550  return 0;
551  return m_type_system->GetNumFields(m_type);
552 }
553 
554 CompilerType CompilerType::GetFieldAtIndex(size_t idx, std::string &name,
555  uint64_t *bit_offset_ptr,
556  uint32_t *bitfield_bit_size_ptr,
557  bool *is_bitfield_ptr) const {
558  if (!IsValid())
559  return CompilerType();
560  return m_type_system->GetFieldAtIndex(m_type, idx, name, bit_offset_ptr,
561  bitfield_bit_size_ptr, is_bitfield_ptr);
562 }
563 
565  if (IsValid())
566  return m_type_system->GetNumDirectBaseClasses(m_type);
567  return 0;
568 }
569 
571  if (IsValid())
572  return m_type_system->GetNumVirtualBaseClasses(m_type);
573  return 0;
574 }
575 
578  uint32_t *bit_offset_ptr) const {
579  if (IsValid())
580  return m_type_system->GetDirectBaseClassAtIndex(m_type, idx,
581  bit_offset_ptr);
582  return CompilerType();
583 }
584 
587  uint32_t *bit_offset_ptr) const {
588  if (IsValid())
589  return m_type_system->GetVirtualBaseClassAtIndex(m_type, idx,
590  bit_offset_ptr);
591  return CompilerType();
592 }
593 
595  const char *name, CompilerType *field_compiler_type_ptr,
596  uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr,
597  bool *is_bitfield_ptr) const {
598  unsigned count = GetNumFields();
599  std::string field_name;
600  for (unsigned index = 0; index < count; index++) {
601  CompilerType field_compiler_type(
602  GetFieldAtIndex(index, field_name, bit_offset_ptr,
603  bitfield_bit_size_ptr, is_bitfield_ptr));
604  if (strcmp(field_name.c_str(), name) == 0) {
605  if (field_compiler_type_ptr)
606  *field_compiler_type_ptr = field_compiler_type;
607  return index;
608  }
609  }
610  return UINT32_MAX;
611 }
612 
614  ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers,
615  bool omit_empty_base_classes, bool ignore_array_bounds,
616  std::string &child_name, uint32_t &child_byte_size,
617  int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size,
618  uint32_t &child_bitfield_bit_offset, bool &child_is_base_class,
619  bool &child_is_deref_of_parent, ValueObject *valobj,
620  uint64_t &language_flags) const {
621  if (!IsValid())
622  return CompilerType();
623  return m_type_system->GetChildCompilerTypeAtIndex(
624  m_type, exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
625  ignore_array_bounds, child_name, child_byte_size, child_byte_offset,
626  child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
627  child_is_deref_of_parent, valobj, language_flags);
628 }
629 
630 // Look for a child member (doesn't include base classes, but it does include
631 // their members) in the type hierarchy. Returns an index path into
632 // "clang_type" on how to reach the appropriate member.
633 //
634 // class A
635 // {
636 // public:
637 // int m_a;
638 // int m_b;
639 // };
640 //
641 // class B
642 // {
643 // };
644 //
645 // class C :
646 // public B,
647 // public A
648 // {
649 // };
650 //
651 // If we have a clang type that describes "class C", and we wanted to looked
652 // "m_b" in it:
653 //
654 // With omit_empty_base_classes == false we would get an integer array back
655 // with: { 1, 1 } The first index 1 is the child index for "class A" within
656 // class C The second index 1 is the child index for "m_b" within class A
657 //
658 // With omit_empty_base_classes == true we would get an integer array back
659 // with: { 0, 1 } The first index 0 is the child index for "class A" within
660 // class C (since class B doesn't have any members it doesn't count) The second
661 // index 1 is the child index for "m_b" within class A
662 
664  const char *name, bool omit_empty_base_classes,
665  std::vector<uint32_t> &child_indexes) const {
666  if (IsValid() && name && name[0]) {
667  return m_type_system->GetIndexOfChildMemberWithName(
668  m_type, name, omit_empty_base_classes, child_indexes);
669  }
670  return 0;
671 }
672 
674  if (IsValid()) {
675  return m_type_system->GetNumTemplateArguments(m_type);
676  }
677  return 0;
678 }
679 
681  if (IsValid())
682  return m_type_system->GetTemplateArgumentKind(m_type, idx);
684 }
685 
687  if (IsValid()) {
688  return m_type_system->GetTypeTemplateArgument(m_type, idx);
689  }
690  return CompilerType();
691 }
692 
693 llvm::Optional<CompilerType::IntegralTemplateArgument>
695  if (IsValid())
696  return m_type_system->GetIntegralTemplateArgument(m_type, idx);
697  return llvm::None;
698 }
699 
701  if (IsValid())
702  return m_type_system->GetTypeForFormatters(m_type);
703  return CompilerType();
704 }
705 
707  if (IsValid())
708  return m_type_system->ShouldPrintAsOneLiner(m_type, valobj);
709  return eLazyBoolCalculate;
710 }
711 
713  if (IsValid())
714  return m_type_system->IsMeaninglessWithoutDynamicResolution(m_type);
715  return false;
716 }
717 
718 // Get the index of the child of "clang_type" whose name matches. This function
719 // doesn't descend into the children, but only looks one level deep and name
720 // matches can include base class names.
721 
722 uint32_t
724  bool omit_empty_base_classes) const {
725  if (IsValid() && name && name[0]) {
726  return m_type_system->GetIndexOfChildWithName(m_type, name,
727  omit_empty_base_classes);
728  }
729  return UINT32_MAX;
730 }
731 
732 size_t CompilerType::ConvertStringToFloatValue(const char *s, uint8_t *dst,
733  size_t dst_size) const {
734  if (IsValid())
735  return m_type_system->ConvertStringToFloatValue(m_type, s, dst, dst_size);
736  return 0;
737 }
738 
739 // Dumping types
740 #define DEPTH_INCREMENT 2
741 
743  lldb::Format format, const DataExtractor &data,
744  lldb::offset_t data_byte_offset,
745  size_t data_byte_size, uint32_t bitfield_bit_size,
746  uint32_t bitfield_bit_offset, bool show_types,
747  bool show_summary, bool verbose, uint32_t depth) {
748  if (!IsValid())
749  return;
750  m_type_system->DumpValue(m_type, exe_ctx, s, format, data, data_byte_offset,
751  data_byte_size, bitfield_bit_size,
752  bitfield_bit_offset, show_types, show_summary,
753  verbose, depth);
754 }
755 
757  const DataExtractor &data,
758  lldb::offset_t byte_offset, size_t byte_size,
759  uint32_t bitfield_bit_size,
760  uint32_t bitfield_bit_offset,
761  ExecutionContextScope *exe_scope) {
762  if (!IsValid())
763  return false;
764  return m_type_system->DumpTypeValue(m_type, s, format, data, byte_offset,
765  byte_size, bitfield_bit_size,
766  bitfield_bit_offset, exe_scope);
767 }
768 
770  const DataExtractor &data,
771  lldb::offset_t data_byte_offset,
772  size_t data_byte_size) {
773  if (IsValid())
774  m_type_system->DumpSummary(m_type, exe_ctx, s, data, data_byte_offset,
775  data_byte_size);
776 }
777 
779  if (IsValid())
780  m_type_system->DumpTypeDescription(m_type);
781 }
782 
784  if (IsValid()) {
785  m_type_system->DumpTypeDescription(m_type, s);
786  }
787 }
788 
789 #ifndef NDEBUG
790 LLVM_DUMP_METHOD void CompilerType::dump() const {
791  if (IsValid())
792  m_type_system->dump(m_type);
793  else
794  llvm::errs() << "<invalid>\n";
795 }
796 #endif
797 
799  lldb::offset_t data_byte_offset,
800  size_t data_byte_size,
801  Scalar &value) const {
802  if (!IsValid())
803  return false;
804 
805  if (IsAggregateType()) {
806  return false; // Aggregate types don't have scalar values
807  } else {
808  uint64_t count = 0;
809  lldb::Encoding encoding = GetEncoding(count);
810 
811  if (encoding == lldb::eEncodingInvalid || count != 1)
812  return false;
813 
814  llvm::Optional<uint64_t> byte_size = GetByteSize(nullptr);
815  if (!byte_size)
816  return false;
817  lldb::offset_t offset = data_byte_offset;
818  switch (encoding) {
820  break;
822  break;
823  case lldb::eEncodingUint:
824  if (*byte_size <= sizeof(unsigned long long)) {
825  uint64_t uval64 = data.GetMaxU64(&offset, *byte_size);
826  if (*byte_size <= sizeof(unsigned int)) {
827  value = (unsigned int)uval64;
828  return true;
829  } else if (*byte_size <= sizeof(unsigned long)) {
830  value = (unsigned long)uval64;
831  return true;
832  } else if (*byte_size <= sizeof(unsigned long long)) {
833  value = (unsigned long long)uval64;
834  return true;
835  } else
836  value.Clear();
837  }
838  break;
839 
840  case lldb::eEncodingSint:
841  if (*byte_size <= sizeof(long long)) {
842  int64_t sval64 = data.GetMaxS64(&offset, *byte_size);
843  if (*byte_size <= sizeof(int)) {
844  value = (int)sval64;
845  return true;
846  } else if (*byte_size <= sizeof(long)) {
847  value = (long)sval64;
848  return true;
849  } else if (*byte_size <= sizeof(long long)) {
850  value = (long long)sval64;
851  return true;
852  } else
853  value.Clear();
854  }
855  break;
856 
858  if (*byte_size <= sizeof(long double)) {
859  uint32_t u32;
860  uint64_t u64;
861  if (*byte_size == sizeof(float)) {
862  if (sizeof(float) == sizeof(uint32_t)) {
863  u32 = data.GetU32(&offset);
864  value = *((float *)&u32);
865  return true;
866  } else if (sizeof(float) == sizeof(uint64_t)) {
867  u64 = data.GetU64(&offset);
868  value = *((float *)&u64);
869  return true;
870  }
871  } else if (*byte_size == sizeof(double)) {
872  if (sizeof(double) == sizeof(uint32_t)) {
873  u32 = data.GetU32(&offset);
874  value = *((double *)&u32);
875  return true;
876  } else if (sizeof(double) == sizeof(uint64_t)) {
877  u64 = data.GetU64(&offset);
878  value = *((double *)&u64);
879  return true;
880  }
881  } else if (*byte_size == sizeof(long double)) {
882  if (sizeof(long double) == sizeof(uint32_t)) {
883  u32 = data.GetU32(&offset);
884  value = *((long double *)&u32);
885  return true;
886  } else if (sizeof(long double) == sizeof(uint64_t)) {
887  u64 = data.GetU64(&offset);
888  value = *((long double *)&u64);
889  return true;
890  }
891  }
892  }
893  break;
894  }
895  }
896  return false;
897 }
898 
899 bool CompilerType::SetValueFromScalar(const Scalar &value, Stream &strm) {
900  if (!IsValid())
901  return false;
902 
903  // Aggregate types don't have scalar values
904  if (!IsAggregateType()) {
905  strm.GetFlags().Set(Stream::eBinary);
906  uint64_t count = 0;
907  lldb::Encoding encoding = GetEncoding(count);
908 
909  if (encoding == lldb::eEncodingInvalid || count != 1)
910  return false;
911 
912  llvm::Optional<uint64_t> bit_width = GetBitSize(nullptr);
913  if (!bit_width)
914  return false;
915 
916  // This function doesn't currently handle non-byte aligned assignments
917  if ((*bit_width % 8) != 0)
918  return false;
919 
920  const uint64_t byte_size = (*bit_width + 7) / 8;
921  switch (encoding) {
923  break;
925  break;
926  case lldb::eEncodingUint:
927  switch (byte_size) {
928  case 1:
929  strm.PutHex8(value.UInt());
930  return true;
931  case 2:
932  strm.PutHex16(value.UInt());
933  return true;
934  case 4:
935  strm.PutHex32(value.UInt());
936  return true;
937  case 8:
938  strm.PutHex64(value.ULongLong());
939  return true;
940  default:
941  break;
942  }
943  break;
944 
945  case lldb::eEncodingSint:
946  switch (byte_size) {
947  case 1:
948  strm.PutHex8(value.SInt());
949  return true;
950  case 2:
951  strm.PutHex16(value.SInt());
952  return true;
953  case 4:
954  strm.PutHex32(value.SInt());
955  return true;
956  case 8:
957  strm.PutHex64(value.SLongLong());
958  return true;
959  default:
960  break;
961  }
962  break;
963 
965  if (byte_size <= sizeof(long double)) {
966  if (byte_size == sizeof(float)) {
967  strm.PutFloat(value.Float());
968  return true;
969  } else if (byte_size == sizeof(double)) {
970  strm.PutDouble(value.Double());
971  return true;
972  } else if (byte_size == sizeof(long double)) {
973  strm.PutDouble(value.LongDouble());
974  return true;
975  }
976  }
977  break;
978  }
979  }
980  return false;
981 }
982 
984  lldb::addr_t addr, AddressType address_type,
986  if (!IsValid())
987  return false;
988 
989  // Can't convert a file address to anything valid without more context (which
990  // Module it came from)
991  if (address_type == eAddressTypeFile)
992  return false;
993 
994  if (!GetCompleteType())
995  return false;
996 
997  auto byte_size =
998  GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
999  if (!byte_size)
1000  return false;
1001 
1002  if (data.GetByteSize() < *byte_size) {
1003  lldb::DataBufferSP data_sp(new DataBufferHeap(*byte_size, '\0'));
1004  data.SetData(data_sp);
1005  }
1006 
1007  uint8_t *dst = const_cast<uint8_t *>(data.PeekData(0, *byte_size));
1008  if (dst != nullptr) {
1009  if (address_type == eAddressTypeHost) {
1010  if (addr == 0)
1011  return false;
1012  // The address is an address in this process, so just copy it
1013  memcpy(dst, reinterpret_cast<uint8_t *>(addr), *byte_size);
1014  return true;
1015  } else {
1016  Process *process = nullptr;
1017  if (exe_ctx)
1018  process = exe_ctx->GetProcessPtr();
1019  if (process) {
1020  Status error;
1021  return process->ReadMemory(addr, dst, *byte_size, error) == *byte_size;
1022  }
1023  }
1024  }
1025  return false;
1026 }
1027 
1029  lldb::addr_t addr, AddressType address_type,
1030  StreamString &new_value) {
1031  if (!IsValid())
1032  return false;
1033 
1034  // Can't convert a file address to anything valid without more context (which
1035  // Module it came from)
1036  if (address_type == eAddressTypeFile)
1037  return false;
1038 
1039  if (!GetCompleteType())
1040  return false;
1041 
1042  auto byte_size =
1043  GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
1044  if (!byte_size)
1045  return false;
1046 
1047  if (*byte_size > 0) {
1048  if (address_type == eAddressTypeHost) {
1049  // The address is an address in this process, so just copy it
1050  memcpy((void *)addr, new_value.GetData(), *byte_size);
1051  return true;
1052  } else {
1053  Process *process = nullptr;
1054  if (exe_ctx)
1055  process = exe_ctx->GetProcessPtr();
1056  if (process) {
1057  Status error;
1058  return process->WriteMemory(addr, new_value.GetData(), *byte_size,
1059  error) == *byte_size;
1060  }
1061  }
1062  }
1063  return false;
1064 }
1065 
1067  const lldb_private::CompilerType &rhs) {
1068  return lhs.GetTypeSystem() == rhs.GetTypeSystem() &&
1069  lhs.GetOpaqueQualType() == rhs.GetOpaqueQualType();
1070 }
1071 
1073  const lldb_private::CompilerType &rhs) {
1074  return !(lhs == rhs);
1075 }
virtual bool IsAnonymousType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:56
An data extractor class.
Definition: DataExtractor.h:47
virtual size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type, const char *s, uint8_t *dst, size_t dst_size)=0
virtual CompilerType AddVolatileModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:80
virtual bool IsMeaninglessWithoutDynamicResolution(void *type)
Definition: TypeSystem.cpp:127
virtual void DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size)=0
Get and put data as binary instead of as the default string mode.
Definition: Stream.h:32
bool IsEnumerationType(bool &is_signed) const
CompilerType GetNonReferenceType() const
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
virtual CompilerType GetPointeeType(lldb::opaque_compiler_type_t type)=0
bool IsPointerOrReferenceType(CompilerType *pointee_type=nullptr) const
virtual bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t &count, bool &is_complex)=0
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Address is an address as found in an object or symbol file.
size_t PutHex16(uint16_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
Definition: Stream.cpp:290
bool IsFunctionPointerType() const
uint32_t GetU32(lldb::offset_t *offset_ptr) const
Extract a uint32_t value from *offset_ptr.
Flags & GetFlags()
The flags accessor.
Definition: Stream.cpp:235
bool ShouldTreatScalarValueAsAddress() const
virtual bool GetCompleteType(lldb::opaque_compiler_type_t type)=0
virtual bool ShouldTreatScalarValueAsAddress(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.h:427
uint32_t GetIndexOfChildWithName(const char *name, bool omit_empty_base_classes) const
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
void DumpValue(ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth)
virtual bool IsScalarType(lldb::opaque_compiler_type_t type)=0
size_t PutDouble(double d, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
Definition: Stream.cpp:365
virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetNonReferenceType(lldb::opaque_compiler_type_t type)=0
lldb::Format GetFormat() const
size_t ConvertStringToFloatValue(const char *s, uint8_t *dst, size_t dst_size) const
bool SetValueFromScalar(const Scalar &value, Stream &strm)
bool IsIntegerOrEnumerationType(bool &is_signed) const
virtual CompilerType GetLValueReferenceType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:66
virtual uint32_t IsHomogeneousAggregate(lldb::opaque_compiler_type_t type, CompilerType *base_type_ptr)=0
void * opaque_compiler_type_t
Definition: lldb-types.h:90
bool IsPointerToScalarType() const
uint32_t IsHomogeneousAggregate(CompilerType *base_type_ptr) const
TypeMemberFunctionImpl GetMemberFunctionAtIndex(size_t idx)
virtual bool IsCharType(lldb::opaque_compiler_type_t type)=0
size_t GetPointerByteSize() const
virtual void ForEachEnumerator(lldb::opaque_compiler_type_t type, std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback)
Definition: TypeSystem.h:274
virtual bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type, CompilerType *target_type, bool check_cplusplus, bool check_objc)=0
virtual CompilerType GetChildCompilerTypeAtIndex(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset, bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj, uint64_t &language_flags)=0
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t addr, AddressType address_type, StreamString &new_value)
CompilerType GetArrayType(uint64_t size) const
virtual void DumpTypeDescription(lldb::opaque_compiler_type_t type)=0
virtual lldb::TemplateArgumentKind GetTemplateArgumentKind(lldb::opaque_compiler_type_t type, size_t idx)
Definition: TypeSystem.cpp:108
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual void DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth)=0
virtual CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type, size_t idx)=0
virtual uint32_t GetNumDirectBaseClasses(lldb::opaque_compiler_type_t type)=0
const char * GetData() const
Definition: StreamString.h:43
llvm::Optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
uint32_t GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
static ClangASTContext * GetASTContext(clang::ASTContext *ast_ctx)
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const
CompilerType GetPointeeType() const
uint32_t GetNumFields() const
A subclass of DataBuffer that stores a data buffer on the heap.
CompilerType GetDirectBaseClassAtIndex(size_t idx, uint32_t *bit_offset_ptr) const
virtual CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type)=0
bool IsPointerType(CompilerType *pointee_type=nullptr) const
virtual CompilerType GetVirtualBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
virtual size_t GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type)=0
CompilerType AddConstModifier() const
bool IsVectorType(CompilerType *element_type, uint64_t *size) const
virtual lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type, uint64_t &count)=0
virtual bool IsDefined(lldb::opaque_compiler_type_t type)=0
bool operator==(const Address &lhs, const Address &rhs)
Definition: Address.cpp:973
virtual lldb::BasicType GetBasicTypeEnumeration(lldb::opaque_compiler_type_t type)=0
bool DumpTypeValue(Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope)
lldb::opaque_compiler_type_t GetOpaqueQualType() const
Definition: CompilerType.h:165
virtual uint32_t GetTypeInfo(lldb::opaque_compiler_type_t type, CompilerType *pointee_or_element_compiler_type)=0
bool IsArrayType(CompilerType *element_type, uint64_t *size, bool *is_incomplete) const
#define UINT32_MAX
Definition: lldb-defines.h:31
virtual CompilerType GetTypedefedType(lldb::opaque_compiler_type_t type)=0
bool IsMeaninglessWithoutDynamicResolution() const
bool IsFloatingPointType(uint32_t &count, bool &is_complex) const
virtual bool IsEnumerationType(lldb::opaque_compiler_type_t type, bool &is_signed)
Definition: TypeSystem.h:167
unsigned GetTypeQualifiers() const
virtual bool IsVectorType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size)=0
void DumpSummary(ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size)
LanguageType
Programming language type.
uint32_t GetNumVirtualBaseClasses() const
CompilerType GetFunctionArgumentTypeAtIndex(size_t idx) const
lldb::LanguageType GetMinimumLanguage()
lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order)
Set data with a buffer that is caller owned.
virtual uint32_t GetNumVirtualBaseClasses(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetTypeForFormatters(void *type)
Definition: TypeSystem.cpp:99
virtual bool IsFunctionType(lldb::opaque_compiler_type_t type, bool *is_variadic_ptr)=0
llvm::Optional< IntegralTemplateArgument > GetIntegralTemplateArgument(size_t idx) const
Address is an address in the process that is running this code.
uint64_t offset_t
Definition: lldb-types.h:87
lldb::TypeClass GetTypeClass() const
virtual CompilerType GetArrayType(lldb::opaque_compiler_type_t type, uint64_t size)
Definition: TypeSystem.cpp:60
virtual LLVM_DUMP_METHOD void dump(lldb::opaque_compiler_type_t type) const =0
Convenience LLVM-style dump method for use in the debugger only.
TypeSystem * GetTypeSystem() const
Definition: CompilerType.h:150
double Double(double fail_value=0.0) const
Definition: Scalar.cpp:1679
bool IsReferenceType(CompilerType *pointee_type=nullptr, bool *is_rvalue=nullptr) const
virtual bool IsCStringType(lldb::opaque_compiler_type_t type, uint32_t &length)=0
void SetCompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type)
virtual bool IsCompleteType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type)=0
virtual uint32_t GetNumChildren(lldb::opaque_compiler_type_t type, bool omit_empty_base_classes, const ExecutionContext *exe_ctx)=0
int SInt(int fail_value=0) const
Definition: Scalar.cpp:1424
bool IsRuntimeGeneratedType() const
virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type)=0
uint32_t GetIndexOfFieldWithName(const char *name, CompilerType *field_compiler_type=nullptr, uint64_t *bit_offset_ptr=nullptr, uint32_t *bitfield_bit_size_ptr=nullptr, bool *is_bitfield_ptr=nullptr) const
virtual bool IsAggregateType(lldb::opaque_compiler_type_t type)=0
size_t GetNumMemberFunctions() const
virtual uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes)=0
unsigned long long ULongLong(unsigned long long fail_value=0) const
Definition: Scalar.cpp:1566
size_t GetNumberOfFunctionArguments() const
LLVM_DUMP_METHOD void dump() const
Convenience LLVM-style dump method for use in the debugger only.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual bool IsReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool *is_rvalue)=0
size_t PutHex32(uint32_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
Definition: Stream.cpp:306
A plug-in interface definition class for debugging a process.
Definition: Process.h:353
Process * GetProcessPtr() const
Returns a pointer to the process object.
size_t GetIndexOfChildMemberWithName(const char *name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes) const
virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type)=0
size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
Write memory to a process.
Definition: Process.cpp:2208
float Float(float fail_value=0.0f) const
Definition: Scalar.cpp:1651
virtual lldb::Format GetFormat(lldb::opaque_compiler_type_t type)=0
ConstString GetDisplayTypeName() const
virtual uint32_t GetNumFields(lldb::opaque_compiler_type_t type)=0
size_t PutHex64(uint64_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
Definition: Stream.cpp:322
virtual bool IsBlockPointerType(lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr)=0
virtual CompilerType GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type)=0
ValueType Set(ValueType mask)
Set one or more flags by logical OR&#39;ing mask with the current flags.
Definition: Flags.h:84
long double LongDouble(long double fail_value=0.0) const
Definition: Scalar.cpp:1707
ConstString GetConstQualifiedTypeName() const
virtual CompilerType GetFunctionReturnType(lldb::opaque_compiler_type_t type)=0
unsigned int UInt(unsigned int fail_value=0) const
Definition: Scalar.cpp:1452
virtual llvm::Optional< CompilerType::IntegralTemplateArgument > GetIntegralTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx)
Definition: TypeSystem.cpp:118
CompilerType GetPointerType() const
CompilerType GetLValueReferenceType() const
virtual bool DumpTypeValue(lldb::opaque_compiler_type_t type, Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope)=0
virtual TypeMemberFunctionImpl GetMemberFunctionAtIndex(lldb::opaque_compiler_type_t type, size_t idx)=0
virtual int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type)=0
int64_t GetMaxS64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an signed integer of size byte_size from *offset_ptr.
bool operator!=(const Address &lhs, const Address &rhs)
Definition: Address.cpp:979
CompilerType GetChildCompilerTypeAtIndex(ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset, bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj, uint64_t &language_flags) const
virtual bool IsPointerType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type)=0
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
CompilerType AddVolatileModifier() const
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
virtual bool IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type)=0
uint32_t GetNumDirectBaseClasses() const
virtual unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type)=0
CompilerType GetCanonicalType() const
bool IsCStringType(uint32_t &length) const
virtual lldb::LanguageType GetMinimumLanguage(lldb::opaque_compiler_type_t type)=0
size_t GetNumTemplateArguments() const
virtual bool IsConst(lldb::opaque_compiler_type_t type)=0
lldb::Encoding GetEncoding(uint64_t &count) const
CompilerType GetArrayElementType(uint64_t *stride=nullptr) const
virtual CompilerType AddRestrictModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:85
LazyBool ShouldPrintAsOneLiner(ValueObject *valobj) const
virtual bool IsBeingDefined(lldb::opaque_compiler_type_t type)=0
uint64_t addr_t
Definition: lldb-types.h:83
virtual bool IsTypedefType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType AddConstModifier(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:75
size_t size_t PutHex8(uint8_t uvalue)
Append an uint8_t value in the hexadecimal format to the stream.
Definition: Stream.cpp:284
A uniqued constant string class.
Definition: ConstString.h:38
virtual CompilerType GetArrayElementType(lldb::opaque_compiler_type_t type, uint64_t *stride)=0
virtual CompilerType CreateTypedef(lldb::opaque_compiler_type_t type, const char *name, const CompilerDeclContext &decl_ctx)
Definition: TypeSystem.cpp:89
llvm::Optional< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
CompilerType CreateTypedef(const char *name, const CompilerDeclContext &decl_ctx) const
virtual CompilerType GetDirectBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr)=0
Non-standardized C, such as K&R.
CompilerType GetFullyUnqualifiedType() const
Definition: SBAddress.h:15
CompilerType GetFunctionReturnType() const
long long SLongLong(long long fail_value=0) const
Definition: Scalar.cpp:1536
lldb::TemplateArgumentKind GetTemplateArgumentKind(size_t idx) const
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
int GetFunctionArgumentCount() const
CompilerType GetTypedefedType() const
virtual bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed)=0
CompilerType GetTypeTemplateArgument(size_t idx) const
CompilerType GetRValueReferenceType() const
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
bool IsIntegerType(bool &is_signed) const
virtual bool IsPolymorphicClass(lldb::opaque_compiler_type_t type)=0
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr) const
size_t GetTypeBitAlign() const
virtual bool IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, bool *is_incomplete)=0
CompilerType GetVirtualBaseClassAtIndex(size_t idx, uint32_t *bit_offset_ptr) const
virtual uint32_t GetPointerByteSize()=0
bool IsFunctionType(bool *is_variadic_ptr=nullptr) const
ConstString GetConstTypeName() const
virtual llvm::Optional< uint64_t > GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)=0
virtual CompilerType GetPointerType(lldb::opaque_compiler_type_t type)=0
CompilerType GetTypeForFormatters() const
ConstString GetTypeName() const
virtual CompilerType GetTypeTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx)
Definition: TypeSystem.cpp:112
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
virtual size_t GetIndexOfChildMemberWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes)=0
virtual bool IsFunctionPointerType(lldb::opaque_compiler_type_t type)=0
virtual CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index)=0
ExecutionContextScope * GetBestExecutionContextScope() const
lldb::BasicType GetBasicTypeEnumeration() const
virtual size_t GetTypeBitAlign(lldb::opaque_compiler_type_t type)=0
CompilerType AddRestrictModifier() const
virtual CompilerType GetRValueReferenceType(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:71
bool GetValueAsScalar(const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, Scalar &value) const
size_t PutFloat(float f, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
Definition: Stream.cpp:358
virtual size_t GetNumMemberFunctions(lldb::opaque_compiler_type_t type)=0
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t addr, AddressType address_type, DataExtractor &data)
uint64_t GetU64(lldb::offset_t *offset_ptr) const
Extract a uint64_t value from *offset_ptr.
virtual size_t GetNumTemplateArguments(lldb::opaque_compiler_type_t type)
Definition: TypeSystem.cpp:103
An error handling class.
Definition: Status.h:44
const uint8_t * PeekData(lldb::offset_t offset, lldb::offset_t length) const
Peek at a bytes at offset.
virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj)
Definition: TypeSystem.cpp:123
virtual CompilerType GetFieldAtIndex(lldb::opaque_compiler_type_t type, size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr)=0
virtual bool IsVoidType(lldb::opaque_compiler_type_t type)=0
virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
Read of memory from a process.
Definition: Process.cpp:1966