GDB and LLDB Debugger Snippets
Source: GDB to LLDB command map, Debugging Rust apps with GDB - LogRocket Blog, Debugging with GDB (GDB manual)
Note commands/aliases like run (r), step (s), and breakpoint (b) are similar or same with GDB and LLDB
Commands below are confirmed to work with rust-gdb
# Debug specific binaryrust-gdb target/debug/examples/basic
# Help informationhelp
# Quitq
# Runr
# Set breakpoint (break) on a functionb get_chip
# Set breakpoint on file and line numberb main.rs:22
# Breakpoint informationb info
# Breakpoint disable itdisable 1
# Breakpoint in temporary place, breakpoint will only occur oncetbreak 6
# Step - next, go to next linen
# Step - step into like a function, run next line of codes
# Step N - run next N lines of codes Number
# Step - finish functionfinish
# Step - continue execution until new breakpoint or endc
# Repeat previous commandEnter
# Check incoming argumentsinfo args
# Print information on variable, functionprint myvariablep variable_namep code_element
# Frame - check current code execution linef# Set - change state of variablesset var_name = my_value
# List - print source lines, print lines centered around line numberl 2list 6# List - print source around beginnning of functionlist function_name
# Layout - See debugging location in source codelayout srclayout split
# Layout - remove layoutCtrl + x a