debug-lldb
Capture and analyze thread backtraces with LLDB/GDB to debug hangs, deadlocks, UI freezes, IPC stalls, or high-CPU loops across any language or project. Use when an app becomes unresponsive, switching contexts stalls, or you need thread stacks to locate lock inversion or
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Capture and analyze thread backtraces with LLDB/GDB to debug hangs, deadlocks, UI freezes, IPC stalls, or high-CPU loops across any language or project. Use when an app becomes unresponsive, switching contexts stalls, or you need thread stacks to locate lock inversion or blocking calls.
How to use
Zidentyfikuj proces, który się zawiesił, używając
pslubpgrep, aby uzyskać jego PID.Uruchom skrypt zbierający stacktrace'e w osobnym terminalu:
scripts/collect_stacks.sh --pid <PID> --out /tmp/hang --repeat 3 --sleep 0.5. Możesz też podać nazwę procesu zamiast PID:scripts/collect_stacks.sh --name "<nazwa-procesu>" --out /tmp/hang.Jeśli wolisz zbierać stacktrace'e ręcznie, na macOS użyj:
lldb -p <PID> -o 'thread backtrace all' -o 'detach' -o 'quit' > /tmp/hang.txt 2>&1. Na Linuxie:gdb -q -p <PID> -ex "thread apply all bt" -ex "detach" -ex "quit" > /tmp/hang.txt 2>&1. Na Windowsie użyj WinDbg lub cdb.Porównaj 3–5 próbek stacktrace'ów zebranych w odstępach 0,2–1 sekundy, aby zidentyfikować wzorzec zawieszenia (deadlock, pętla CPU czy blokujące I/O).
Skonsultuj się z dokumentacją
references/triage.mdw celu szybkiego rozpoznania typu problemu.Dołącz do raportu kontekst: jaką akcję wykonywałeś, kiedy aplikacja się zawiesiła, oraz istotne logi aplikacji z tego okresu.