44 auto type_system_or_err = target_sp->GetScratchTypeSystemForLanguage(
46 if (
auto err = type_system_or_err.takeError()) {
48 "Failed to get scratch TypeSystemClang");
54 if (!clang_ast_context)
57 std::shared_ptr<ClangASTImporter> clang_ast_importer;
58 auto *state = target_sp->GetPersistentExpressionStateForLanguage(
61 auto *persistent_vars = llvm::cast<ClangPersistentVariables>(state);
62 clang_ast_importer = persistent_vars->GetClangASTImporter();
65 if (!clang_ast_importer) {
69 const char *
const isa_name(
"__isa");
72 const char *
const flags_name(
"__flags");
75 const char *
const reserved_name(
"__reserved");
78 const char *
const FuncPtr_name(
"__FuncPtr");
82 {flags_name, flags_type},
83 {reserved_name, reserved_type},
84 {FuncPtr_name, function_pointer_type}});
90 const bool omit_empty_base_classes =
false;
96 return lldb::ValueObjectSP();
100 return lldb::ValueObjectSP();
103 const bool thread_and_frame_only_if_stopped =
true;
105 thread_and_frame_only_if_stopped);
106 const bool transparent_pointers =
false;
107 const bool omit_empty_base_classes =
false;
108 const bool ignore_array_bounds =
false;
111 std::string child_name;
113 int32_t child_byte_offset = 0;
114 uint32_t child_bitfield_bit_size = 0;
115 uint32_t child_bitfield_bit_offset = 0;
116 bool child_is_base_class =
false;
117 bool child_is_deref_of_parent =
false;
118 uint64_t language_flags = 0;
122 &exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
123 ignore_array_bounds, child_name, child_byte_size, child_byte_offset,
124 child_bitfield_bit_size, child_bitfield_bit_offset,
125 child_is_base_class, child_is_deref_of_parent, value_object,
128 ValueObjectSP struct_pointer_sp =
131 if (!struct_pointer_sp) {
132 return lldb::ValueObjectSP();
136 ValueObjectSP struct_sp = struct_pointer_sp->Dereference(err);
138 if (!struct_sp || !err.
Success()) {
139 return lldb::ValueObjectSP();
142 ValueObjectSP child_sp(struct_sp->GetSyntheticChildAtOffset(
143 child_byte_offset, child_type,
true,
144 ConstString(child_name.c_str(), child_name.size())));
160 const bool omit_empty_base_classes =
false;
162 omit_empty_base_classes);
176 if (!synthetic_children) {
180 synthetic_children->
Update();
182 static const ConstString s_FuncPtr_name(
"__FuncPtr");
191 lldb::ValueObjectSP qualified_child_representation_sp =
192 child_sp->GetQualifiedRepresentationIfAvailable(
195 const char *child_value =
196 qualified_child_representation_sp->GetValueAsCString();
198 s.
Printf(
"%s", child_value);
#define LLDB_LOG_ERROR(log, error,...)
std::shared_ptr< TypeSystemType > dyn_cast_or_null()
Return a shared_ptr<TypeSystemType> if dyn_cast succeeds.
Generic representation of a type in a programming language.
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
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
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
uint32_t GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr=nullptr) const
uint32_t GetIndexOfChildWithName(const char *name, bool omit_empty_base_classes) const
Lookup a child given a name.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const
Create an ExecutionContext object from this object.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool Success() const
Test for success condition.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
virtual size_t GetIndexOfChildWithName(ConstString name)=0
virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx)=0
A TypeSystem implementation based on Clang.
virtual lldb::ValueObjectSP Cast(const CompilerType &compiler_type)
CompilerType GetCompilerType()
lldb::ValueObjectSP GetSP()
lldb::TargetSP GetTargetSP() const
const ExecutionContextRef & GetExecutionContextRef() const
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
@ eLanguageTypeC_plus_plus
ISO C++:1998.