Go to the documentation of this file.
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_OBJCLANGUAGERUNTIME_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_OBJCLANGUAGERUNTIME_H
15 #include <unordered_set>
17 #include "llvm/Support/Casting.h"
31 class TypeSystemClang;
32 class UtilityFunction;
69 if (class_name && *class_name)
71 (
LazyBool)(strstr(class_name,
"NSKVONotifying_") == class_name);
81 if (class_name && *class_name)
83 strcmp(class_name,
"NSCFType") == 0);
91 uint64_t *value_bits =
nullptr,
92 uint64_t *payload =
nullptr) = 0;
106 std::function<
bool(
const char *,
const char *)>
const
107 &instance_method_func,
108 std::function<
bool(
const char *,
const char *)>
const
110 std::function<
bool(
const char *,
const char *,
lldb::addr_t,
111 uint64_t)>
const &ivar_func)
const {
134 bool allow_NULLs =
false,
bool allow_tagged =
false,
135 bool check_version_specific =
false)
const;
148 bool for_expression) = 0;
172 static lldb::BreakpointPreconditionSP
197 bool isA(
const void *ClassID)
const override {
202 return runtime->
isA(&
ID);
206 return llvm::cast_or_null<ObjCLanguageRuntime>(
245 lldb::TypeSP type_sp);
254 virtual llvm::Expected<std::unique_ptr<UtilityFunction>>
282 const char *ivar_name);
300 uint64_t &size)
override;
325 const char *class_name);
400 return (
size_t)arg.GetCString();
405 return arg1.operator==(arg2);
408 typedef std::unordered_set<
ConstString, ConstStringSetHelpers,
409 ConstStringSetHelpers>
415 friend class ::CommandObjectObjC_ClassTable_Dump;
417 std::pair<ISAToDescriptorIterator, ISAToDescriptorIterator>
428 #endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_OBJCLANGUAGERUNTIME_H
ObjCLanguageRuntime(Process *process)
virtual ~ClassDescriptor()=default
virtual size_t GetByteOffsetForIvar(CompilerType &parent_qual_type, const char *ivar_name)
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
bool operator()(ConstString arg1, ConstString arg2) const
ClassDescriptorSP GetNonKVOClassDescriptor(ValueObject &in_value)
CompleteClassMap m_complete_class_cache
lldb::LanguageType GetLanguageType() const override
virtual TaggedPointerVendor * GetTaggedPointerVendor()
ISAToDescriptorIterator GetDescriptorIterator(ConstString name)
std::shared_ptr< ClassDescriptor > ClassDescriptorSP
virtual bool ReadObjCLibrary(const lldb::ModuleSP &module_sp)=0
ObjCExceptionPrecondition()
virtual ClassDescriptorSP GetMetaclass() const =0
virtual ClassDescriptorSP GetClassDescriptorFromClassName(ConstString class_name)
static ObjCLanguageRuntime * Get(Process &process)
std::unordered_set< ConstString, ConstStringSetHelpers, ConstStringSetHelpers > CompleteClassSet
virtual ClassDescriptorSP GetClassDescriptorFromISA(ObjCISA isa)
HashToISAMap::iterator HashToISAIterator
std::shared_ptr< EncodingToType > EncodingToTypeSP
~ObjCLanguageRuntime() override
std::unique_ptr< TypeSystemClang > m_scratch_ast_ctx_up
bool operator<(const ClassAndSel &rhs) const
bool IsPointerValid(lldb::addr_t value, uint32_t ptr_size, bool allow_NULLs=false, bool allow_tagged=false, bool check_version_specific=false) const
LanguageType
Programming language type.
virtual ObjCISA GetISA(ConstString name)
static lldb::BreakpointPreconditionSP GetBreakpointExceptionPrecondition(lldb::LanguageType language, bool throw_bp)
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
bool GetTypeBitSize(const CompilerType &compiler_type, uint64_t &size) override
virtual iVarDescriptor GetIVarAtIndex(size_t idx)
virtual bool isA(const void *ClassID) const
virtual ClassDescriptorSP GetSuperclass()=0
virtual ObjCISA GetParentClass(ObjCISA isa)
HashToISAMap m_hash_to_isa_map
bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp, uint32_t class_name_hash)
Status ConfigurePrecondition(Args &args) override
lldb::TypeSP LookupInCompleteClassCache(ConstString &name)
virtual ~TaggedPointerVendor()=default
llvm::Optional< CompilerType > GetRuntimeType(CompilerType base_type) override
virtual uint64_t GetInstanceSize()=0
virtual bool Describe(std::function< void(ObjCISA)> const &superclass_func, std::function< bool(const char *, const char *)> const &instance_method_func, std::function< bool(const char *, const char *)> const &class_method_func, std::function< bool(const char *, const char *, lldb::addr_t, uint64_t)> const &ivar_func) const
void UpdateISAToDescriptorMap()
void GetDescription(Stream &stream, lldb::DescriptionLevel level) override
std::unordered_set< std::string > m_class_names
bool isA(const void *ClassID) const override
virtual ClassDescriptorSP GetClassDescriptor(ValueObject &in_value)
virtual ~EncodingToType()
LazyBool m_has_new_literals_and_indexing
std::pair< ISAToDescriptorIterator, ISAToDescriptorIterator > GetDescriptorIteratorPair(bool update_if_needed=true)
bool EvaluatePrecondition(StoppointCallbackContext &context) override
TaggedPointerVendor()=default
bool HasNewLiteralsAndIndexing()
bool IsAllowedRuntimeValue(ConstString name) override
Check whether the name is "self" or "_cmd" and should show up in "frame variable".
virtual bool CalculateHasNewLiteralsAndIndexing()
TypeAndOrName LookupInClassNameCache(lldb::addr_t class_addr)
ThreadSafeDenseMap< void *, uint64_t > TypeSizeCache
std::map< ObjCISA, ClassDescriptorSP > ISAToDescriptorMap
void ReadObjCLibraryIfNeeded(const ModuleList &module_list)
virtual bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp)=0
virtual ObjCRuntimeVersions GetRuntimeVersion() const
CompleteClassSet m_negative_complete_class_cache
virtual size_t GetNumIVars()
@ eLanguageTypeObjC
Objective-C.
string(SUBSTRING ${p} 10 -1 pStripped) if($
bool ISAIsCached(ObjCISA isa) const
bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp)
ISAToDescriptorMap m_isa_to_descriptor
uint32_t m_isa_to_descriptor_stop_id
virtual void UpdateISAToDescriptorMapIfNeeded()=0
virtual CompilerType RealizeType(TypeSystemClang &ast_ctx, const char *name, bool for_expression)=0
virtual ObjCISA GetISA()=0
virtual EncodingToTypeSP GetEncodingToType()
const TaggedPointerVendor & operator=(const TaggedPointerVendor &)=delete
void AddToMethodCache(lldb::addr_t class_addr, lldb::addr_t sel, lldb::addr_t impl_addr)
virtual ObjCLanguageRuntime::ClassDescriptorSP GetClassDescriptor(lldb::addr_t ptr)=0
bool operator==(const ClassAndSel &rhs)
const ObjCLanguageRuntime & operator=(const ObjCLanguageRuntime &)=delete
ISAToDescriptorMap::iterator ISAToDescriptorIterator
virtual bool IsPossibleTaggedPointer(lldb::addr_t ptr)=0
virtual ConstString GetClassName()=0
bool IsValidISA(ObjCISA isa)
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
std::multimap< uint32_t, ObjCISA > HashToISAMap
virtual bool GetTaggedPointerInfo(uint64_t *info_bits=nullptr, uint64_t *value_bits=nullptr, uint64_t *payload=nullptr)=0
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Generic representation of a type in a programming language.
virtual llvm::Expected< std::unique_ptr< UtilityFunction > > CreateObjectChecker(std::string name, ExecutionContext &exe_ctx)=0
static bool classof(const LanguageRuntime *runtime)
ClassAndSel(lldb::addr_t in_sel_addr, lldb::addr_t in_class_addr)
~ObjCExceptionPrecondition() override=default
void SetType(const lldb::TypeSP &type_sp)
A class that represents a running process on the host machine.
TypeSizeCache m_type_size_cache
A TypeSystem implementation based on Clang.
size_t operator()(ConstString arg) const
std::map< ConstString, lldb::TypeWP > CompleteClassMap
void SymbolsDidLoad(const ModuleList &module_list) override
void AddClassName(const char *class_name)
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
std::map< ClassAndSel, lldb::addr_t > MsgImplMap
void AddToClassNameCache(lldb::addr_t class_addr, const char *name, lldb::TypeSP type_sp)
uint32_t GetStopID() const
virtual bool HasReadObjCLibrary()=0
lldb::addr_t LookupInMethodCache(lldb::addr_t class_addr, lldb::addr_t sel)
virtual bool CheckPointer(lldb::addr_t value, uint32_t ptr_size) const
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.