28 namespace formatters {
34 CompilerType block_pointer_type(m_backend.GetCompilerType());
38 TargetSP target_sp(m_backend.GetTargetSP());
44 auto type_system_or_err = target_sp->GetScratchTypeSystemForLanguage(
46 if (
auto err = type_system_or_err.takeError()) {
48 "Failed to get scratch TypeSystemClang");
53 llvm::cast<TypeSystemClang>(block_pointer_type.
GetTypeSystem());
55 std::shared_ptr<ClangASTImporter> clang_ast_importer;
56 auto *state = target_sp->GetPersistentExpressionStateForLanguage(
59 auto *persistent_vars = llvm::cast<ClangPersistentVariables>(state);
60 clang_ast_importer = persistent_vars->GetClangASTImporter();
63 if (!clang_ast_importer) {
67 const char *
const isa_name(
"__isa");
70 const char *
const flags_name(
"__flags");
73 const char *
const reserved_name(
"__reserved");
76 const char *
const FuncPtr_name(
"__FuncPtr");
80 {flags_name, flags_type},
81 {reserved_name, reserved_type},
82 {FuncPtr_name, function_pointer_type}});
88 const bool omit_empty_base_classes =
false;
89 return m_block_struct_type.GetNumChildren(omit_empty_base_classes,
nullptr);
93 if (!m_block_struct_type.IsValid()) {
94 return lldb::ValueObjectSP();
98 return lldb::ValueObjectSP();
101 const bool thread_and_frame_only_if_stopped =
true;
103 thread_and_frame_only_if_stopped);
104 const bool transparent_pointers =
false;
105 const bool omit_empty_base_classes =
false;
106 const bool ignore_array_bounds =
false;
111 int32_t child_byte_offset = 0;
112 uint32_t child_bitfield_bit_size = 0;
113 uint32_t child_bitfield_bit_offset = 0;
114 bool child_is_base_class =
false;
115 bool child_is_deref_of_parent =
false;
116 uint64_t language_flags = 0;
120 &exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
121 ignore_array_bounds, child_name, child_byte_size, child_byte_offset,
122 child_bitfield_bit_size, child_bitfield_bit_offset,
123 child_is_base_class, child_is_deref_of_parent, value_object,
126 ValueObjectSP struct_pointer_sp =
127 m_backend.Cast(m_block_struct_type.GetPointerType());
129 if (!struct_pointer_sp) {
130 return lldb::ValueObjectSP();
134 ValueObjectSP struct_sp = struct_pointer_sp->Dereference(err);
136 if (!struct_sp || !err.
Success()) {
137 return lldb::ValueObjectSP();
140 ValueObjectSP child_sp(struct_sp->GetSyntheticChildAtOffset(
141 child_byte_offset, child_type,
true,
142 ConstString(child_name.c_str(), child_name.size())));
155 if (!m_block_struct_type.IsValid())
158 const bool omit_empty_base_classes =
false;
159 return m_block_struct_type.GetIndexOfChildWithName(name.
AsCString(),
160 omit_empty_base_classes);
174 if (!synthetic_children) {
178 synthetic_children->
Update();
180 static const ConstString s_FuncPtr_name(
"__FuncPtr");
189 lldb::ValueObjectSP qualified_child_representation_sp =
190 child_sp->GetQualifiedRepresentationIfAvailable(
193 const char *child_value =
194 qualified_child_representation_sp->GetValueAsCString();
196 s.
Printf(
"%s", child_value);