9#include "clang/AST/DeclCXX.h"
41 if (type_flags.
AllClear(eTypeHasValue)) {
50 size_t ptr_size = process_sp->GetAddressByteSize();
53 auto name = process_sp->ReadPointerFromMemory(ptr + 1 * ptr_size,
error);
56 auto reason = process_sp->ReadPointerFromMemory(ptr + 2 * ptr_size,
error);
59 auto userinfo = process_sp->ReadPointerFromMemory(ptr + 3 * ptr_size,
error);
62 auto reserved = process_sp->ReadPointerFromMemory(ptr + 4 * ptr_size,
error);
81 "name", name_isw.
GetAsData(process_sp->GetByteOrder()),
85 "reason", reason_isw.
GetAsData(process_sp->GetByteOrder()),
89 "userInfo", userinfo_isw.
GetAsData(process_sp->GetByteOrder()),
93 "reserved", reserved_isw.
GetAsData(process_sp->GetByteOrder()),
102 if (!
ExtractFields(valobj,
nullptr, &reason_sp,
nullptr,
nullptr))
106 stream.
Printf(
"No reason");
112 !reason_str_summary.
Empty()) {
163 if (name == g_name)
return 0;
164 if (name == g_reason)
return 1;
165 if (name == g_userInfo)
return 2;
166 if (name == g_reserved)
return 3;
190 if (!descriptor.get() || !descriptor->IsValid())
193 const char *class_name = descriptor->GetClassName().GetCString();
195 if (!class_name || !*class_name)
198 if (!strcmp(class_name,
"NSException"))
200 else if (!strcmp(class_name,
"NSCFException"))
202 else if (!strcmp(class_name,
"__NSCFException"))
static llvm::raw_ostream & error(Stream &strm)
static bool ExtractFields(ValueObject &valobj, ValueObjectSP *name_sp, ValueObjectSP *reason_sp, ValueObjectSP *userinfo_sp, ValueObjectSP *reserved_sp)
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
ValueObjectSP m_userinfo_sp
llvm::Expected< uint32_t > CalculateNumChildren() override
size_t GetIndexOfChildWithName(ConstString name) override
~NSExceptionSyntheticFrontEnd() override=default
ValueObjectSP m_reserved_sp
bool MightHaveChildren() override
ValueObjectSP m_reason_sp
NSExceptionSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Generic representation of a type in a programming language.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
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.
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.
CompilerType GetCompilerType()
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.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
@ eReuse
Children did not change and don't need to be recomputed; re-use what we computed the last time we cal...
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP