diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /lldb/source/API/SBFunction.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'lldb/source/API/SBFunction.cpp')
-rw-r--r-- | lldb/source/API/SBFunction.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
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<std::recursive_mutex> lock; - if (target_sp) { - lock = std::unique_lock<std::recursive_mutex>(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<std::recursive_mutex>(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)); } } |