22#include "llvm/Support/ErrorExtras.h"
31 if (type_flags.
AllClear(eTypeHasValue)) {
36 if (type_flags.
AllSet(eTypeIsPointer)) {
39 if (pointee_flags.
AllSet(eTypeIsPointer)) {
42 ptr_value = process_sp->ReadPointerFromMemory(ptr_value,
error);
62 size_t ptr_size = process_sp->GetAddressByteSize();
67 int64_t code = process_sp->ReadSignedIntegerFromMemory(code_location,
73 process_sp->ReadPointerFromMemory(domain_location,
error);
77 if (!domain_str_value) {
78 stream.
Printf(
"domain: nil - code: %" PRIi64, code);
89 "domain_str", isw.
GetAsData(process_sp->GetByteOrder()),
98 !domain_str_summary.
Empty()) {
99 stream.
Printf(
"domain: %s - code: %" PRIi64, domain_str_summary.
GetData(),
103 stream.
Printf(
"domain: nil - code: %" PRIi64, code);
146 size_t ptr_size = process_sp->GetAddressByteSize();
148 userinfo_location += 4 * ptr_size;
151 process_sp->ReadPointerFromMemory(userinfo_location,
error);
160 "_userInfo", isw.
GetAsData(process_sp->GetByteOrder()),
168 if (name == g_userInfo)
170 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
197 if (!descriptor.get() || !descriptor->IsValid())
200 const char *class_name = descriptor->GetClassName().GetCString();
202 if (!class_name || !*class_name)
205 if (!strcmp(class_name,
"NSError"))
207 else if (!strcmp(class_name,
"__NSCFError"))
static llvm::raw_ostream & error(Stream &strm)
static lldb::addr_t DerefToNSErrorPointer(ValueObject &valobj)
llvm::Expected< uint32_t > CalculateNumChildren() override
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
ValueObject * m_child_ptr
~NSErrorSyntheticFrontEnd() override=default
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
llvm::Expected< size_t > GetIndexOfChildWithName(ConstString name) override
Determine the index of a named child.
NSErrorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
Generic representation of a type in a programming language.
CompilerType GetPointeeType() const
If this type is a pointer type, return the type that the pointer points to, else return an invalid ty...
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
A uniqued constant string class.
bool AllClear(ValueType mask) const
Test if all bits in mask are clear.
bool AllSet(ValueType mask) const
Test if all bits in mask are 1 in the current flags.
std::shared_ptr< ClassDescriptor > ClassDescriptorSP
static ObjCLanguageRuntime * Get(Process &process)
virtual ClassDescriptorSP GetClassDescriptor(ValueObject &in_value)
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
const char * GetData() const
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.
lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
SyntheticChildrenFrontEnd(ValueObject &backend)
lldb::ProcessSP GetProcessSP() const
virtual uint64_t GetValueAsUnsigned(uint64_t fail_value, bool *success=nullptr)
static lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
virtual bool IsBaseClass()
CompilerType GetCompilerType()
virtual ValueObject * GetParent()
const ExecutionContextRef & GetExecutionContextRef() const
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
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
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP