
Lldb
- 360 installs
- 155 repo stars
- Updated June 27, 2026
- mohitmishra786/low-level-dev-skills
Debug crashes, deadlocks, and memory faults in native binaries with LLDB breakpoints, backtraces, register inspection, and scripted debugging on macOS and Linux.
About
Teaches LLDB workflows for diagnosing native crashes and concurrency bugs: launching targets, reading stacks and registers, scripting repeatable debug sessions, and validating fixes on CLI, mobile, and server binaries.
- Breakpoint and watchpoint setup
- Backtrace and frame inspection
- Register and memory reads
- Scripted LLDB automation
- macOS/iOS native debugging
Lldb by the numbers
- 360 all-time installs (skills.sh)
- +25 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #113 of 596 Debugging skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill lldbAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 360 |
|---|---|
| repo stars | ★ 155 |
| Last updated | June 27, 2026 |
| Repository | mohitmishra786/low-level-dev-skills ↗ |
What it does
Debug crashes, deadlocks, and memory faults in native binaries with LLDB breakpoints, backtraces, register inspection, and scripted debugging on macOS and Linux.
Files
LLDB
Purpose
Guide agents through LLDB sessions and map existing GDB knowledge to LLDB. Covers command differences, Apple specifics, Python scripting, and IDE integration.
Triggers
- "I'm on macOS and need to debug a C++ program"
- "How does LLDB differ from GDB?"
- "How do I do [GDB command] in LLDB?"
- "LLDB shows
<unavailable>for variables" - "How do I use LLDB in VS Code?"
- "How do I write an LLDB Python script?"
Workflow
1. Start LLDB
lldb ./prog # load binary
lldb ./prog -- arg1 arg2 # with arguments
lldb -p 12345 # attach to PID
lldb -c core.1234 # load core dump
lldb ./prog core.1234 # binary + core2. GDB → LLDB command map
Source: <https://lldb.llvm.org/use/map.html>
| GDB | LLDB | Notes |
|---|---|---|
run [args] | process launch [args] / r | |
continue | process continue / c | |
next | thread step-over / n | |
step | thread step-in / s | |
nexti | thread step-inst-over / ni | |
stepi | thread step-inst / si | |
finish | thread step-out / finish | |
break main | breakpoint set -n main / b main | |
break file.c:42 | breakpoint set -f file.c -l 42 / b file.c:42 | |
break *0x400abc | breakpoint set -a 0x400abc / b -a 0x400abc | |
watch x | watchpoint set variable x / wa s v x | |
print x | frame variable x / p x | |
print/x x | p/x x | |
info locals | frame variable / fr v | |
info args | frame variable --arguments | |
backtrace | thread backtrace / bt | |
frame N | frame select N / f N | |
info threads | thread list | |
thread N | thread select N | |
thread apply all bt | thread backtrace all | |
x/10wx addr | memory read -s4 -fx -c10 addr / x/10xw addr | |
set var = 42 | expression var = 42 / expr var = 42 | |
quit | quit / q |
3. Breakpoints
# By name
b main
breakpoint set --name foo
breakpoint set --name foo --condition 'x > 0'
# By file:line
b file.c:42
breakpoint set --file file.c --line 42
# By address
b -a 0x100003f20
# By regex
breakpoint set --func-regex '^MyClass::'
# List
breakpoint list / br l
# Delete
breakpoint delete 2
# Disable/enable
breakpoint disable 1
breakpoint enable 1
# Commands on hit
breakpoint command add 1
> p x
> continue
> DONE4. Inspect state
# Print variable
p x
frame variable x
p *ptr
p arr[0]
# Print expression
expression x * 2 + 1
expr (int)sqrt(9.0)
# All locals
frame variable
fr v -a # include arguments
# Registers
register read
register read rip rsp
# Memory
memory read --size 4 --format x --count 10 0x7fff0000
x/10xw 0x7fff0000 # GDB-compatible syntax
# Type info
image lookup --type MyClass
type lookup MyClass5. Watchpoints
watchpoint set variable x # write watchpoint
watchpoint set variable -w read x # read watchpoint
watchpoint set variable -w read_write x
watchpoint set expression -- &x # by address
watchpoint list
watchpoint delete 16. Threads
thread list
thread select 3
thread backtrace all
thread backtrace --count 5 # limit depth
# Per-thread stepping
thread step-over # step this thread only7. macOS / Apple specifics
# Symbol lookup in shared cache
image lookup --address 0x18ab12345
image lookup --name objc_msgSend
# Objective-C method breakpoint
b "-[NSArray objectAtIndex:]"
b "+[NSString stringWithFormat:]"
# Inspect Objective-C object
po myObject # print-object (calls -description)
po [arr count]
# Show loaded libraries
image list
image list -b # brief (names only)8. VS Code integration
Install the CodeLLDB extension. .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug (lldb)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/prog",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "build"
}
]
}9. LLDB Python scripting
import lldb
def print_all_threads(debugger, command, result, internal_dict):
target = debugger.GetSelectedTarget()
process = target.GetProcess()
for thread in process:
print(f"Thread {thread.GetIndexID()}: {thread.GetName()}")
for frame in thread:
print(f" {frame}")
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f myscript.print_all_threads pthreads')Load: command script import /path/to/myscript.py
For a full GDB↔LLDB command map, see references/gdb-lldb-map.md.
Related skills
- Use
skills/debuggers/gdbfor GDB workflows - Use
skills/debuggers/core-dumpsfor core dump analysis - Use
skills/compilers/clangfor building with debug info
GDB to LLDB Command Map
Source: <https://lldb.llvm.org/use/map.html>
Table of Contents
1. Process control 2. Breakpoints 3. Watchpoints 4. Inspection 5. Stack 6. Memory 7. Threads 8. Signals 9. Settings
---
Process control
| GDB | LLDB |
|---|---|
run [args] | process launch [args] / r |
run < file | process launch -i file |
continue | process continue / c |
next | thread step-over / n |
step | thread step-in / s |
nexti | thread step-inst-over / ni |
stepi | thread step-inst / si |
finish | thread step-out / finish |
until N | thread until N |
kill | process kill |
quit | quit / q |
set args a b c | settings set target.run-args a b c |
show args | settings show target.run-args |
---
Breakpoints
| GDB | LLDB |
|---|---|
break main | b main / breakpoint set -n main |
break file.c:42 | b file.c:42 / breakpoint set -f file.c -l 42 |
break *0x400abc | b -a 0x400abc / breakpoint set -a 0x400abc |
break foo if x > 0 | b foo -c 'x > 0' |
tbreak foo | breakpoint set -o -n foo (-o = one-shot) |
rbreak regex | breakpoint set -r regex |
info breakpoints | breakpoint list / br l |
delete N | breakpoint delete N / br del N |
disable N | breakpoint disable N |
enable N | breakpoint enable N |
ignore N count | breakpoint ignore N count |
---
Watchpoints
| GDB | LLDB |
|---|---|
watch x | watchpoint set variable x / wa s v x |
rwatch x | watchpoint set variable -w read x |
awatch x | watchpoint set variable -w read_write x |
info watchpoints | watchpoint list / wa l |
delete N (watchpoint) | watchpoint delete N |
---
Inspection
| GDB | LLDB |
|---|---|
print x / p x | p x / frame variable x |
print/x x | p/x x |
print *ptr | p *ptr |
print arr[0]@10 | p arr[0] (no @ syntax; use loop or Python) |
display x | target stop-hook add --one-liner 'p x' |
info locals | frame variable / fr v |
info args | frame variable --arguments |
info registers | register read |
ptype x | image lookup --type typename / type lookup typename |
whatis x | p x (shows type automatically) |
set var x = 5 | expression x = 5 / expr x = 5 |
---
Stack
| GDB | LLDB |
|---|---|
backtrace / bt | thread backtrace / bt |
bt N | bt -c N |
bt full | bt -e true |
frame N / f N | frame select N / f N |
up | up |
down | down |
info frame | frame info |
---
Memory
| GDB | LLDB |
|---|---|
x/10wx addr | memory read -s4 -fx -c10 addr / x/10xw addr |
x/s addr | memory read -T char -c100 addr / x/s addr |
x/i $rip | memory read --force -fi -c1 $pc / di -s $pc -c1 |
set {int}addr = 42 | memory write -s4 addr 42 |
find addr1, addr2, val | memory find -e val addr1 addr2 |
---
Threads
| GDB | LLDB |
|---|---|
info threads | thread list |
thread N | thread select N |
thread apply all bt | thread backtrace all |
set scheduler-locking on | settings set target.process.thread.step-in-avoid-nodebug true |
---
Signals
| GDB | LLDB |
|---|---|
info signals | process handle |
handle SIGUSR1 nostop | process handle SIGUSR1 -n true -p true -s false |
signal SIGUSR1 | process signal SIGUSR1 |
---
Settings
| GDB | LLDB |
|---|---|
set print pretty on | settings set target.max-children-count 30 |
set pagination off | settings set term-width 0 |
source script.gdb | command source script.lldb |
python ... | script ... |
define cmd ... | command alias cmd ... |