How to switch between source code debug mode and disassembly debug mode in LLDB,like "Xcode->Debug->Debug Workflow->Always show disassembly" menu function?
1 Answer
These four settings control how lldb displays source/assembly when you stop:
stop-disassembly-count -- The number of disassembly lines to show when displaying a stopped context.
stop-disassembly-display -- Control when to display disassembly when displaying a stopped context.
stop-line-count-after -- The number of sources lines to display that come after the current source line when displaying a stopped context.
stop-line-count-before -- The number of sources lines to display that come before the current source line when displaying a stopped context.
So for instance, at the LLDB prompt:
set set stop-disassembly-display always
set set stop-line-count-before 0
set set stop-line-count-after 0
Will only display assembly.
2 Comments
Jim Ingham
There's a sample command in the lldb sources: llvm.org/svn/llvm-project/lldb/trunk/examples/python/… that toggles between this "convenient for assembly" mode and "convenient for source" mode, if you do that sort of thing a lot.
RichieHH
corrected url : github.com/llvm/llvm-project/blob/main/lldb/examples/python/…