[Lldb-commits] [lldb] [lldb] Enable locate module callback for main executable (PR #160199)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 1 16:03:44 PDT 2025


================
@@ -1087,6 +1089,24 @@ ModuleList::GetSharedModule(const ModuleSpec &module_spec, ModuleSP &module_sp,
   if (module_sp)
     return error;
 
+  // Try target's platform locate module callback before second attempt
+  if (allow_locate_callback) {
+    ModuleSpec module_spec_copy(module_spec);
+    Target *target = module_spec_copy.GetTargetPtr();
+    if (target && target->IsValid()) {
+      Platform *platform = target->GetPlatform().get();
+      if (platform) {
+        FileSpec symbol_file_spec;
+        platform->CallLocateModuleCallbackIfSet(
+            module_spec, module_sp, symbol_file_spec, did_create_ptr);
+        if (module_sp) {
+          // Success! The callback found a module
----------------
JDevlieghere wrote:

```suggestion
        if (module_sp) {
          // The callback found a module.
          return error;
        }
```

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


More information about the lldb-commits mailing list