diff options
Diffstat (limited to 'source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp')
-rw-r--r-- | source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp b/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp index 81eab8fdd970..23c8416f4986 100644 --- a/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp +++ b/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp @@ -1,9 +1,8 @@ //===-- DynamicLoaderHexagonDYLD.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 // //===----------------------------------------------------------------------===// @@ -21,6 +20,8 @@ #include "DynamicLoaderHexagonDYLD.h" +#include <memory> + using namespace lldb; using namespace lldb_private; @@ -58,7 +59,7 @@ static lldb::addr_t findSymbolAddress(Process *proc, ConstString findName) { for (size_t i = 0; i < symtab->GetNumSymbols(); i++) { const Symbol *sym = symtab->SymbolAtIndex(i); assert(sym != nullptr); - const ConstString &symName = sym->GetName(); + ConstString symName = sym->GetName(); if (ConstString::Compare(findName, symName) == 0) { Address addr = sym->GetAddress(); @@ -103,7 +104,7 @@ DynamicLoader *DynamicLoaderHexagonDYLD::CreateInstance(Process *process, if (create) return new DynamicLoaderHexagonDYLD(process); - return NULL; + return nullptr; } DynamicLoaderHexagonDYLD::DynamicLoaderHexagonDYLD(Process *process) @@ -198,7 +199,7 @@ ModuleSP DynamicLoaderHexagonDYLD::GetTargetExecutable() { return executable; // TODO: What case is this code used? - executable = target.GetSharedModule(module_spec); + executable = target.GetOrCreateModule(module_spec, true /* notify */); if (executable.get() != target.GetExecutableModulePointer()) { // Don't load dependent images since we are in dyld where we will know and // find out about all images that are loaded @@ -242,9 +243,9 @@ void DynamicLoaderHexagonDYLD::UpdateLoadedSections(ModuleSP module, } } -/// Removes the loaded sections from the target in @p module. +/// Removes the loaded sections from the target in \p module. /// -/// @param module The module to traverse. +/// \param module The module to traverse. void DynamicLoaderHexagonDYLD::UnloadSections(const ModuleSP module) { Target &target = m_process->GetTarget(); const SectionList *sections = GetSectionListFromModule(module); @@ -419,7 +420,7 @@ DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(Thread &thread, const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol); Symbol *sym = context.symbol; - if (sym == NULL || !sym->IsTrampoline()) + if (sym == nullptr || !sym->IsTrampoline()) return thread_plan_sp; const ConstString sym_name = sym->GetMangled().GetName( @@ -455,7 +456,8 @@ DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(Thread &thread, llvm::sort(start, end); addrs.erase(std::unique(start, end), end); - thread_plan_sp.reset(new ThreadPlanRunToAddress(thread, addrs, stop)); + thread_plan_sp = + std::make_shared<ThreadPlanRunToAddress>(thread, addrs, stop); } return thread_plan_sp; |