diff options
| author | Jason Molenda <jmolenda@apple.com> | 2015-02-13 23:24:21 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2015-02-13 23:24:21 +0000 |
| commit | c980fa92ebac26a059e0d157362e82ae2f0c7d3a (patch) | |
| tree | 0de6fab178c9e2f0ad661e8ceb1961fe60296b9c /lldb/source/Symbol/SymbolContext.cpp | |
| parent | eff99e8ac53a83bbf9e408f6f59669132b272ae3 (diff) | |
| download | bcm5719-llvm-c980fa92ebac26a059e0d157362e82ae2f0c7d3a.tar.gz bcm5719-llvm-c980fa92ebac26a059e0d157362e82ae2f0c7d3a.zip | |
Change the default disassembly format again. First attempt at
changing it was in r219544 - after living on that for a few
months, I wanted to take another crack at this.
The disassembly-format setting still exists and the old format
can be user specified with a setting like
${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}:
This patch was discussed in http://reviews.llvm.org/D7578
<rdar://problem/19726421>
llvm-svn: 229186
Diffstat (limited to 'lldb/source/Symbol/SymbolContext.cpp')
| -rw-r--r-- | lldb/source/Symbol/SymbolContext.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 62ae6ac464c..d65462be526 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -129,15 +129,15 @@ SymbolContext::Clear(bool clear_target) } bool -SymbolContext::DumpStopContext -( +SymbolContext::DumpStopContext ( Stream *s, ExecutionContextScope *exe_scope, const Address &addr, bool show_fullpaths, bool show_module, bool show_inlined_frames, - bool show_function_arguments + bool show_function_arguments, + bool show_function_name ) const { bool dumped_something = false; @@ -155,7 +155,12 @@ SymbolContext::DumpStopContext { SymbolContext inline_parent_sc; Address inline_parent_addr; - if (show_function_arguments == false && function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments)) + if (show_function_name == false) + { + s->Printf("<"); + dumped_something = true; + } + else if (show_function_arguments == false && function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments)) { dumped_something = true; function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments).Dump(s); @@ -169,7 +174,13 @@ SymbolContext::DumpStopContext if (addr.IsValid()) { const addr_t function_offset = addr.GetOffset() - function->GetAddressRange().GetBaseAddress().GetOffset(); - if (function_offset) + if (show_function_name == false) + { + // Print +offset even if offset is 0 + dumped_something = true; + s->Printf("+%" PRIu64 ">", function_offset); + } + else if (function_offset) { dumped_something = true; s->Printf(" + %" PRIu64, function_offset); @@ -202,7 +213,8 @@ SymbolContext::DumpStopContext { s->EOL(); s->Indent(); - return inline_parent_sc.DumpStopContext (s, exe_scope, inline_parent_addr, show_fullpaths, show_module, show_inlined_frames, show_function_arguments); + const bool show_function_name = true; + return inline_parent_sc.DumpStopContext (s, exe_scope, inline_parent_addr, show_fullpaths, show_module, show_inlined_frames, show_function_arguments, show_function_name); } } else @@ -218,7 +230,12 @@ SymbolContext::DumpStopContext } else if (symbol != nullptr) { - if (symbol->GetMangled().GetName()) + if (show_function_name == false) + { + s->Printf("<"); + dumped_something = true; + } + else if (symbol->GetMangled().GetName()) { dumped_something = true; if (symbol->GetType() == eSymbolTypeTrampoline) @@ -229,7 +246,13 @@ SymbolContext::DumpStopContext if (addr.IsValid() && symbol->ValueIsAddress()) { const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddress().GetOffset(); - if (symbol_offset) + if (show_function_name == false) + { + // Print +offset even if offset is 0 + dumped_something = true; + s->Printf("+%" PRIu64 ">", symbol_offset); + } + else if (symbol_offset) { dumped_something = true; s->Printf(" + %" PRIu64, symbol_offset); |

