Yes, the right way to do this is through the Python scripting interface. There was a deliberate decision to avoid the gdb approach, which requires sufficient control of the flow and execution logic in the debugger command language to make this possible (or rather, to make it possible ... bad). Instead, there is a low barrier where you need to use Python to complete the task, but the full power of the debugger is available through some fairly easy-to-use interfaces in Python. lldb derives a scripting language in Python and concentrates on providing a clean and powerful API that is easy to use from Python.
But to solve your goal here, why does stop-disassembly-count setup not do what you need? In fact, it should already do what you need if you did not turn off the disassembly display in your ~/.lldbinit file by changing the default stop-disassembly-display .
(lldb) settings show stop-disassembly-count stop-disassembly-count (int) = 4 (lldb) settings show stop-disassembly-display stop-disassembly-display (enum) = no-source (lldb)
lldb's default behavior is to show some context when you go through the program. If source code is available, it will show the source you are going through. If there is no source, it will show the assembly instructions that must be followed. There is a small error when you have debugging information (therefore, the debugger knows the file and line numbers), but the source code is not available (or in another way) - right now lldb will show you the disassembly, but this is the wrong behavior for This is the case. Users still work at the source level (using s and n for the step instead of si and ni for stepping at the instruction level), and lldb should not show context in this instance, just displaying the source file name and line number.
source share