aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-10-10 23:07:36 +0000
committerJason Molenda <jmolenda@apple.com>2014-10-10 23:07:36 +0000
commitaff1b357b0dd8a4035b87ca45df510db0dc9f4ae (patch)
tree9817f5b2e64f086c5e45a936c0bdb953d6b6357e /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
parent3d4340f8c810a5b8be956e9dff2caaadb3c3a79c (diff)
downloadllvm-aff1b357b0dd8a4035b87ca45df510db0dc9f4ae.zip
llvm-aff1b357b0dd8a4035b87ca45df510db0dc9f4ae.tar.gz
llvm-aff1b357b0dd8a4035b87ca45df510db0dc9f4ae.tar.bz2
Add a new disassembly-format specification so that the disassembler
output style can be customized. Change the built-in default to be more similar to gdb's disassembly formatting. The disassembly-format for a gdb-like output is ${addr-file-or-load} <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>: The disassembly-format for the lldb style output is {${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}: The two backticks in the lldb style formatter triggers the sub-expression evaluation in CommandInterpreter::PreprocessCommand() so you can't use that one as-is ... changing to use ' characters instead of ` would work around that. <rdar://problem/9885398> llvm-svn: 219544
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
index c14371d..2163814 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
@@ -832,11 +832,19 @@ const char *DisassemblerLLVMC::SymbolLookup (uint64_t value,
value_so_addr.Dump (&ss,
target,
- Address::DumpStyleResolvedDescriptionNoModule,
+ Address::DumpStyleResolvedDescriptionNoFunctionArguments,
Address::DumpStyleSectionNameOffset);
if (!ss.GetString().empty())
{
+ // If Address::Dump returned a multi-line description, most commonly seen when we
+ // have multiple levels of inlined functions at an address, only show the first line.
+ std::string &str(ss.GetString());
+ size_t first_eol_char = str.find_first_of ("\r\n");
+ if (first_eol_char != std::string::npos)
+ {
+ str.erase (first_eol_char);
+ }
m_inst->AppendComment(ss.GetString());
}
}