summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-08-06 08:18:39 +0000
committerPavel Labath <pavel@labath.sk>2019-08-06 08:18:39 +0000
commit001ecbde1112356f7c820037ef1e3ca75f03be3b (patch)
tree9e61d4e080931d5f9d4e42ccb8eb7f8da809d88c /lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
parent1b3718e609c9fd7c8af09d9c9f17e2937847fb38 (diff)
downloadbcm5719-llvm-001ecbde1112356f7c820037ef1e3ca75f03be3b.tar.gz
bcm5719-llvm-001ecbde1112356f7c820037ef1e3ca75f03be3b.zip
SymbolVendorELF: Perform build-id lookup even without a debug link
Summary: The debug link and build-id lookups are two independent ways one can search for a separate symbol file. However, our implementation in SymbolVendorELF was tying the two together and refusing to look up the symbol file based on a build id if the file did not contain a debug link. This patch makes it possible to search for the symbol file with just one of the two methods available. To demonstrate, I split the build-id-case test into two, so that we test the search using both methods. Reviewers: jankratochvil, mgorny, clayborg, espindola, alexshap Subscribers: emaste, arichardson, MaskRay, lldb-commits Differential Revision: https://reviews.llvm.org/D65561 llvm-svn: 367994
Diffstat (limited to 'lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp')
-rw-r--r--lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index a850a1044cf..e61e5763fab 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -71,16 +71,17 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
if (!uuid)
return nullptr;
+ // If the main object file already contains debug info, then we are done.
+ if (obj_file->GetSectionList()->FindSectionByType(
+ lldb::eSectionTypeDWARFDebugInfo, true))
+ return nullptr;
+
// If the module specified a filespec, use that.
FileSpec fspec = module_sp->GetSymbolFileFileSpec();
// Otherwise, try gnu_debuglink, if one exists.
if (!fspec)
fspec = obj_file->GetDebugLink().getValueOr(FileSpec());
- // If we have no debug symbol files, then nothing to do.
- if (!fspec)
- return nullptr;
-
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)",
module_sp->GetFileSpec().GetPath().c_str());
OpenPOWER on IntegriCloud