llvm-project/lldb/source/Commands
Jason Molenda 0b4c26b2cc I'm experimenting with changing how the mixed source & assembly
mode in lldb works.  I've been discussing this with Jim Ingham,
Greg Clayton, and Kate Stone for the past week or two.

Previously lldb would print three source lines (centered on the
line table entry line for the current line) followed by the assembly.
It would print the context information (module`function + offset)
before those three lines of source.

Now lldb will print up to two lines before/after the line table
entry.  It prints two '*' characters for the line table line to
make it clear what line is showing assembly.  There is one line of
whitespace before/after the source lines so the separation between
source & assembly is clearer.  I don't print the context line
(module`function + offset).  I stop printing context lines if it's
a different line table entry, or if it's a source line I've already
printed as context to another source line.  If I have two line table
entries one after another for the same source line (I get these often
with clang - with different column information in them), I only print
the source line once.

I'm also using the target.process.thread.step-avoid-regexp setting
(which keeps you from stepping into STL functions that have been inlined
into your own code) and avoid printing any source lines from functions
that match that regexp.

When lldb disassembles into a new function, it will try to find the
declaration line # for the function and print all of the source lines
between the decl and the first line table entry (usually a { curly brace)
so we have a good chance of including the arguments, at least with the
debug info emitted by clang.

Finally, the # of source lines of context to show has been separated
from whether we're doing mixed source & assembly or not.  Previously
specifying 0 lines of context would turn off mixed source & assembly.

I think there's room for improvement, and maybe some bugs I haven't
found yet, but it's in good enough shape to upstream and iterate at
this point.

I'm not sure how best to indicate which source line is the actual line
table # versus context lines.  I'm using '**' right now.  Both Kate
and Greg had the initial idea to reuse '->' (normally used to indicate
"currently executing source line") - I tried it but I wasn't thrilled,
I'm too used to the established meaning of ->.

Greg had the interesting idea of avoiding context source lines only 
in two line table entries in the same source file.  So we'd print
two lines before & after a source line, and then the next line table
entry (if it was on the next source line after those two context lines)
we'd display only the following two lines -- the previous two had just
been printed.  If an inline source line was printed between these two,
though, we'd print the context lines for both of them.  It's an
interesting idea, and I want to see how it works with both -O0 and -O3
codegen where we have different amounts of inlining.

<rdar://problem/27961419> 

llvm-svn: 280906
2016-09-08 05:12:41 +00:00
..
CMakeLists.txt [cmake] Remove LLVM_NO_RTTI. 2015-09-03 08:46:55 +00:00
CommandCompletions.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectApropos.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectApropos.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectArgs.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectArgs.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBreakpoint.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBreakpoint.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBreakpointCommand.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBreakpointCommand.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBugreport.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBugreport.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectCommands.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectCommands.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectDisassemble.cpp I'm experimenting with changing how the mixed source & assembly 2016-09-08 05:12:41 +00:00
CommandObjectDisassemble.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectExpression.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectExpression.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectFrame.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectFrame.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectGUI.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectGUI.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectHelp.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectHelp.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectLanguage.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectLanguage.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectLog.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectLog.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectMemory.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectMemory.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectMultiword.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectPlatform.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectPlatform.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectPlugin.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectPlugin.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectProcess.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectProcess.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectQuit.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectQuit.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectRegister.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectRegister.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSettings.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSettings.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSource.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSource.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSyntax.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSyntax.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectTarget.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectTarget.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectThread.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectThread.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectType.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectType.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectVersion.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectVersion.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectWatchpoint.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectWatchpoint.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectWatchpointCommand.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectWatchpointCommand.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00