Skip to content

Commit b97d59c

Browse files
author
Kevin Frei
committed
Dealt with the default symbol locator plug-in returning the same binary
1 parent 1494617 commit b97d59c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,19 @@ 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, symbol locator
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+
// If we got the original binary back from the plugin manager, the plugins
117+
// didn't find anything more useful that the stripped binary. (The default
118+
// symbol locator plugin returns the original binary if it can't find
119+
// anything else.)
120+
if (unstripped_spec.GetFileSpec() == module_spec.GetFileSpec())
121+
return nullptr;
115122
dsym_fspec = unstripped_spec.GetFileSpec();
116123
}
117124

0 commit comments

Comments
 (0)