cli-anything-lldb
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLLDB CLI Skill
LLDB CLI 调试工具
Use this CLI to run structured LLDB debugging workflows with JSON output.
使用该CLI工具以JSON输出形式运行结构化的LLDB调试工作流。
Capabilities
功能特性
- Create debug target from executable path
- Launch process or attach by pid/name
- Manage breakpoints (set/list/delete/enable/disable)
- Inspect threads, frames, locals, and backtrace
- Evaluate expressions in current frame
- Read/find process memory
- Load core dumps
- Interactive REPL with persistent session state
- Formal stdio Debug Adapter Protocol server for AI/editor clients
- 从可执行文件路径创建调试目标
- 启动进程或通过进程ID/名称附加进程
- 管理断点(设置/列出/删除/启用/禁用)
- 检查线程、栈帧、局部变量和回溯信息
- 在当前栈帧中计算表达式
- 读取/查找进程内存
- 加载核心转储文件
- 具有持久会话状态的交互式REPL环境
- 面向AI/编辑器客户端的标准stdio Debug Adapter Protocol服务器
Quick Commands
快速命令
bash
cli-anything-lldb --json target create --exe /path/to/exe
cli-anything-lldb --json process launch --arg foo --arg bar
cli-anything-lldb --json breakpoint set --function main
cli-anything-lldb --json breakpoint set --function PluginEntry --allow-pending
cli-anything-lldb --json process continue
cli-anything-lldb --json process interrupt
cli-anything-lldb --json thread backtrace --limit 20
cli-anything-lldb --json frame locals
cli-anything-lldb --json expr "myVar"
cli-anything-lldb --json memory read --address 0x1000 --size 64
cli-anything-lldb --json session closebash
cli-anything-lldb --json target create --exe /path/to/exe
cli-anything-lldb --json process launch --arg foo --arg bar
cli-anything-lldb --json breakpoint set --function main
cli-anything-lldb --json breakpoint set --function PluginEntry --allow-pending
cli-anything-lldb --json process continue
cli-anything-lldb --json process interrupt
cli-anything-lldb --json thread backtrace --limit 20
cli-anything-lldb --json frame locals
cli-anything-lldb --json expr "myVar"
cli-anything-lldb --json memory read --address 0x1000 --size 64
cli-anything-lldb --json session closeDebug Adapter Protocol
Debug Adapter Protocol(调试适配器协议)
Use the DAP entry point when an AI client needs a real debug adapter lifecycle
instead of shelling out separate CLI commands:
bash
cli-anything-lldb-dap
cli-anything-lldb-dap --profile /path/to/stop-rules.jsonor:
bash
cli-anything-lldb dap
cli-anything-lldb dap --profile /path/to/stop-rules.jsonThe DAP server speaks stdio frames and must have exclusive
stdout. Do not print logs to stdout around it. Supported requests include
, , , , ,
, , , , ,
, , , , , , ,
, , , , ,
, and .
Content-LengthinitializelaunchattachconfigurationDonesetBreakpointssetFunctionBreakpointsthreadsstackTracescopesvariablessetVariableevaluatecontinuepausenextstepInstepOutsourceloadedSourcesreadMemorymodulesexceptionInfodisassembledisconnectDAP variables can expose child references for structs/classes/arrays. Use
only while stopped; LLDB may reject writes to optimized-out or
read-only values.
setVariableFor long-running GUI debuggees, DAP is non-blocking from the client's
point of view: the adapter sends the response and event first, then
waits for LLDB on a background thread. DAP uses LLDB async interrupt.
If an agent needs to change breakpoints while the debuggee is running, the
adapter interrupts first and waits for a stopped state before mutating LLDB
breakpoints; if the target does not stop in time, retry after an explicit
/ cycle.
continuecontinuedpausepausestoppedFor GUI apps that stop on debugger-internal startup or shader-JIT breakpoints,
and accept the non-standard boolean argument
. Enable it only when those internal stops are
noise for the task; the adapter emits an event before auto-continuing.
For target-specific noise, prefer structured stop rules through inline
or an external / JSON file. Rules can
match by , , , and/or , then either with
clear metadata or automatically. Use
profiles for apps such as C4D so their NVIDIA shader-JIT/startup traps live
outside the generic adapter.
launchattachautoContinueInternalBreakpointsoutputstopRulesstopRuleProfile--profilereasonmodulefunctionregexstopcliAnythingStop.origincontinueDAP events include : for a
client pause request, for a matched internal rule, and
for ordinary program stops. Existing processes do not
hot-load new code or profile contents; restart the adapter and re-attach or
re-launch before expecting new rules to apply.
stoppedbody.cliAnythingStop.originmanualPauseinternalTrapdebuggeecli-anything-lldb-dap当AI客户端需要完整的调试适配器生命周期,而非单独执行CLI命令时,请使用DAP入口:
bash
cli-anything-lldb-dap
cli-anything-lldb-dap --profile /path/to/stop-rules.json或:
bash
cli-anything-lldb dap
cli-anything-lldb dap --profile /path/to/stop-rules.jsonDAP服务器采用stdio 帧通信,必须独占标准输出。请勿在其周围向标准输出打印日志。支持的请求包括、、、、、、、、、、、、、、、、、、、、、、和。
Content-LengthinitializelaunchattachconfigurationDonesetBreakpointssetFunctionBreakpointsthreadsstackTracescopesvariablessetVariableevaluatecontinuepausenextstepInstepOutsourceloadedSourcesreadMemorymodulesexceptionInfodisassembledisconnectDAP变量可暴露结构体/类/数组的子引用。仅在进程暂停时使用;LLDB可能会拒绝写入已优化掉或只读的值。
setVariable对于长期运行的GUI调试目标,从客户端角度来看,DAP 是非阻塞的:适配器先发送响应和事件,然后在后台线程等待LLDB。DAP 使用LLDB异步中断。如果Agent需要在调试目标运行时修改断点,适配器会先中断进程,等待进入暂停状态后再修改LLDB断点;如果目标未及时暂停,请在显式执行/循环后重试。
continuecontinuedpausepausestopped对于在调试器内部启动或着色器JIT断点处暂停的GUI应用,和接受非标准布尔参数。仅当这些内部暂停对任务来说是干扰时才启用该参数;适配器会在自动继续前发出事件。针对特定目标的干扰,建议通过内联或外部/ JSON文件使用结构化暂停规则。规则可通过、、和/或进行匹配,然后要么带着清晰的元数据(暂停),要么自动(继续)。对于C4D等应用,请使用配置文件,使其NVIDIA着色器JIT/启动陷阱独立于通用适配器。
launchattachautoContinueInternalBreakpointsoutputstopRulesstopRuleProfile--profilereasonmodulefunctionregexcliAnythingStop.originstopcontinueDAP 事件包含字段:表示客户端暂停请求,表示匹配到内部规则,表示普通程序暂停。已运行的进程不会热加载新代码或配置文件内容;在期望新规则生效前,请重启适配器并重新附加或重新启动调试目标。
stoppedbody.cliAnythingStop.originmanualPauseinternalTrapdebuggeecli-anything-lldb-dapCommand Groups
命令组
target
target(目标)
bash
cli-anything-lldb --json target create --exe /path/to/exe [--arch x86_64]
cli-anything-lldb --json target infobash
cli-anything-lldb --json target create --exe /path/to/exe [--arch x86_64]
cli-anything-lldb --json target infoprocess
process(进程)
bash
cli-anything-lldb --json process launch [--arg ARG ...] [--env KEY=VALUE ...] [--cwd DIR] [--stop-at-entry]
cli-anything-lldb --json process attach --pid 1234
cli-anything-lldb --json process attach --name myapp --wait-for
cli-anything-lldb --json process continue
cli-anything-lldb --json process interrupt
cli-anything-lldb --json process detach
cli-anything-lldb --json process infobash
cli-anything-lldb --json process launch [--arg ARG ...] [--env KEY=VALUE ...] [--cwd DIR] [--stop-at-entry]
cli-anything-lldb --json process attach --pid 1234
cli-anything-lldb --json process attach --name myapp --wait-for
cli-anything-lldb --json process continue
cli-anything-lldb --json process interrupt
cli-anything-lldb --json process detach
cli-anything-lldb --json process infobreakpoint
breakpoint(断点)
bash
cli-anything-lldb --json breakpoint set --function main
cli-anything-lldb --json breakpoint set --file main.c --line 42 --condition "i > 10"
cli-anything-lldb --json breakpoint set --function LateLoadedSymbol --allow-pending
cli-anything-lldb --json breakpoint list
cli-anything-lldb --json breakpoint delete --id 1
cli-anything-lldb --json breakpoint enable --id 1
cli-anything-lldb --json breakpoint disable --id 1bash
cli-anything-lldb --json breakpoint set --function main
cli-anything-lldb --json breakpoint set --file main.c --line 42 --condition "i > 10"
cli-anything-lldb --json breakpoint set --function LateLoadedSymbol --allow-pending
cli-anything-lldb --json breakpoint list
cli-anything-lldb --json breakpoint delete --id 1
cli-anything-lldb --json breakpoint enable --id 1
cli-anything-lldb --json breakpoint disable --id 1thread / frame / step
thread / frame / step(线程/栈帧/单步调试)
bash
cli-anything-lldb --json thread list
cli-anything-lldb --json thread select --id 11111
cli-anything-lldb --json thread backtrace --limit 50
cli-anything-lldb --json frame select --index 0
cli-anything-lldb --json frame info
cli-anything-lldb --json frame locals
cli-anything-lldb --json step over
cli-anything-lldb --json step into
cli-anything-lldb --json step outbash
cli-anything-lldb --json thread list
cli-anything-lldb --json thread select --id 11111
cli-anything-lldb --json thread backtrace --limit 50
cli-anything-lldb --json frame select --index 0
cli-anything-lldb --json frame info
cli-anything-lldb --json frame locals
cli-anything-lldb --json step over
cli-anything-lldb --json step into
cli-anything-lldb --json step outexpr / memory / core
expr / memory / core(表达式/内存/核心转储)
bash
cli-anything-lldb --json expr "argc"
cli-anything-lldb --json memory read --address 0x1000 --size 128
cli-anything-lldb --json memory find "needle" --start 0x1000 --size 4096
cli-anything-lldb --json core load --path /path/to/corebash
cli-anything-lldb --json expr "argc"
cli-anything-lldb --json memory read --address 0x1000 --size 128
cli-anything-lldb --json memory find "needle" --start 0x1000 --size 4096
cli-anything-lldb --json core load --path /path/to/coreAgent Usage Notes
Agent 使用注意事项
- Prefer for all automated flows.
--json - Separate non-REPL invocations share a persistent session daemon by default.
- Use or
--session-file PATHto pin an explicit session for a task.CLI_ANYTHING_LLDB_SESSION_FILE - Run when finished so attached processes detach and launched debuggees are cleaned up.
cli-anything-lldb --json session close - Use REPL when a human-like interactive shell is more convenient, not because persistence requires it.
- Unresolved CLI breakpoints fail by default; pass only when a future module/symbol load is expected.
--allow-pending - DAP unresolved breakpoints use protocol semantics: until resolved.
verified: false - DAP is non-blocking for long-running GUI processes, and DAP
continueuses async interrupt.pause - DAP breakpoint changes during an active continue first interrupt and wait for a stopped state before mutating LLDB.
- Use DAP stop-rule profiles for app-specific internal traps; restart and re-attach/re-launch after profile changes.
- uses a chunked scan capped at 1 MiB per call.
memory find - Call before process or core commands.
target create - Expect structured errors:
{"error": "...", "type": "..."}
- 所有自动化流程优先使用参数。
--json - 默认情况下,非REPL模式的独立调用会共享一个持久会话守护进程。
- 使用或环境变量
--session-file PATH为任务指定明确的会话。CLI_ANYTHING_LLDB_SESSION_FILE - 调试完成后运行,以便附加的进程分离,启动的调试目标被清理。
cli-anything-lldb --json session close - 当类人交互式shell更方便时使用REPL,而非因为需要持久化而使用。
- 未解析的CLI断点默认会失败;仅当预期未来会加载模块/符号时才传递参数。
--allow-pending - DAP未解析的断点使用协议语义:在解析前。
verified: false - 对于长期运行的GUI进程,DAP 是非阻塞的,DAP
continue使用异步中断。pause - 在进程持续运行期间修改DAP断点时,适配器会先中断进程,等待进入暂停状态后再修改LLDB断点。
- 针对特定应用的内部陷阱使用DAP暂停规则配置文件;修改配置文件后请重启适配器并重新附加/启动调试目标。
- 使用分块扫描,每次调用上限为1 MiB。
memory find - 在执行进程或核心转储命令前调用。
target create - 预期会收到结构化错误:
{"error": "...", "type": "..."}