23#include "llvm/Support/ErrorExtras.h"
46 auto type_system_or_err = target_sp->GetScratchTypeSystemForLanguage(
48 if (
auto err = type_system_or_err.takeError()) {
50 "Failed to get scratch TypeSystemClang: {0}");
54 auto clang_ast_context =
56 if (!clang_ast_context)
59 const char *
const isa_name(
"__isa");
62 const char *
const flags_name(
"__flags");
65 const char *
const reserved_name(
"__reserved");
68 const char *
const FuncPtr_name(
"__FuncPtr");
71 llvm::StringRef(), {{isa_name, isa_type},
72 {flags_name, flags_type},
73 {reserved_name, reserved_type},
74 {FuncPtr_name, function_pointer_type}});
80 const bool omit_empty_base_classes =
false;
93 const bool thread_and_frame_only_if_stopped =
true;
95 thread_and_frame_only_if_stopped);
96 const bool transparent_pointers =
false;
97 const bool omit_empty_base_classes =
false;
98 const bool ignore_array_bounds =
false;
101 std::string child_name;
102 uint32_t child_byte_size = 0;
103 int32_t child_byte_offset = 0;
104 uint32_t child_bitfield_bit_size = 0;
105 uint32_t child_bitfield_bit_offset = 0;
106 bool child_is_base_class =
false;
107 bool child_is_deref_of_parent =
false;
108 uint64_t language_flags = 0;
111 &exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
112 ignore_array_bounds, child_name, child_byte_size, child_byte_offset,
113 child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
114 child_is_deref_of_parent, value_object, language_flags);
115 if (!child_type_or_err)
124 if (!struct_pointer_sp) {
129 ValueObjectSP struct_sp = struct_pointer_sp->Dereference(err);
131 if (!struct_sp || !err.
Success()) {
136 child_byte_offset, child_type,
true,
137 ConstString(child_name.c_str(), child_name.size())));
150 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
152 const bool omit_empty_base_classes =
false;
154 omit_empty_base_classes);
168 if (!synthetic_children) {
172 synthetic_children->
Update();
174 static const ConstString s_FuncPtr_name(
"__FuncPtr");
193 child_sp->GetQualifiedRepresentationIfAvailable(
196 const char *child_value =
197 qualified_child_representation_sp->GetValueAsCString();
199 s.
Printf(
"%s", child_value);
#define LLDB_LOG_ERROR(log, error,...)
Generic representation of a type in a programming language.
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr=nullptr) const
A uniqued constant string class.
const char * AsCString(const char *value_if_empty) const
Get the string value as a C string.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
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.
uint32_t CalculateNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
virtual lldb::ValueObjectSP GetChildAtIndex(uint32_t idx)=0
virtual lldb::ChildCacheState Update()=0
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
SyntheticChildrenFrontEnd(ValueObject &backend)
virtual llvm::Expected< size_t > GetIndexOfChildWithName(ConstString name)
Determine the index of a named child.
A TypeSystem implementation based on Clang.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
lldb::ValueObjectSP GetSP()
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.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
@ eLanguageTypeC_plus_plus
ISO C++:1998.
std::shared_ptr< lldb_private::Target > TargetSP