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

via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 22 14:00:30 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- lldb/source/Target/Platform.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index 1b2ac3aa9..2ec4e97f6 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -751,17 +751,19 @@ Platform::ResolveExecutable(const ModuleSpec &module_spec,
   if (resolved_module_spec.GetArchitecture().IsValid() ||
       resolved_module_spec.GetUUID().IsValid()) {
     // Call locate module callback first to give it a chance to find/register
-    // symbol file specs for the main executable, similar to how shared libraries
-    // are handled in Platform::GetRemoteSharedModule()
+    // symbol file specs for the main executable, similar to how shared
+    // libraries are handled in Platform::GetRemoteSharedModule()
     FileSpec symbol_file_spec;
     CallLocateModuleCallbackIfSet(resolved_module_spec, exe_module_sp,
                                   symbol_file_spec, nullptr);
 
     Status error;
     if (!exe_module_sp) {
-      // If locate module callback didn't provide a module, fallback to standard path
+      // If locate module callback didn't provide a module, fallback to standard
+      // path
       error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
-                                          module_search_paths_ptr, nullptr, nullptr);
+                                          module_search_paths_ptr, nullptr,
+                                          nullptr);
     }
 
     if (exe_module_sp && exe_module_sp->GetObjectFile()) {
@@ -769,7 +771,8 @@ Platform::ResolveExecutable(const ModuleSpec &module_spec,
       if (symbol_file_spec) {
         exe_module_sp->SetSymbolFileFileSpec(symbol_file_spec);
       }
-      return error; // Return the actual status from GetSharedModule (or success from callback)
+      return error; // Return the actual status from GetSharedModule (or success
+                    // from callback)
     }
     exe_module_sp.reset();
   }

``````````

</details>


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


More information about the lldb-commits mailing list