From aff1b357b0dd8a4035b87ca45df510db0dc9f4ae Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Fri, 10 Oct 2014 23:07:36 +0000 Subject: 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. llvm-svn: 219544 --- lldb/source/Core/StreamString.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lldb/source/Core/StreamString.cpp') diff --git a/lldb/source/Core/StreamString.cpp b/lldb/source/Core/StreamString.cpp index 8d7d039fd65..ef2b70583eb 100644 --- a/lldb/source/Core/StreamString.cpp +++ b/lldb/source/Core/StreamString.cpp @@ -65,6 +65,22 @@ StreamString::GetSize () const return m_packet.size(); } +size_t +StreamString::GetSizeOfLastLine () const +{ + const size_t length = m_packet.size(); + size_t last_line_begin_pos = m_packet.find_last_of("\r\n"); + if (last_line_begin_pos == std::string::npos) + { + return length; + } + else + { + ++last_line_begin_pos; + return length - last_line_begin_pos; + } +} + std::string & StreamString::GetString() { -- cgit v1.2.3