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 llvm::Expected<ChildTypeInfo> child_or_err =
103 omit_empty_base_classes,
104 ignore_array_bounds, value_object);
114 if (!struct_pointer_sp) {
119 ValueObjectSP struct_sp = struct_pointer_sp->Dereference(err);
121 if (!struct_sp || !err.
Success()) {
137 llvm::Expected<size_t>
140 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
142 const bool omit_empty_base_classes =
false;
144 omit_empty_base_classes);
158 if (!synthetic_children) {
162 synthetic_children->
Update();
164 static constexpr llvm::StringLiteral s_FuncPtr_name(
"__FuncPtr");
183 child_sp->GetQualifiedRepresentationIfAvailable(
186 const char *child_value =
187 qualified_child_representation_sp->GetValueAsCString();
189 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.
"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...
virtual llvm::Expected< size_t > GetIndexOfChildWithName(llvm::StringRef name)
Determine the index of a named child.
SyntheticChildrenFrontEnd(ValueObject &backend)
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, ValueObjectManager *manager=nullptr)
These routines create ValueObjectConstResult ValueObjects from various data sources.
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
A child of a type, as returned by CompilerType::GetChildAtIndex.