diff options
Diffstat (limited to 'source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp')
-rw-r--r-- | source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp index 425b612d786f0..f279af61a1315 100644 --- a/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ b/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -1,9 +1,8 @@ //===-- SymbolVendorELF.cpp ----------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -16,23 +15,20 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" #include "lldb/Host/Host.h" -#include "lldb/Host/Symbols.h" +#include "lldb/Symbol/LocateSymbolFile.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Target/Target.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/Timer.h" using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // SymbolVendorELF constructor -//---------------------------------------------------------------------- SymbolVendorELF::SymbolVendorELF(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SymbolVendorELF::~SymbolVendorELF() {} void SymbolVendorELF::Initialize() { @@ -54,31 +50,29 @@ const char *SymbolVendorELF::GetPluginDescriptionStatic() { "executables."; } -//---------------------------------------------------------------------- // CreateInstance // // Platforms can register a callback to use when creating symbol vendors to // allow for complex debug information file setups, and to also allow for // finding separate debug information files. -//---------------------------------------------------------------------- SymbolVendor * SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { if (!module_sp) - return NULL; + return nullptr; ObjectFile *obj_file = module_sp->GetObjectFile(); if (!obj_file) - return NULL; + return nullptr; static ConstString obj_file_elf("elf"); ConstString obj_name = obj_file->GetPluginName(); if (obj_name != obj_file_elf) - return NULL; + return nullptr; - lldb_private::UUID uuid; - if (!obj_file->GetUUID(&uuid)) - return NULL; + lldb_private::UUID uuid = obj_file->GetUUID(); + if (!uuid) + return nullptr; // Get the .gnu_debuglink file (if specified). FileSpecList file_spec_list = obj_file->GetDebugSymbolFilePaths(); @@ -90,7 +84,7 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, // If we have no debug symbol files, then nothing to do. if (file_spec_list.IsEmpty()) - return NULL; + return nullptr; static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)", @@ -104,7 +98,9 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, FileSystem::Instance().Resolve(module_spec.GetFileSpec()); module_spec.GetSymbolFileSpec() = fspec; module_spec.GetUUID() = uuid; - FileSpec dsym_fspec = Symbols::LocateExecutableSymbolFile(module_spec); + FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths(); + FileSpec dsym_fspec = + Symbols::LocateExecutableSymbolFile(module_spec, search_paths); if (dsym_fspec) { DataBufferSP dsym_file_data_sp; lldb::offset_t dsym_file_data_offset = 0; @@ -157,12 +153,10 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, } } } - return NULL; + return nullptr; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolVendorELF::GetPluginName() { return GetPluginNameStatic(); } uint32_t SymbolVendorELF::GetPluginVersion() { return 1; } |