[Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.
Zachary Turner via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 28 09:59:59 PST 2017
Author: zturner
Date: Tue Feb 28 11:59:59 2017
New Revision: 296495
URL: http://llvm.org/viewvc/llvm-project?rev=296495&view=rev
Log:
Fix incorrect logic in StackFrame::Disassemble.
This had broken as the result of some previous cleanup.
Modified:
lldb/trunk/source/Target/StackFrame.cpp
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=296495&r1=296494&r2=296495&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Tue Feb 28 11:59:59 2017
@@ -221,18 +221,20 @@ bool StackFrame::ChangePC(addr_t pc) {
const char *StackFrame::Disassemble() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- if (m_disassembly.Empty())
- return nullptr;
-
- ExecutionContext exe_ctx(shared_from_this());
- Target *target = exe_ctx.GetTargetPtr();
- if (target) {
- const char *plugin_name = nullptr;
- const char *flavor = nullptr;
- Disassembler::Disassemble(target->GetDebugger(), target->GetArchitecture(),
- plugin_name, flavor, exe_ctx, 0, false, 0, 0,
- m_disassembly);
+ if (m_disassembly.Empty()) {
+ ExecutionContext exe_ctx(shared_from_this());
+ Target *target = exe_ctx.GetTargetPtr();
+ if (target) {
+ const char *plugin_name = nullptr;
+ const char *flavor = nullptr;
+ Disassembler::Disassemble(target->GetDebugger(),
+ target->GetArchitecture(), plugin_name, flavor,
+ exe_ctx, 0, false, 0, 0, m_disassembly);
+ }
+ if (m_disassembly.Empty())
+ return nullptr;
}
+
return m_disassembly.GetData();
}
More information about the lldb-commits
mailing list