# GDB vs LLDB For users who are migrating from one debugger to another, here is a table comparison of some of the most common actions and how to do them in GDB and LLDB. Note that both debuggers offer shorthands for typing these commands. | **Functionality** | **GDB Command** | **LLDB Command** | |-----------------------------------------------|----------------------------------------|-------------------------------------------------------------| | **Start Debugging Program** | `gdb ./your-program` | `lldb ./your-program` | | **Set a Breakpoint** | `break ` | `breakpoint set --name ` | | **Set Breakpoint on Address** | `break *
` | `breakpoint set --address
` | | **Set Breakpoint at Line** | `break :` | `breakpoint set --file --line ` | | **Set Hardware Breakpoint** | `hbreak ` | `breakpoint set --hardware --name ` | | **Set Hardware Breakpoint at Memory** | `hbreak *` | `breakpoint set --hardware --address ` | | **List All Breakpoints** | `info breakpoints` | `breakpoint list` | | **Delete Breakpoints** | `delete ` | `breakpoint delete ` | | **Set Watchpoint** | `watch ` | `watchpoint set variable ` | | **Set Conditional Breakpoint** | `break if ` | `breakpoint set --condition ""` | | **Continue Execution** | `continue` | `process continue` | | **Next Instruction** | `next` | `thread step-over` | | **Step into a Function** | `step` | `thread step-in` | | **Step out of a Function** | `finish` | `thread step-out` | | **Print Threads** | `info threads` | `thread list` | | **Select Thread** | `thread ` | `thread select ` | | **Print Register Values** | `info registers` | `register read -a` | | **Print a Variable** | `print ` | `print ` | | **Display Variable on Every Stop** | `display ` | `expression --watch ` | | **Examine Memory (Hex)** | `x/x ` | `memory read --format x --count ` | | **Examine Memory (Integer)** | `x/d ` | `memory read --format d --count ` | | **Inspect Stack Trace** | `backtrace` | `thread backtrace` | | **Change Register Value** | `set $ = ` | `register write ` | | **Check Program Status** | `info locals` | `frame variable` | | **Check Program Info** | `info functions` | `image lookup --functions` | | **Show Disassembly of Function** | `disas ` | `disassemble ` | | **Memory Dump (Hex)** | `x/xh ` | `memory read --format x --count ` | | **Memory Dump (Bytes)** | `x/bx ` | `memory read --format b --count ` | | **Show Process Information** | `info process` | `process status` | | **Quit Debugging** | `quit` | `quit` | | **Run Program with Arguments** | `run ...` | `process launch -- ...` | | **Show Current Function** | `info frame` | `frame info` | | **Set Sysroot** | `set sysroot ` | `settings set target.sysroot ` | | **Set Source Directory** | `directory ` | `settings set target.source-map ` | | **Set Architecture** | `set architecture ` | `target create --arch ` | | **Show Settings** | `show ` | `settings show ` | | **Set File for Debugging** | `file ` | `target create ` | | **Start the Program at the First Instruction**| `starti` | `process launch --stop-at-entry` | | **Enable ASLR** | `set disable-randomization off` | `settings set target.disable-aslr false` |