9#include "clang/AST/DeclCXX.h"
34 if (type_flags.
AllClear(eTypeHasValue)) {
39 if (type_flags.
AllSet(eTypeIsPointer)) {
42 if (pointee_flags.
AllSet(eTypeIsPointer)) {
45 ptr_value = process_sp->ReadPointerFromMemory(ptr_value,
error);
65 size_t ptr_size = process_sp->GetAddressByteSize();
70 uint64_t code = process_sp->ReadUnsignedIntegerFromMemory(code_location,
76 process_sp->ReadPointerFromMemory(domain_location,
error);
80 if (!domain_str_value) {
81 stream.
Printf(
"domain: nil - code: %" PRIu64, code);
86 TypeSystemClangSP scratch_ts_sp =
92 "domain_str", isw.
GetAsData(process_sp->GetByteOrder()),
101 !domain_str_summary.
Empty()) {
102 stream.
Printf(
"domain: %s - code: %" PRIu64, domain_str_summary.
GetData(),
106 stream.
Printf(
"domain: nil - code: %" PRIu64, code);
130 return lldb::ValueObjectSP();
149 size_t ptr_size = process_sp->GetAddressByteSize();
151 userinfo_location += 4 * ptr_size;
154 process_sp->ReadPointerFromMemory(userinfo_location,
error);
158 TypeSystemClangSP scratch_ts_sp =
163 "_userInfo", isw.
GetAsData(process_sp->GetByteOrder()),
173 if (name == g_userInfo)
192 lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
202 if (!descriptor.get() || !descriptor->IsValid())
205 const char *class_name = descriptor->GetClassName().GetCString();
207 if (!class_name || !*class_name)
210 if (!strcmp(class_name,
"NSError"))
212 else if (!strcmp(class_name,
"__NSCFError"))
static llvm::raw_ostream & error(Stream &strm)
static lldb::addr_t DerefToNSErrorPointer(ValueObject &valobj)
size_t CalculateNumChildren() override
ValueObject * m_child_ptr
bool MightHaveChildren() override
~NSErrorSyntheticFrontEnd() override=default
lldb::ValueObjectSP GetChildAtIndex(size_t idx) override
size_t GetIndexOfChildWithName(ConstString name) override
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)
CompilerType GetCompilerType()
lldb::ValueObjectSP GetSP()
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()
virtual ValueObject * GetParent()
const ExecutionContextRef & GetExecutionContextRef() const
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.