[lldb-dev] disassemble w/ source
Greg Clayton
gclayton at apple.com
Mon Jul 8 10:50:04 PDT 2013
That is the correct fix. Looks good.
On Jul 5, 2013, at 4:22 PM, Michael Sartain <mikesart at gmail.com> wrote:
> On Fri, Jul 5, 2013 at 3:54 PM, Michael Sartain <mikesart at gmail.com> wrote:
> When I explicitly run the "disassemble -m -n printf" command I don't get source even though we've obviously got source and I'm stepping through it. Example is way down below.
>
> This patch fixes the issue and I believe is similar to what DisplaySourceLinesWithLineNumbers() in SBSourceManager.cpp does.
>
> Please let me know if this is ok to check in (or not...) Thanks.
> -Mike
>
> mikesart at mikesart-rad:~/data/src/llvm.svn/llvm/tools/lldb$ svn diff source/Core/Disassembler.cpp
> Index: source/Core/Disassembler.cpp
> ===================================================================
> --- source/Core/Disassembler.cpp (revision 185589)
> +++ source/Core/Disassembler.cpp (working copy)
> @@ -402,6 +402,9 @@
> 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 @@
>
> 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);
> }
> }
> }
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
More information about the lldb-dev
mailing list