Toolverse
All skills

debug-lldb

by regenrek

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

Quick info

Author
regenrek
Category
Testing
Views
10

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

  1. Zidentyfikuj proces, który się zawiesił, używając ps lub pgrep, aby uzyskać jego PID.

  2. 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.

  3. 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.

  4. 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).

  5. Skonsultuj się z dokumentacją references/triage.md w celu szybkiego rozpoznania typu problemu.

  6. Dołącz do raportu kontekst: jaką akcję wykonywałeś, kiedy aplikacja się zawiesiła, oraz istotne logi aplikacji z tego okresu.

Related skills