summaryrefslogtreecommitdiff
path: root/lldb/source/API/SBFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBFunction.cpp')
-rw-r--r--lldb/source/API/SBFunction.cpp17
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));
}
}