diff options
author | Greg Clayton <gclayton@apple.com> | 2011-04-23 02:04:55 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-04-23 02:04:55 +0000 |
commit | 7e14f91dbd0c651e2add6384da4e88f510919822 (patch) | |
tree | 6f6eff5c7bd830b2a2bc09026409de248cb4414a /lldb/source/Core/Disassembler.cpp | |
parent | 3d2185ba82ddf4f4a792b4c846390d8c445be311 (diff) | |
download | bcm5719-llvm-7e14f91dbd0c651e2add6384da4e88f510919822.tar.gz bcm5719-llvm-7e14f91dbd0c651e2add6384da4e88f510919822.zip |
Fixed the SymbolContext::DumpStopContext() to correctly indent and dump
inline contexts when the deepest most block is not inlined.
Added source path remappings to the lldb_private::Target class that allow it
to remap paths found in debug info so we can find source files that are elsewhere
on the current system.
Fixed disassembly by function name to disassemble inline functions that are
inside other functions much better and to show enough context before the
disassembly output so you can tell where things came from.
Added the ability to get more than one address range from a SymbolContext
class for the case where a block or function has discontiguous address ranges.
llvm-svn: 130044
Diffstat (limited to 'lldb/source/Core/Disassembler.cpp')
-rw-r--r-- | lldb/source/Core/Disassembler.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index 0e0ea053ef0..c765e6cb939 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -119,12 +119,13 @@ Disassembler::Disassemble const size_t count = sc_list.GetSize(); SymbolContext sc; AddressRange range; - + const uint32_t scope = eSymbolContextBlock | eSymbolContextFunction | eSymbolContextSymbol; + const bool use_inline_block_range = true; for (size_t i=0; i<count; ++i) { if (sc_list.GetContextAtIndex(i, sc) == false) break; - if (sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, range)) + for (uint32_t range_idx = 0; sc.GetAddressRange(scope, range_idx, use_inline_block_range, range); ++range_idx) { if (Disassemble (debugger, arch, @@ -340,8 +341,11 @@ Disassembler::PrintInstructions SymbolContext prev_sc; AddressRange sc_range; Address *pc_addr_ptr = NULL; + ExecutionContextScope *exe_scope = exe_ctx.GetBestExecutionContextScope(); if (exe_ctx.frame) pc_addr_ptr = &exe_ctx.frame->GetFrameCodeAddress(); + const uint32_t scope = eSymbolContextLineEntry | eSymbolContextFunction | eSymbolContextSymbol; + const bool use_inline_block_range = false; for (size_t i=0; i<num_instructions_found; ++i) { @@ -363,7 +367,7 @@ Disassembler::PrintInstructions { if (!sc_range.ContainsFileAddress (addr)) { - sc.GetAddressRange (eSymbolContextEverything, sc_range); + sc.GetAddressRange (scope, 0, use_inline_block_range, sc_range); if (sc != prev_sc) { @@ -375,7 +379,8 @@ Disassembler::PrintInstructions if (sc.comp_unit && sc.line_entry.IsValid()) { - debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers (sc.line_entry.file, + debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers (debugger.GetTargetList().GetSelectedTarget().get(), + sc.line_entry.file, sc.line_entry.line, num_mixed_context_lines, num_mixed_context_lines, @@ -390,12 +395,16 @@ Disassembler::PrintInstructions if (prev_sc.function || prev_sc.symbol) strm.EOL(); - strm << sc.module_sp->GetFileSpec().GetFilename(); + bool show_fullpaths = false; + bool show_module = true; + bool show_inlined_frames = true; + sc.DumpStopContext (&strm, + exe_scope, + addr, + show_fullpaths, + show_module, + show_inlined_frames); - if (sc.function) - strm << '`' << sc.function->GetMangled().GetName(); - else if (sc.symbol) - strm << '`' << sc.symbol->GetMangled().GetName(); strm << ":\n"; } } |