/lldb_debug_tutorials

some lldb debugging tutorials and conventional usages

lldb_debug_tutorials

some lldb debugging tutorials and conventional usages

typical procedures:

  1. fire the lldb in command line
$ lldb
  1. load the binary file of executable (e.g. program_debug)
(lldb) file program_debug
  1. launch process with demanded program arguments
(lldb) process launch -- <arguments feed to the program_debug>
  1. after some running, the code would encounter a crash or exception from somewhere, at this time, add breakpoint at the crashing line of code and launch process again
(lldb) breakpoint set --file <file_to_break>.cpp --line <line_number>
(lldb) process launch -- <arguments feed to the program_debug>
  1. the program would break at the breakpoint, it's the right time to checkout the stack data for the crashing details, using bt command (short for traceback) to print the stack data
(lldb) bt
  1. if you wanna drop the debug but keep the lldb debugging context, using run to restart the launch
(lldb) run

related useful links:

  1. GDB and LLDB debugging command examples
  2. Using LLDB as a standalone debugger which means the user need not extra IDE assistance.