9#ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_APPLEOBJCRUNTIME_APPLEOBJCRUNTIMEV2_H
10#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_APPLEOBJCRUNTIME_APPLEOBJCRUNTIMEV2_H
22#include "llvm/ADT/BitVector.h"
45 bool isA(
const void *ClassID)
const override {
50 return runtime->
isA(&
ID);
59 llvm::Expected<std::unique_ptr<UtilityFunction>>
69 const char *ivar_name)
override;
114 bool throw_bp)
override;
143 uint64_t objc_debug_isa_class_mask,
144 uint64_t objc_debug_isa_magic_mask,
145 uint64_t objc_debug_isa_magic_value,
146 uint64_t objc_debug_indexed_isa_magic_mask,
147 uint64_t objc_debug_indexed_isa_magic_value,
148 uint64_t objc_debug_indexed_isa_index_mask,
149 uint64_t objc_debug_indexed_isa_index_shift,
155 std::map<ObjCISA, ObjCLanguageRuntime::ClassDescriptorSP>
m_cache;
206 uint32_t objc_debug_taggedpointer_slot_shift,
207 uint32_t objc_debug_taggedpointer_slot_mask,
208 uint32_t objc_debug_taggedpointer_payload_lshift,
209 uint32_t objc_debug_taggedpointer_payload_rshift,
212 typedef std::map<uint8_t, ObjCLanguageRuntime::ClassDescriptorSP>
Cache;
239 uint64_t objc_debug_taggedpointer_ext_mask,
240 uint32_t objc_debug_taggedpointer_slot_shift,
241 uint32_t objc_debug_taggedpointer_ext_slot_shift,
242 uint32_t objc_debug_taggedpointer_slot_mask,
243 uint32_t objc_debug_taggedpointer_ext_slot_mask,
244 uint32_t objc_debug_taggedpointer_payload_lshift,
245 uint32_t objc_debug_taggedpointer_payload_rshift,
246 uint32_t objc_debug_taggedpointer_ext_payload_lshift,
247 uint32_t objc_debug_taggedpointer_ext_payload_rshift,
253 typedef std::map<uint8_t, ObjCLanguageRuntime::ClassDescriptorSP>
Cache;
304 return {
true,
false, found};
357 std::unique_ptr<UtilityFunction>
359 std::string code, std::string name);
382 std::unique_ptr<UtilityFunction>
391 static std::unique_ptr<SharedCacheImageHeaders>
431 uint32_t num_class_infos);
A section + offset based address class.
void UpdateSignature(const RemoteNXMapTable &hash_table)
bool NeedsUpdate(Process *process, AppleObjCRuntimeV2 *runtime, RemoteNXMapTable &hash_table)
lldb::addr_t m_buckets_ptr
lldb::ModuleWP m_objc_module_wp
uint64_t m_objc_debug_isa_magic_value
std::vector< lldb::addr_t > m_indexed_isa_cache
uint64_t m_objc_debug_isa_magic_mask
uint64_t m_objc_debug_indexed_isa_magic_mask
bool EvaluateNonPointerISA(ObjCISA isa, ObjCISA &ret_isa)
ObjCLanguageRuntime::ClassDescriptorSP GetClassDescriptor(ObjCISA isa)
lldb::addr_t m_objc_indexed_classes
uint64_t m_objc_debug_indexed_isa_index_mask
uint64_t m_objc_debug_indexed_isa_magic_value
static NonPointerISACache * CreateInstance(AppleObjCRuntimeV2 &runtime, const lldb::ModuleSP &objc_module_sp)
NonPointerISACache(const NonPointerISACache &)=delete
uint64_t m_objc_debug_indexed_isa_index_shift
const NonPointerISACache & operator=(const NonPointerISACache &)=delete
AppleObjCRuntimeV2 & m_runtime
std::map< ObjCISA, ObjCLanguageRuntime::ClassDescriptorSP > m_cache
uint64_t m_objc_debug_isa_class_mask
uint64_t m_objc_debug_taggedpointer_ext_mask
uint32_t m_objc_debug_taggedpointer_ext_slot_shift
ObjCLanguageRuntime::ClassDescriptorSP GetClassDescriptor(lldb::addr_t ptr) override
Cache::iterator CacheIterator
lldb::addr_t m_objc_debug_taggedpointer_ext_classes
uint32_t m_objc_debug_taggedpointer_ext_payload_lshift
uint32_t m_objc_debug_taggedpointer_ext_slot_mask
uint32_t m_objc_debug_taggedpointer_ext_payload_rshift
std::map< uint8_t, ObjCLanguageRuntime::ClassDescriptorSP > Cache
const TaggedPointerVendorExtended & operator=(const TaggedPointerVendorExtended &)=delete
bool IsPossibleExtendedTaggedPointer(lldb::addr_t ptr)
TaggedPointerVendorExtended(const TaggedPointerVendorExtended &)=delete
bool IsPossibleTaggedPointer(lldb::addr_t ptr) override
ObjCLanguageRuntime::ClassDescriptorSP GetClassDescriptor(lldb::addr_t ptr) override
const TaggedPointerVendorLegacy & operator=(const TaggedPointerVendorLegacy &)=delete
TaggedPointerVendorLegacy(AppleObjCRuntimeV2 &runtime)
TaggedPointerVendorLegacy(const TaggedPointerVendorLegacy &)=delete
const TaggedPointerVendorRuntimeAssisted & operator=(const TaggedPointerVendorRuntimeAssisted &)=delete
Cache::iterator CacheIterator
ObjCLanguageRuntime::ClassDescriptorSP GetClassDescriptor(lldb::addr_t ptr) override
lldb::addr_t m_objc_debug_taggedpointer_classes
TaggedPointerVendorRuntimeAssisted(const TaggedPointerVendorRuntimeAssisted &)=delete
uint32_t m_objc_debug_taggedpointer_slot_mask
std::map< uint8_t, ObjCLanguageRuntime::ClassDescriptorSP > Cache
uint32_t m_objc_debug_taggedpointer_payload_rshift
uint32_t m_objc_debug_taggedpointer_payload_lshift
uint32_t m_objc_debug_taggedpointer_slot_shift
bool IsPossibleTaggedPointer(lldb::addr_t ptr) override
uint64_t m_objc_debug_taggedpointer_mask
~TaggedPointerVendorV2() override=default
AppleObjCRuntimeV2 & m_runtime
TaggedPointerVendorV2(const TaggedPointerVendorV2 &)=delete
static TaggedPointerVendorV2 * CreateInstance(AppleObjCRuntimeV2 &runtime, const lldb::ModuleSP &objc_module_sp)
TaggedPointerVendorV2(AppleObjCRuntimeV2 &runtime)
const TaggedPointerVendorV2 & operator=(const TaggedPointerVendorV2 &)=delete
llvm::Expected< std::unique_ptr< UtilityFunction > > CreateObjectChecker(std::string name, ExecutionContext &exe_ctx) override
bool m_has_objc_getRealizedClassList_trylock
bool IsTaggedPointer(lldb::addr_t ptr) override
uint32_t ParseClassInfoArray(const lldb_private::DataExtractor &data, uint32_t num_class_infos)
bool RealizedClassGenerationCountChanged()
Update the generation count of realized classes.
void SetRelativeSelectorBaseAddr(lldb::addr_t relative_selector_base)
static llvm::StringRef GetPluginNameStatic()
EncodingToTypeSP GetEncodingToType() override
ObjCISA GetPointerISA(ObjCISA isa)
~AppleObjCRuntimeV2() override=default
TaggedPointerVendor * GetTaggedPointerVendor() override
NonPointerISACache * GetNonPointerIsaCache()
std::once_flag m_no_expanded_cache_warning
size_t GetByteOffsetForIvar(CompilerType &parent_ast_type, const char *ivar_name) override
StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc) override
Language runtime plugins can use this API to report language-specific runtime information about this ...
lldb::addr_t m_isa_hash_table_ptr
HashTableSignature m_hash_signature
bool m_has_object_getClass
SharedCacheClassInfoExtractor m_shared_cache_class_info_extractor
DynamicClassInfoExtractor m_dynamic_class_info_extractor
ObjCRuntimeVersions GetRuntimeVersion() const override
lldb::addr_t GetISAHashTablePointer()
ClassDescriptorSP GetClassDescriptorFromISA(ObjCISA isa) override
static bool classof(const LanguageRuntime *runtime)
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type) override
bool isA(const void *ClassID) const override
@ eExpressionExecutionFailure
std::unique_ptr< SharedCacheImageHeaders > m_shared_cache_image_headers_up
lldb::addr_t LookupRuntimeSymbol(ConstString name) override
ClassDescriptorSP GetClassDescriptor(ValueObject &valobj) override
lldb::addr_t m_relative_selector_base
void ModulesDidLoad(const ModuleList &module_list) override
Called when modules have been loaded in the process.
bool IsSharedCacheImageLoaded(uint16_t image_index)
bool HasSymbol(ConstString Name)
EncodingToTypeSP m_encoding_to_type_sp
lldb::addr_t GetSharedCacheBaseAddress()
std::once_flag m_no_classes_cached_warning
lldb::addr_t GetRelativeSelectorBaseAddr()
Returns the base address for relative method list selector strings.
std::optional< std::pair< lldb::addr_t, lldb::addr_t > > m_CFBoolean_values
llvm::StringRef GetPluginName() override
std::unique_ptr< DeclVendor > m_decl_vendor_up
uint64_t m_realized_class_generation_count
lldb::addr_t GetTaggedPointerObfuscator()
void WarnIfNoExpandedSharedCache()
lldb::addr_t m_tagged_pointer_obfuscator
std::unique_ptr< TaggedPointerVendor > m_tagged_pointer_vendor_up
std::unique_ptr< NonPointerISACache > m_non_pointer_isa_cache_up
bool GetCFBooleanValuesIfNeeded()
lldb::addr_t GetSharedCacheReadOnlyAddress()
void GetValuesForGlobalCFBooleans(lldb::addr_t &cf_true, lldb::addr_t &cf_false) override
void UpdateISAToDescriptorMapIfNeeded() override
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp, bool throw_bp) override
LanguageRuntime * GetPreferredLanguageRuntime(ValueObject &in_value) override
Return the preferred language runtime instance, which in most cases will be the current instance.
lldb::ModuleSP m_objc_module_sp
std::optional< uint64_t > GetSharedCacheImageHeaderVersion()
void WarnIfNoClassesCached(SharedCacheWarningReason reason)
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
DeclVendor * GetDeclVendor() override
bool m_has_objc_copyRealizedClassList
bool isA(const void *ClassID) const override
Generic representation of a type in a programming language.
A uniqued constant string class.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual bool isA(const void *ClassID) const
A collection class for Module objects.
std::shared_ptr< ClassDescriptor > ClassDescriptorSP
void UpdateISAToDescriptorMap()
std::shared_ptr< EncodingToType > EncodingToTypeSP
A plug-in interface definition class for debugging a process.
std::shared_ptr< Object > ObjectSP
Defines a symbol context baton that can be handed other debug core functions.
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
"lldb/Expression/UtilityFunction.h" Encapsulates a bit of source code that provides a function that i...
ValueType
Type that describes Value::m_value.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
std::weak_ptr< lldb_private::Module > ModuleWP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Module > ModuleSP
static DescriptorMapUpdateResult Fail()
static DescriptorMapUpdateResult Success(uint32_t found)
static DescriptorMapUpdateResult Retry()
DescriptorMapUpdateResult(bool ran, bool retry, uint32_t found)