docs/agents/lldb-debugging.md
The clang-tool-chain package includes LLDB debugger support for interactive debugging and crash analysis. However, the existing crash handler already provides excellent stack traces that are often sufficient for debugging.
The clang-tool-chain package provides:
clang-tool-chain-lldb - LLDB debugger wrapperclang-tool-chain-lldb-check-python - Check Python bindings status~/.clang-tool-chain/lldb/win/x86_64/bin/lldb.exe# Interactive debugging
uv run clang-tool-chain-lldb executable.exe
# Automated crash analysis (--print mode)
uv run clang-tool-chain-lldb --print executable.exe
# Interactive LLDB session (no executable)
uv run clang-tool-chain-lldb
uv run clang-tool-chain-lldb --help
IMPORTANT: FastLED already has built-in crash handlers that provide excellent stack traces with:
#7 0x00007ffadf7d1d2c [fl_test.dll] function_c() + 84
(Line 9 of "../../tests/fl\test.cpp" starts at address 0x180001d2c)
#8 0x00007ffadf7d1cc7 [fl_test.dll] function_b() + 15
(Line 13 of "../../tests/fl\test.cpp" starts at address 0x180001cc2)
#9 0x00007ffadf7d1ca7 [fl_test.dll] function_a() + 15
(Line 17 of "../../tests/fl\test.cpp" starts at address 0x180001ca2)
The existing crash handlers catch signals before LLDB can intercept them, which means:
--print mode cannot capture crashes automaticallyLLDB is most useful for:
The built-in crash handler is sufficient for:
The FastLED test framework (uv run test.py) automatically:
To compile tests in debug mode:
uv run test.py <test_name> --cpp --build-mode debug
Common LLDB commands for debugging (migrated from GDB):
| Task | GDB Command | LLDB Command |
|---|---|---|
| Run program | gdb <program> | uv run clang-tool-chain-lldb <program> |
| Backtrace | bt | bt |
| Full backtrace | bt full | bt all |
| Select frame | frame <n> | frame select <n> |
| Print variable | print <var> | print <var> or p <var> |
| Show locals | info locals | frame variable |
| Show args | info args | frame variable |
| Registers | info registers | register read |
| Memory dump | x/<format> <addr> | memory read <addr> |
| Set breakpoint | break <location> | breakpoint set -n <function> or b <file>:<line> |
| Continue | continue or c | continue or c |
| Step over | next or n | next or n |
| Step into | step or s | step or s |
| Step out | finish | finish |
The built-in crash handler provides stack traces that are sufficient for most debugging needs. LLDB is available if you need interactive debugging, but the automatic crash analysis mode is currently blocked by the existing crash handler.
For typical unit test debugging, rely on the existing stack traces. For complex interactive debugging, use LLDB directly with breakpoints.