[Lldb-commits] [lldb] r185845 - Use target DisplaySource if available so we can get mixed source and assembly.
Michael Sartain
mikesart at valvesoftware.com
Mon Jul 8 10:56:02 PDT 2013
Author: mikesart
Date: Mon Jul 8 12:56:02 2013
New Revision: 185845
URL: http://llvm.org/viewvc/llvm-project?rev=185845&view=rev
Log:
Use target DisplaySource if available so we can get mixed source and assembly.
This fixes "disassemble -m -n __printf".
Modified:
lldb/trunk/source/Core/Disassembler.cpp
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=185845&r1=185844&r2=185845&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Mon Jul 8 12:56:02 2013
@@ -402,6 +402,9 @@ Disassembler::PrintInstructions
ExecutionContextScope *exe_scope = exe_ctx.GetBestExecutionContextScope();
StackFrame *frame = exe_ctx.GetFramePtr();
+ TargetSP target_sp (exe_ctx.GetTargetSP());
+ SourceManager &source_manager = target_sp ? target_sp->GetSourceManager() : debugger.GetSourceManager();
+
if (frame)
pc_addr_ptr = &frame->GetFrameCodeAddress();
const uint32_t scope = eSymbolContextLineEntry | eSymbolContextFunction | eSymbolContextSymbol;
@@ -438,12 +441,12 @@ Disassembler::PrintInstructions
if (sc.comp_unit && sc.line_entry.IsValid())
{
- debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers (sc.line_entry.file,
- sc.line_entry.line,
- num_mixed_context_lines,
- num_mixed_context_lines,
- ((inst_is_at_pc && (options & eOptionMarkPCSourceLine)) ? "->" : ""),
- &strm);
+ source_manager.DisplaySourceLinesWithLineNumbers (sc.line_entry.file,
+ sc.line_entry.line,
+ num_mixed_context_lines,
+ num_mixed_context_lines,
+ ((inst_is_at_pc && (options & eOptionMarkPCSourceLine)) ? "->" : ""),
+ &strm);
}
}
}
More information about the lldb-commits
mailing list