LLDB  mainline
ObjCLanguageRuntime.h
Go to the documentation of this file.
1 //===-- ObjCLanguageRuntime.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_OBJCLANGUAGERUNTIME_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_OBJCLANGUAGERUNTIME_H
11 
12 #include <functional>
13 #include <map>
14 #include <memory>
15 #include <unordered_set>
16 
17 #include "llvm/Support/Casting.h"
18 
23 #include "lldb/Symbol/Type.h"
25 #include "lldb/lldb-private.h"
26 
28 
29 namespace lldb_private {
30 
31 class TypeSystemClang;
32 class UtilityFunction;
33 
35 public:
36  enum class ObjCRuntimeVersions {
38  eAppleObjC_V1 = 1,
39  eAppleObjC_V2 = 2
40  };
41 
43 
45  typedef std::shared_ptr<ClassDescriptor> ClassDescriptorSP;
46 
47  // the information that we want to support retrieving from an ObjC class this
48  // needs to be pure virtual since there are at least 2 different
49  // implementations of the runtime, and more might come
51  public:
54  m_type_wp() {}
55 
56  virtual ~ClassDescriptor() = default;
57 
58  virtual ConstString GetClassName() = 0;
59 
60  virtual ClassDescriptorSP GetSuperclass() = 0;
61 
62  virtual ClassDescriptorSP GetMetaclass() const = 0;
63 
64  // virtual if any implementation has some other version-specific rules but
65  // for the known v1/v2 this is all that needs to be done
66  virtual bool IsKVO() {
68  const char *class_name = GetClassName().AsCString();
69  if (class_name && *class_name)
70  m_is_kvo =
71  (LazyBool)(strstr(class_name, "NSKVONotifying_") == class_name);
72  }
73  return (m_is_kvo == eLazyBoolYes);
74  }
75 
76  // virtual if any implementation has some other version-specific rules but
77  // for the known v1/v2 this is all that needs to be done
78  virtual bool IsCFType() {
79  if (m_is_cf == eLazyBoolCalculate) {
80  const char *class_name = GetClassName().AsCString();
81  if (class_name && *class_name)
82  m_is_cf = (LazyBool)(strcmp(class_name, "__NSCFType") == 0 ||
83  strcmp(class_name, "NSCFType") == 0);
84  }
85  return (m_is_cf == eLazyBoolYes);
86  }
87 
88  virtual bool IsValid() = 0;
89 
90  /// There are two routines in the ObjC runtime that tagged pointer clients
91  /// can call to get the value from their tagged pointer, one that retrieves
92  /// it as an unsigned value and one a signed value. These two
93  /// GetTaggedPointerInfo methods mirror those two ObjC runtime calls.
94  /// @{
95  virtual bool GetTaggedPointerInfo(uint64_t *info_bits = nullptr,
96  uint64_t *value_bits = nullptr,
97  uint64_t *payload = nullptr) = 0;
98 
99  virtual bool GetTaggedPointerInfoSigned(uint64_t *info_bits = nullptr,
100  int64_t *value_bits = nullptr,
101  uint64_t *payload = nullptr) = 0;
102  /// @}
103 
104  virtual uint64_t GetInstanceSize() = 0;
105 
106  // use to implement version-specific additional constraints on pointers
107  virtual bool CheckPointer(lldb::addr_t value, uint32_t ptr_size) const {
108  return true;
109  }
110 
111  virtual ObjCISA GetISA() = 0;
112 
113  // This should return true iff the interface could be completed
114  virtual bool
115  Describe(std::function<void(ObjCISA)> const &superclass_func,
116  std::function<bool(const char *, const char *)> const
117  &instance_method_func,
118  std::function<bool(const char *, const char *)> const
119  &class_method_func,
120  std::function<bool(const char *, const char *, lldb::addr_t,
121  uint64_t)> const &ivar_func) const {
122  return false;
123  }
124 
125  lldb::TypeSP GetType() { return m_type_wp.lock(); }
126 
127  void SetType(const lldb::TypeSP &type_sp) { m_type_wp = type_sp; }
128 
129  struct iVarDescriptor {
132  uint64_t m_size;
133  int32_t m_offset;
134  };
135 
136  virtual size_t GetNumIVars() { return 0; }
137 
138  virtual iVarDescriptor GetIVarAtIndex(size_t idx) {
139  return iVarDescriptor();
140  }
141 
142  protected:
143  bool IsPointerValid(lldb::addr_t value, uint32_t ptr_size,
144  bool allow_NULLs = false, bool allow_tagged = false,
145  bool check_version_specific = false) const;
146 
147  private:
150  lldb::TypeWP m_type_wp;
151  };
152 
154  public:
155  virtual ~EncodingToType();
156 
157  virtual CompilerType RealizeType(TypeSystemClang &ast_ctx, const char *name,
158  bool for_expression) = 0;
159  virtual CompilerType RealizeType(const char *name, bool for_expression);
160 
161  protected:
162  std::unique_ptr<TypeSystemClang> m_scratch_ast_ctx_up;
163  };
164 
166  public:
168 
169  ~ObjCExceptionPrecondition() override = default;
170 
171  bool EvaluatePrecondition(StoppointCallbackContext &context) override;
172  void GetDescription(Stream &stream, lldb::DescriptionLevel level) override;
173  Status ConfigurePrecondition(Args &args) override;
174 
175  protected:
176  void AddClassName(const char *class_name);
177 
178  private:
179  std::unordered_set<std::string> m_class_names;
180  };
181 
182  static lldb::BreakpointPreconditionSP
184  bool throw_bp);
185 
187  public:
188  virtual ~TaggedPointerVendor() = default;
189 
190  virtual bool IsPossibleTaggedPointer(lldb::addr_t ptr) = 0;
191 
194 
195  protected:
196  TaggedPointerVendor() = default;
197 
198  private:
199  TaggedPointerVendor(const TaggedPointerVendor &) = delete;
200  const TaggedPointerVendor &operator=(const TaggedPointerVendor &) = delete;
201  };
202 
203  ~ObjCLanguageRuntime() override;
204 
205  static char ID;
206 
207  bool isA(const void *ClassID) const override {
208  return ClassID == &ID || LanguageRuntime::isA(ClassID);
209  }
210 
211  static bool classof(const LanguageRuntime *runtime) {
212  return runtime->isA(&ID);
213  }
214 
215  static ObjCLanguageRuntime *Get(Process &process) {
216  return llvm::cast_or_null<ObjCLanguageRuntime>(
218  }
219 
220  virtual TaggedPointerVendor *GetTaggedPointerVendor() { return nullptr; }
221 
222  typedef std::shared_ptr<EncodingToType> EncodingToTypeSP;
223 
225 
227 
229 
230  virtual ClassDescriptorSP
232 
234 
236 
239  }
240 
241  virtual bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp) = 0;
242 
243  virtual bool ReadObjCLibrary(const lldb::ModuleSP &module_sp) = 0;
244 
245  virtual bool HasReadObjCLibrary() = 0;
246 
248 
249  void AddToMethodCache(lldb::addr_t class_addr, lldb::addr_t sel,
250  lldb::addr_t impl_addr);
251 
253 
254  void AddToClassNameCache(lldb::addr_t class_addr, const char *name,
255  lldb::TypeSP type_sp);
256 
257  void AddToClassNameCache(lldb::addr_t class_addr,
258  const TypeAndOrName &class_or_type_name);
259 
260  lldb::TypeSP LookupInCompleteClassCache(ConstString &name);
261 
262  llvm::Optional<CompilerType> GetRuntimeType(CompilerType base_type) override;
263 
264  virtual llvm::Expected<std::unique_ptr<UtilityFunction>>
266 
269  }
270 
271  bool IsValidISA(ObjCISA isa) {
273  return m_isa_to_descriptor.count(isa) > 0;
274  }
275 
276  virtual void UpdateISAToDescriptorMapIfNeeded() = 0;
277 
281  }
282  }
283 
284  virtual ObjCISA GetISA(ConstString name);
285 
286  virtual ObjCISA GetParentClass(ObjCISA isa);
287 
288  // Finds the byte offset of the child_type ivar in parent_type. If it can't
289  // find the offset, returns LLDB_INVALID_IVAR_OFFSET.
290 
291  virtual size_t GetByteOffsetForIvar(CompilerType &parent_qual_type,
292  const char *ivar_name);
293 
298  else
300  }
301 
303  }
304 
305  void SymbolsDidLoad(const ModuleList &module_list) override {
307  }
308 
309  bool GetTypeBitSize(const CompilerType &compiler_type,
310  uint64_t &size) override;
311 
312  /// Check whether the name is "self" or "_cmd" and should show up in
313  /// "frame variable".
314  bool IsAllowedRuntimeValue(ConstString name) override;
315 
316 protected:
317  // Classes that inherit from ObjCLanguageRuntime can see and modify these
318  ObjCLanguageRuntime(Process *process);
319 
320  virtual bool CalculateHasNewLiteralsAndIndexing() { return false; }
321 
322  bool ISAIsCached(ObjCISA isa) const {
323  return m_isa_to_descriptor.find(isa) != m_isa_to_descriptor.end();
324  }
325 
326  bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp) {
327  if (isa != 0) {
328  m_isa_to_descriptor[isa] = descriptor_sp;
329  return true;
330  }
331  return false;
332  }
333 
334  bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp,
335  const char *class_name);
336 
337  bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp,
338  uint32_t class_name_hash) {
339  if (isa != 0) {
340  m_isa_to_descriptor[isa] = descriptor_sp;
341  m_hash_to_isa_map.insert(std::make_pair(class_name_hash, isa));
342  return true;
343  }
344  return false;
345  }
346 
347 private:
348  // We keep a map of <Class,Selector>->Implementation so we don't have to call
349  // the resolver function over and over.
350 
351  // FIXME: We need to watch for the loading of Protocols, and flush the cache
352  // for any
353  // class that we see so changed.
354 
355  struct ClassAndSel {
359  }
360 
361  ClassAndSel(lldb::addr_t in_sel_addr, lldb::addr_t in_class_addr)
362  : class_addr(in_class_addr), sel_addr(in_sel_addr) {}
363 
364  bool operator==(const ClassAndSel &rhs) {
365  if (class_addr == rhs.class_addr && sel_addr == rhs.sel_addr)
366  return true;
367  else
368  return false;
369  }
370 
371  bool operator<(const ClassAndSel &rhs) const {
372  if (class_addr < rhs.class_addr)
373  return true;
374  else if (class_addr > rhs.class_addr)
375  return false;
376  else {
377  if (sel_addr < rhs.sel_addr)
378  return true;
379  else
380  return false;
381  }
382  }
383 
386  };
387 
388  typedef std::map<ClassAndSel, lldb::addr_t> MsgImplMap;
389  typedef std::map<ObjCISA, ClassDescriptorSP> ISAToDescriptorMap;
390  typedef std::multimap<uint32_t, ObjCISA> HashToISAMap;
391  typedef ISAToDescriptorMap::iterator ISAToDescriptorIterator;
392  typedef HashToISAMap::iterator HashToISAIterator;
394 
400 
401 protected:
403 
404  typedef std::map<ConstString, lldb::TypeWP> CompleteClassMap;
406 
408  size_t operator()(ConstString arg) const // for hashing
409  {
410  return (size_t)arg.GetCString();
411  }
413  ConstString arg2) const // for equality
414  {
415  return arg1.operator==(arg2);
416  }
417  };
418  typedef std::unordered_set<ConstString, ConstStringSetHelpers,
419  ConstStringSetHelpers>
422 
424 
425  friend class ::CommandObjectObjC_ClassTable_Dump;
426 
427  std::pair<ISAToDescriptorIterator, ISAToDescriptorIterator>
428  GetDescriptorIteratorPair(bool update_if_needed = true);
429 
430  void ReadObjCLibraryIfNeeded(const ModuleList &module_list);
431 
432  ObjCLanguageRuntime(const ObjCLanguageRuntime &) = delete;
433  const ObjCLanguageRuntime &operator=(const ObjCLanguageRuntime &) = delete;
434 };
435 
436 } // namespace lldb_private
437 
438 #endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_OBJCLANGUAGERUNTIME_H
lldb_private::ObjCLanguageRuntime::ObjCLanguageRuntime
ObjCLanguageRuntime(Process *process)
Definition: ObjCLanguageRuntime.cpp:37
lldb_private::ObjCLanguageRuntime::ClassDescriptor::IsValid
virtual bool IsValid()=0
lldb_private::ExecutionContext
Definition: ExecutionContext.h:291
lldb_private::ObjCLanguageRuntime::ClassDescriptor::~ClassDescriptor
virtual ~ClassDescriptor()=default
lldb_private::ObjCLanguageRuntime::ClassDescriptor::iVarDescriptor::m_offset
int32_t m_offset
Definition: ObjCLanguageRuntime.h:133
lldb_private::ObjCLanguageRuntime::TaggedPointerVendor
Definition: ObjCLanguageRuntime.h:186
lldb_private::ObjCLanguageRuntime::GetByteOffsetForIvar
virtual size_t GetByteOffsetForIvar(CompilerType &parent_qual_type, const char *ivar_name)
Definition: ObjCLanguageRuntime.cpp:143
lldb_private::StoppointCallbackContext
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
Definition: StoppointCallbackContext.h:26
lldb_private::ObjCLanguageRuntime::ConstStringSetHelpers::operator()
bool operator()(ConstString arg1, ConstString arg2) const
Definition: ObjCLanguageRuntime.h:412
lldb_private::ObjCLanguageRuntime::GetNonKVOClassDescriptor
ClassDescriptorSP GetNonKVOClassDescriptor(ValueObject &in_value)
Definition: ObjCLanguageRuntime.cpp:258
lldb_private::ObjCLanguageRuntime::m_complete_class_cache
CompleteClassMap m_complete_class_cache
Definition: ObjCLanguageRuntime.h:405
lldb_private::ObjCLanguageRuntime::ClassAndSel::class_addr
lldb::addr_t class_addr
Definition: ObjCLanguageRuntime.h:384
lldb_private::ObjCLanguageRuntime::GetLanguageType
lldb::LanguageType GetLanguageType() const override
Definition: ObjCLanguageRuntime.h:237
lldb_private::ObjCLanguageRuntime::GetTaggedPointerVendor
virtual TaggedPointerVendor * GetTaggedPointerVendor()
Definition: ObjCLanguageRuntime.h:220
lldb_private::ObjCLanguageRuntime
Definition: ObjCLanguageRuntime.h:34
lldb_private::ObjCLanguageRuntime::GetDescriptorIterator
ISAToDescriptorIterator GetDescriptorIterator(ConstString name)
Definition: ObjCLanguageRuntime.cpp:170
lldb_private::ObjCLanguageRuntime::ClassDescriptorSP
std::shared_ptr< ClassDescriptor > ClassDescriptorSP
Definition: ObjCLanguageRuntime.h:44
lldb_private::ObjCLanguageRuntime::ReadObjCLibrary
virtual bool ReadObjCLibrary(const lldb::ModuleSP &module_sp)=0
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::ObjCExceptionPrecondition
ObjCExceptionPrecondition()
Definition: ObjCLanguageRuntime.cpp:366
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetMetaclass
virtual ClassDescriptorSP GetMetaclass() const =0
lldb_private::ObjCLanguageRuntime::GetClassDescriptorFromClassName
virtual ClassDescriptorSP GetClassDescriptorFromClassName(ConstString class_name)
Definition: ObjCLanguageRuntime.cpp:226
lldb_private::ObjCLanguageRuntime::Get
static ObjCLanguageRuntime * Get(Process &process)
Definition: ObjCLanguageRuntime.h:215
lldb_private::ObjCLanguageRuntime::CompleteClassSet
std::unordered_set< ConstString, ConstStringSetHelpers, ConstStringSetHelpers > CompleteClassSet
Definition: ObjCLanguageRuntime.h:420
lldb_private::ObjCLanguageRuntime::GetClassDescriptorFromISA
virtual ClassDescriptorSP GetClassDescriptorFromISA(ObjCISA isa)
Definition: ObjCLanguageRuntime.cpp:273
lldb_private::eLazyBoolYes
@ eLazyBoolYes
Definition: lldb-private-enumerations.h:115
lldb_private::ObjCLanguageRuntime::HashToISAIterator
HashToISAMap::iterator HashToISAIterator
Definition: ObjCLanguageRuntime.h:392
lldb_private::Process
Definition: Process.h:342
lldb_private::ObjCLanguageRuntime::EncodingToTypeSP
std::shared_ptr< EncodingToType > EncodingToTypeSP
Definition: ObjCLanguageRuntime.h:222
lldb_private::ObjCLanguageRuntime::~ObjCLanguageRuntime
~ObjCLanguageRuntime() override
Definition: ObjCLanguageRuntime.cpp:35
lldb_private::ObjCLanguageRuntime::EncodingToType::m_scratch_ast_ctx_up
std::unique_ptr< TypeSystemClang > m_scratch_ast_ctx_up
Definition: ObjCLanguageRuntime.h:162
lldb_private::ObjCLanguageRuntime::ClassAndSel::operator<
bool operator<(const ClassAndSel &rhs) const
Definition: ObjCLanguageRuntime.h:371
lldb_private::ObjCLanguageRuntime::ClassDescriptor::IsPointerValid
bool IsPointerValid(lldb::addr_t value, uint32_t ptr_size, bool allow_NULLs=false, bool allow_tagged=false, bool check_version_specific=false) const
Definition: ObjCLanguageRuntime.cpp:148
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::ObjCLanguageRuntime::GetISA
virtual ObjCISA GetISA(ConstString name)
Definition: ObjCLanguageRuntime.cpp:162
lldb_private::ObjCLanguageRuntime::GetBreakpointExceptionPrecondition
static lldb::BreakpointPreconditionSP GetBreakpointExceptionPrecondition(lldb::LanguageType language, bool throw_bp)
Definition: ObjCLanguageRuntime.cpp:349
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
lldb_private::ObjCLanguageRuntime::GetTypeBitSize
bool GetTypeBitSize(const CompilerType &compiler_type, uint64_t &size) override
Definition: ObjCLanguageRuntime.cpp:314
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetIVarAtIndex
virtual iVarDescriptor GetIVarAtIndex(size_t idx)
Definition: ObjCLanguageRuntime.h:138
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Args
Definition: Args.h:33
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::ObjCLanguageRuntime::ObjCRuntimeVersions::eAppleObjC_V2
@ eAppleObjC_V2
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::LanguageRuntime::isA
virtual bool isA(const void *ClassID) const
Definition: LanguageRuntime.h:173
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetSuperclass
virtual ClassDescriptorSP GetSuperclass()=0
lldb_private::ObjCLanguageRuntime::ClassDescriptor::iVarDescriptor::m_type
CompilerType m_type
Definition: ObjCLanguageRuntime.h:131
lldb_private::ObjCLanguageRuntime::GetParentClass
virtual ObjCISA GetParentClass(ObjCISA isa)
Definition: ObjCLanguageRuntime.cpp:215
lldb_private::ObjCLanguageRuntime::m_hash_to_isa_map
HashToISAMap m_hash_to_isa_map
Definition: ObjCLanguageRuntime.h:398
lldb_private::ObjCLanguageRuntime::AddClass
bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp, uint32_t class_name_hash)
Definition: ObjCLanguageRuntime.h:337
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::ConfigurePrecondition
Status ConfigurePrecondition(Args &args) override
Definition: ObjCLanguageRuntime.cpp:376
BreakpointPrecondition.h
lldb_private::ObjCLanguageRuntime::LookupInCompleteClassCache
lldb::TypeSP LookupInCompleteClassCache(ConstString &name)
Definition: ObjCLanguageRuntime.cpp:86
lldb_private::ObjCLanguageRuntime::ClassDescriptor::IsCFType
virtual bool IsCFType()
Definition: ObjCLanguageRuntime.h:78
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetType
lldb::TypeSP GetType()
Definition: ObjCLanguageRuntime.h:125
lldb_private::ObjCLanguageRuntime::TaggedPointerVendor::~TaggedPointerVendor
virtual ~TaggedPointerVendor()=default
lldb_private::ObjCLanguageRuntime::GetRuntimeType
llvm::Optional< CompilerType > GetRuntimeType(CompilerType base_type) override
Definition: ObjCLanguageRuntime.cpp:386
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetInstanceSize
virtual uint64_t GetInstanceSize()=0
lldb_private::ObjCLanguageRuntime::ClassDescriptor::Describe
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
Definition: ObjCLanguageRuntime.h:115
lldb_private::ObjCLanguageRuntime::UpdateISAToDescriptorMap
void UpdateISAToDescriptorMap()
Definition: ObjCLanguageRuntime.h:278
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::GetDescription
void GetDescription(Stream &stream, lldb::DescriptionLevel level) override
Definition: ObjCLanguageRuntime.cpp:373
lldb_private::ModuleList
Definition: ModuleList.h:71
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::m_class_names
std::unordered_set< std::string > m_class_names
Definition: ObjCLanguageRuntime.h:179
lldb_private::ObjCLanguageRuntime::isA
bool isA(const void *ClassID) const override
Definition: ObjCLanguageRuntime.h:207
lldb_private::Runtime::m_process
Process * m_process
Definition: Runtime.h:29
lldb_private::ObjCLanguageRuntime::m_impl_cache
MsgImplMap m_impl_cache
Definition: ObjCLanguageRuntime.h:395
lldb_private::ObjCLanguageRuntime::GetClassDescriptor
virtual ClassDescriptorSP GetClassDescriptor(ValueObject &in_value)
Definition: ObjCLanguageRuntime.cpp:235
Type.h
lldb_private::ObjCLanguageRuntime::EncodingToType::~EncodingToType
virtual ~EncodingToType()
Definition: ObjCLanguageRuntime.cpp:308
lldb_private::ObjCLanguageRuntime::m_has_new_literals_and_indexing
LazyBool m_has_new_literals_and_indexing
Definition: ObjCLanguageRuntime.h:396
lldb_private::ObjCLanguageRuntime::GetDescriptorIteratorPair
std::pair< ISAToDescriptorIterator, ISAToDescriptorIterator > GetDescriptorIteratorPair(bool update_if_needed=true)
Definition: ObjCLanguageRuntime.cpp:205
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::EvaluatePrecondition
bool EvaluatePrecondition(StoppointCallbackContext &context) override
Definition: ObjCLanguageRuntime.cpp:368
lldb_private::ObjCLanguageRuntime::TaggedPointerVendor::TaggedPointerVendor
TaggedPointerVendor()=default
lldb_private::ObjCLanguageRuntime::HasNewLiteralsAndIndexing
bool HasNewLiteralsAndIndexing()
Definition: ObjCLanguageRuntime.h:294
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::ObjCLanguageRuntime::IsAllowedRuntimeValue
bool IsAllowedRuntimeValue(ConstString name) override
Check whether the name is "self" or "_cmd" and should show up in "frame variable".
Definition: ObjCLanguageRuntime.cpp:44
lldb_private::ObjCLanguageRuntime::CalculateHasNewLiteralsAndIndexing
virtual bool CalculateHasNewLiteralsAndIndexing()
Definition: ObjCLanguageRuntime.h:320
lldb_private::ObjCLanguageRuntime::LookupInClassNameCache
TypeAndOrName LookupInClassNameCache(lldb::addr_t class_addr)
lldb_private::ObjCLanguageRuntime::TypeSizeCache
ThreadSafeDenseMap< void *, uint64_t > TypeSizeCache
Definition: ObjCLanguageRuntime.h:393
lldb_private::ObjCLanguageRuntime::ISAToDescriptorMap
std::map< ObjCISA, ClassDescriptorSP > ISAToDescriptorMap
Definition: ObjCLanguageRuntime.h:389
PluginInterface.h
CommandObjectObjC_ClassTable_Dump
Definition: AppleObjCRuntimeV2.cpp:593
lldb_private::ObjCLanguageRuntime::ObjCRuntimeVersions::eObjC_VersionUnknown
@ eObjC_VersionUnknown
lldb_private::ObjCLanguageRuntime::ObjCRuntimeVersions
ObjCRuntimeVersions
Definition: ObjCLanguageRuntime.h:36
lldb_private::ObjCLanguageRuntime::ReadObjCLibraryIfNeeded
void ReadObjCLibraryIfNeeded(const ModuleList &module_list)
lldb_private::ObjCLanguageRuntime::ClassDescriptor::m_is_kvo
LazyBool m_is_kvo
Definition: ObjCLanguageRuntime.h:148
lldb_private::ObjCLanguageRuntime::IsModuleObjCLibrary
virtual bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp)=0
lldb_private::ObjCLanguageRuntime::GetRuntimeVersion
virtual ObjCRuntimeVersions GetRuntimeVersion() const
Definition: ObjCLanguageRuntime.h:267
lldb_private::LanguageRuntime
Definition: LanguageRuntime.h:60
lldb_private::ObjCLanguageRuntime::m_negative_complete_class_cache
CompleteClassSet m_negative_complete_class_cache
Definition: ObjCLanguageRuntime.h:421
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetNumIVars
virtual size_t GetNumIVars()
Definition: ObjCLanguageRuntime.h:136
lldb::eLanguageTypeObjC
@ eLanguageTypeObjC
Objective-C.
Definition: lldb-enumerations.h:453
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:38
lldb_private::ObjCLanguageRuntime::ISAIsCached
bool ISAIsCached(ObjCISA isa) const
Definition: ObjCLanguageRuntime.h:322
lldb_private::ObjCLanguageRuntime::AddClass
bool AddClass(ObjCISA isa, const ClassDescriptorSP &descriptor_sp)
Definition: ObjCLanguageRuntime.h:326
lldb_private::ObjCLanguageRuntime::ObjCRuntimeVersions::eAppleObjC_V1
@ eAppleObjC_V1
lldb_private::ObjCLanguageRuntime::m_isa_to_descriptor
ISAToDescriptorMap m_isa_to_descriptor
Definition: ObjCLanguageRuntime.h:397
CompilerType.h
lldb_private::ObjCLanguageRuntime::m_isa_to_descriptor_stop_id
uint32_t m_isa_to_descriptor_stop_id
Definition: ObjCLanguageRuntime.h:402
lldb_private::ObjCLanguageRuntime::UpdateISAToDescriptorMapIfNeeded
virtual void UpdateISAToDescriptorMapIfNeeded()=0
lldb_private::ObjCLanguageRuntime::EncodingToType::RealizeType
virtual CompilerType RealizeType(TypeSystemClang &ast_ctx, const char *name, bool for_expression)=0
lldb-private.h
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetISA
virtual ObjCISA GetISA()=0
lldb_private::ObjCLanguageRuntime::GetEncodingToType
virtual EncodingToTypeSP GetEncodingToType()
Definition: ObjCLanguageRuntime.cpp:310
lldb_private::ThreadSafeDenseMap< void *, uint64_t >
lldb_private::ObjCLanguageRuntime::TaggedPointerVendor::operator=
const TaggedPointerVendor & operator=(const TaggedPointerVendor &)=delete
lldb_private::ObjCLanguageRuntime::ClassAndSel::ClassAndSel
ClassAndSel()
Definition: ObjCLanguageRuntime.h:356
lldb_private::ObjCLanguageRuntime::AddToMethodCache
void AddToMethodCache(lldb::addr_t class_addr, lldb::addr_t sel, lldb::addr_t impl_addr)
Definition: ObjCLanguageRuntime.cpp:62
lldb_private::ObjCLanguageRuntime::TaggedPointerVendor::GetClassDescriptor
virtual ObjCLanguageRuntime::ClassDescriptorSP GetClassDescriptor(lldb::addr_t ptr)=0
lldb_private::ObjCLanguageRuntime::ClassDescriptor
Definition: ObjCLanguageRuntime.h:50
lldb_private::ObjCLanguageRuntime::ClassAndSel::operator==
bool operator==(const ClassAndSel &rhs)
Definition: ObjCLanguageRuntime.h:364
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::ObjCLanguageRuntime::operator=
const ObjCLanguageRuntime & operator=(const ObjCLanguageRuntime &)=delete
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::ObjCLanguageRuntime::ID
static char ID
Definition: ObjCLanguageRuntime.h:205
lldb_private::ObjCLanguageRuntime::ISAToDescriptorIterator
ISAToDescriptorMap::iterator ISAToDescriptorIterator
Definition: ObjCLanguageRuntime.h:391
lldb_private::ObjCLanguageRuntime::TaggedPointerVendor::IsPossibleTaggedPointer
virtual bool IsPossibleTaggedPointer(lldb::addr_t ptr)=0
lldb_private::ObjCLanguageRuntime::ClassDescriptor::IsKVO
virtual bool IsKVO()
Definition: ObjCLanguageRuntime.h:66
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetClassName
virtual ConstString GetClassName()=0
lldb_private::ObjCLanguageRuntime::ObjCISA
lldb::addr_t ObjCISA
Definition: ObjCLanguageRuntime.h:42
lldb_private::ObjCLanguageRuntime::IsValidISA
bool IsValidISA(ObjCISA isa)
Definition: ObjCLanguageRuntime.h:271
lldb_private::Process::GetLanguageRuntime
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition: Process.cpp:1472
lldb_private::ObjCLanguageRuntime::ClassDescriptor::ClassDescriptor
ClassDescriptor()
Definition: ObjCLanguageRuntime.h:52
lldb_private::ObjCLanguageRuntime::ClassDescriptor::iVarDescriptor
Definition: ObjCLanguageRuntime.h:129
lldb_private::ObjCLanguageRuntime::ClassDescriptor::m_is_cf
LazyBool m_is_cf
Definition: ObjCLanguageRuntime.h:149
lldb_private::ObjCLanguageRuntime::HashToISAMap
std::multimap< uint32_t, ObjCISA > HashToISAMap
Definition: ObjCLanguageRuntime.h:390
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetTaggedPointerInfo
virtual bool GetTaggedPointerInfo(uint64_t *info_bits=nullptr, uint64_t *value_bits=nullptr, uint64_t *payload=nullptr)=0
There are two routines in the ObjC runtime that tagged pointer clients can call to get the value from...
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
ThreadSafeDenseMap.h
lldb_private::ObjCLanguageRuntime::CreateObjectChecker
virtual llvm::Expected< std::unique_ptr< UtilityFunction > > CreateObjectChecker(std::string name, ExecutionContext &exe_ctx)=0
lldb_private::ObjCLanguageRuntime::classof
static bool classof(const LanguageRuntime *runtime)
Definition: ObjCLanguageRuntime.h:211
LanguageRuntime.h
lldb_private::ObjCLanguageRuntime::ClassAndSel::ClassAndSel
ClassAndSel(lldb::addr_t in_sel_addr, lldb::addr_t in_class_addr)
Definition: ObjCLanguageRuntime.h:361
lldb_private::BreakpointPrecondition
Definition: BreakpointPrecondition.h:21
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::~ObjCExceptionPrecondition
~ObjCExceptionPrecondition() override=default
lldb_private::ObjCLanguageRuntime::ClassDescriptor::SetType
void SetType(const lldb::TypeSP &type_sp)
Definition: ObjCLanguageRuntime.h:127
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
lldb_private::ObjCLanguageRuntime::m_type_size_cache
TypeSizeCache m_type_size_cache
Definition: ObjCLanguageRuntime.h:399
lldb_private::TypeSystemClang
A TypeSystem implementation based on Clang.
Definition: TypeSystemClang.h:106
lldb_private::ObjCLanguageRuntime::ConstStringSetHelpers::operator()
size_t operator()(ConstString arg) const
Definition: ObjCLanguageRuntime.h:408
lldb_private::ObjCLanguageRuntime::ClassDescriptor::m_type_wp
lldb::TypeWP m_type_wp
Definition: ObjCLanguageRuntime.h:150
lldb_private::ObjCLanguageRuntime::EncodingToType
Definition: ObjCLanguageRuntime.h:153
lldb_private::ObjCLanguageRuntime::ClassAndSel::sel_addr
lldb::addr_t sel_addr
Definition: ObjCLanguageRuntime.h:385
lldb_private::ObjCLanguageRuntime::ClassDescriptor::iVarDescriptor::m_size
uint64_t m_size
Definition: ObjCLanguageRuntime.h:132
lldb_private::ObjCLanguageRuntime::CompleteClassMap
std::map< ConstString, lldb::TypeWP > CompleteClassMap
Definition: ObjCLanguageRuntime.h:404
lldb_private::ObjCLanguageRuntime::ClassDescriptor::iVarDescriptor::m_name
ConstString m_name
Definition: ObjCLanguageRuntime.h:130
lldb_private::ObjCLanguageRuntime::SymbolsDidLoad
void SymbolsDidLoad(const ModuleList &module_list) override
Definition: ObjCLanguageRuntime.h:305
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::AddClassName
void AddClassName(const char *class_name)
Definition: ObjCLanguageRuntime.cpp:361
lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition
Definition: ObjCLanguageRuntime.h:165
lldb_private::TypeAndOrName
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:395
lldb_private::ObjCLanguageRuntime::MsgImplMap
std::map< ClassAndSel, lldb::addr_t > MsgImplMap
Definition: ObjCLanguageRuntime.h:388
lldb_private::ObjCLanguageRuntime::AddToClassNameCache
void AddToClassNameCache(lldb::addr_t class_addr, const char *name, lldb::TypeSP type_sp)
lldb_private::ObjCLanguageRuntime::ClassAndSel
Definition: ObjCLanguageRuntime.h:355
lldb_private::Process::GetStopID
uint32_t GetStopID() const
Definition: Process.h:1354
lldb_private::ObjCLanguageRuntime::HasReadObjCLibrary
virtual bool HasReadObjCLibrary()=0
lldb_private::ObjCLanguageRuntime::LookupInMethodCache
lldb::addr_t LookupInMethodCache(lldb::addr_t class_addr, lldb::addr_t sel)
Definition: ObjCLanguageRuntime.cpp:76
lldb_private::ObjCLanguageRuntime::ClassDescriptor::CheckPointer
virtual bool CheckPointer(lldb::addr_t value, uint32_t ptr_size) const
Definition: ObjCLanguageRuntime.h:107
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::ObjCLanguageRuntime::ConstStringSetHelpers
Definition: ObjCLanguageRuntime.h:407
lldb_private::ObjCLanguageRuntime::ClassDescriptor::GetTaggedPointerInfoSigned
virtual bool GetTaggedPointerInfoSigned(uint64_t *info_bits=nullptr, int64_t *value_bits=nullptr, uint64_t *payload=nullptr)=0