Skip to content

Commit 3a9769c

Browse files
author
Kevin Frei
committed
Deal with the default symbol locator plug-in returning the original stripped binary
1 parent b3fe995 commit 3a9769c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,17 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
106106
FileSpec dsym_fspec =
107107
PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
108108
if (!dsym_fspec || IsDwpSymbolFile(module_sp, dsym_fspec)) {
109-
// If we have a stripped binary or if we got a DWP file, we should prefer
110-
// symbols in the executable acquired through a plugin.
109+
// If we have a stripped binary or if we have a DWP file, SymbolLocator
110+
// plugins may be able to give us an unstripped binary or an
111+
// 'only-keep-debug' stripped file.
111112
ModuleSpec unstripped_spec =
112113
PluginManager::LocateExecutableObjectFile(module_spec);
113114
if (!unstripped_spec)
114115
return nullptr;
116+
// The default SymbolLocator plugin returns the original binary if no other
117+
// plugin finds something better.
118+
if (unstripped_spec.GetFileSpec() == module_spec.GetFileSpec())
119+
return nullptr;
115120
dsym_fspec = unstripped_spec.GetFileSpec();
116121
}
117122

0 commit comments

Comments
 (0)