[Lldb-commits] [lldb] [lldb] Scope symbol lookups to specific modules in ObjC/SystemRuntime plugins (PR #193379)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 22 00:24:17 PDT 2026


================
@@ -459,20 +459,30 @@ bool AppleObjCRuntime::CalculateHasNewLiteralsAndIndexing() {
   if (!m_process)
     return false;
 
-  Target &target(m_process->GetTarget());
+  Target &target = m_process->GetTarget();
 
   static ConstString s_method_signature(
       "-[NSDictionary objectForKeyedSubscript:]");
   static ConstString s_arclite_method_signature(
       "__arclite_objectForKeyedSubscript");
+  // NSDictionary is toll-free bridged with CFDictionary, so the
+  // implementation lives in CoreFoundation, not Foundation.
+  static ModuleSpec corefoundation_module_spec(FileSpec("CoreFoundation"));
+
+  if (ModuleSP corefoundation_module_sp =
+          target.GetImages().FindFirstModule(corefoundation_module_spec)) {
----------------
jasonmolenda wrote:

I might be misreading, I see other places where we do this like
```
  // libdispatch symbols are in their own dylib as of Mac OS X 10.7 ("Lion")
  // and later
  if (dispatch_queue_offsets_symbol == nullptr) {
    ModuleSpec libdispatch_module_spec(FileSpec("libdispatch.dylib"));
    module_sp = m_process->GetTarget().GetImages().FindFirstModule(
        libdispatch_module_spec);
    if (module_sp)
      dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType(
          g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
```

https://github.com/llvm/llvm-project/pull/193379


More information about the lldb-commits mailing list