From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- lldb/source/API/SBFunction.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'lldb/source/API/SBFunction.cpp') diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp index 1770bede2f428..e49513bd0da55 100644 --- a/lldb/source/API/SBFunction.cpp +++ b/lldb/source/API/SBFunction.cpp @@ -1,4 +1,4 @@ -//===-- SBFunction.cpp ------------------------------------------*- C++ -*-===// +//===-- SBFunction.cpp ----------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -69,9 +69,7 @@ const char *SBFunction::GetDisplayName() const { const char *cstr = nullptr; if (m_opaque_ptr) - cstr = m_opaque_ptr->GetMangled() - .GetDisplayDemangledName(m_opaque_ptr->GetLanguage()) - .AsCString(); + cstr = m_opaque_ptr->GetMangled().GetDisplayDemangledName().AsCString(); return cstr; } @@ -128,20 +126,15 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target, SBInstructionList sb_instructions; if (m_opaque_ptr) { - ExecutionContext exe_ctx; TargetSP target_sp(target.GetSP()); std::unique_lock lock; - if (target_sp) { - lock = std::unique_lock(target_sp->GetAPIMutex()); - target_sp->CalculateExecutionContext(exe_ctx); - exe_ctx.SetProcessSP(target_sp->GetProcessSP()); - } ModuleSP module_sp( m_opaque_ptr->GetAddressRange().GetBaseAddress().GetModule()); - if (module_sp) { + if (target_sp && module_sp) { + lock = std::unique_lock(target_sp->GetAPIMutex()); const bool prefer_file_cache = false; sb_instructions.SetDisassembler(Disassembler::DisassembleRange( - module_sp->GetArchitecture(), nullptr, flavor, exe_ctx, + module_sp->GetArchitecture(), nullptr, flavor, *target_sp, m_opaque_ptr->GetAddressRange(), prefer_file_cache)); } } -- cgit v1.2.3