diff options
| author | Mohit K. Bhakkad <mohit.bhakkad@gmail.com> | 2015-12-03 04:56:16 +0000 |
|---|---|---|
| committer | Mohit K. Bhakkad <mohit.bhakkad@gmail.com> | 2015-12-03 04:56:16 +0000 |
| commit | 8be749950755072c01024d7e7420d72e7eb6931a (patch) | |
| tree | 590def79fd865ff6fbf9df503b7d557286b92a64 /lldb/source/Target/StackFrame.cpp | |
| parent | 9760f037574d33cd273a3e852e554456600851ff (diff) | |
| download | bcm5719-llvm-8be749950755072c01024d7e7420d72e7eb6931a.tar.gz bcm5719-llvm-8be749950755072c01024d7e7420d72e7eb6931a.zip | |
[LLDB] Switch to assembly view if source is moved
Reviewers: clayborg, jingham, jasonmolenda.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain,lldb-commits.
Differential Revision: http://reviews.llvm.org/D12877
llvm-svn: 254588
Diffstat (limited to 'lldb/source/Target/StackFrame.cpp')
| -rw-r--r-- | lldb/source/Target/StackFrame.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 5f3ed29eafd..e835521e788 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -1519,7 +1519,7 @@ StackFrame::GetStatus (Stream& strm, if (show_source) { ExecutionContext exe_ctx (shared_from_this()); - bool have_source = false; + bool have_source = false, have_debuginfo = false; Debugger::StopDisassemblyType disasm_display = Debugger::eStopDisassemblyTypeNever; Target *target = exe_ctx.GetTargetPtr(); if (target) @@ -1532,26 +1532,35 @@ StackFrame::GetStatus (Stream& strm, GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry); if (m_sc.comp_unit && m_sc.line_entry.IsValid()) { - have_source = true; + have_debuginfo = true; if (source_lines_before > 0 || source_lines_after > 0) { - target->GetSourceManager().DisplaySourceLinesWithLineNumbers (m_sc.line_entry.file, + size_t num_lines = target->GetSourceManager().DisplaySourceLinesWithLineNumbers (m_sc.line_entry.file, m_sc.line_entry.line, source_lines_before, source_lines_after, "->", &strm); + if (num_lines != 0) + have_source = true; + // TODO: Give here a one time warning if source file is missing. } } switch (disasm_display) { case Debugger::eStopDisassemblyTypeNever: break; - + + case Debugger::eStopDisassemblyTypeNoDebugInfo: + if (have_debuginfo) + break; + // Fall through to next case + case Debugger::eStopDisassemblyTypeNoSource: if (have_source) break; // Fall through to next case + case Debugger::eStopDisassemblyTypeAlways: if (target) { |

