[Lldb-commits] [lldb] [lldb][debuginfod] Fix the DebugInfoD PR that caused issues when working with stripped binaries (PR #99362)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 10:57:52 PDT 2024


================
@@ -106,12 +106,19 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
   FileSpec dsym_fspec =
       PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
   if (!dsym_fspec || IsDwpSymbolFile(module_sp, dsym_fspec)) {
-    // If we have a stripped binary or if we got a DWP file, we should prefer
-    // symbols in the executable acquired through a plugin.
+    // If we have a stripped binary or if we have a DWP file, symbol locator
+    // plugins may be able to give us an unstripped binary or an
+    // 'only-keep-debug' stripped file.
     ModuleSpec unstripped_spec =
         PluginManager::LocateExecutableObjectFile(module_spec);
     if (!unstripped_spec)
       return nullptr;
+    // If we got the original binary back from the plugin manager, the plugins
+    // didn't find anything more useful that the stripped binary. (The default
+    // symbol locator plugin returns the original binary if it can't find
+    // anything else.)
+    if (unstripped_spec.GetFileSpec() == module_spec.GetFileSpec())
----------------
Jlalond wrote:

Nit, this comment is pretty hard to grok. I also think it can be trimmed down a bit
```
// If the plugin manager returns the original binary, 
// then it failed to find anything else and we should return
```

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


More information about the lldb-commits mailing list