Communitygithub.com

cli-anything-lldb - LLDB 调试技能

通过 LLDB Python API 进行有状态的 LLDB 调试,支持结构化 JSON 输出和 Debug Adapter Protocol。

cli-anything-lldb - LLDB 调试技能 是什么?

这是一个专为 AI 代理和开发者设计的 LLDB 调试技能,它通过 LLDB Python API 提供有状态的调试工作流,并输出结构化 JSON。该技能支持创建调试目标、管理断点、检查线程和帧、评估表达式、读写内存以及加载核心转储等核心操作。它同时支持交互式 REPL 和正式的 Debug Adapter Protocol (DAP) 服务器,后者通过标准 stdio 帧协议与 AI 客户端或编辑器集成,提供完整的调试生命周期。DAP 模式特别适用于需要处理长时间运行的 GUI 应用程序(如 C4D)的 AI 代理,它支持非阻塞 continue、异步中断 pause,以及通过 stopRuleProfile 自定义的自动继续/停止规则,从而过滤掉启动时的内部陷阱或着色器 JIT 断点等噪声。该技能由 cli-anything-lldb 框架提供,支持持久会话、环境变量和结构化错误处理,是构建自动化调试工具链和 AI 调试助手的理想选择。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-lldb

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

LLDB CLI 技能

使用此 CLI 工具运行结构化的 LLDB 调试工作流,并输出 JSON 格式结果。

能力

  • 从可执行文件路径创建调试目标
  • 启动进程或通过 PID/进程名附加
  • 管理断点(设置/列出/删除/启用/禁用)
  • 检查线程、帧、局部变量和回溯
  • 在当前帧中评估表达式
  • 读取/查找进程内存
  • 加载核心转储
  • 交互式 REPL,具有持久会话状态
  • 为 AI/编辑器客户端提供的正式 stdio Debug Adapter 协议服务器

快速命令

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 close

Debug Adapter 协议

当 AI 客户端需要真正的调试适配器生命周期,而不是分别调用单独的 CLI 命令时,使用 DAP 入口点:

cli-anything-lldb-dap
cli-anything-lldb-dap --profile /path/to/stop-rules.json

或者:

cli-anything-lldb dap
cli-anything-lldb dap --profile /path/to/stop-rules.json

DAP 服务器通过 stdio Content-Length 帧进行通信,并且必须独占 stdout。在其周围不要将日志打印到 stdout。支持的请求包括 initialize、launch、attach、configurationDone、setBreakpoints、setFunctionBreakpoints、threads、stackTrace、scopes、variables、setVariable、evaluate、continue、pause、next、stepIn、stepOut、source、loadedSources、readMemory、modules、exceptionInfo、disassemble 和 disconnect。

DAP 变量可以暴露结构体/类/数组的子引用。仅在停止时使用 setVariable;LLDB 可能会拒绝写入优化掉或只读的值。

对于长时间运行的 GUI 调试对象,从客户端角度来看,DAP continue 是非阻塞的:适配器首先发送响应和 continued 事件,然后在后台线程上等待 LLDB。DAP pause 使用 LLDB 的异步中断。如果代理需要在调试对象运行时更改断点,适配器会首先中断并等待停止状态,然后再修改 LLDB 断点;如果目标没有及时停止,请在显式的 pause/stopped 周期后重试。

对于在调试器内部启动时停止或着色器 JIT 断点处停止的 GUI 应用程序,launch 和 attach 接受非标准布尔参数 autoContinueInternalBreakpoints。仅当这些内部停止对任务来说是噪声时才启用它;适配器在自动继续之前会发出 output 事件。对于特定目标的噪声,建议通过内联 stopRules 或外部 stopRuleProfile/--profile JSON 文件使用结构化停止规则。规则可以按 reason、module、function 和/或 regex 进行匹配,然后要么 stop(带有清晰的 cliAnythingStop.origin 元数据),要么自动 continue。为诸如 C4D 之类的应用程序使用配置文件,这样它们的 NVIDIA 着色器 JIT/启动陷阱可以存在于通用适配器之外。

DAP stopped 事件包括 body.cliAnythingStop.origin:manualPause 表示客户端暂停请求,internalTrap 表示匹配的内部规则,debuggee 表示普通程序停止。现有的 cli-anything-lldb-dap 进程不会热加载新代码或配置文件内容;在期望应用新规则之前,重启适配器并重新附加或重新启动。

命令组

target

cli-anything-lldb --json target create --exe /path/to/exe [--arch x86_64]
cli-anything-lldb --json target info

process

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 info

breakpoint

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 1

thread / frame / step

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 out

expr / memory / core

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/core

代理使用说明

  • 对于所有自动化流程,建议使用 --json。
  • 默认情况下,非 REPL 的单独调用共享一个持久会话守护进程。
  • 使用 --session-file PATH 或 CLI_ANYTHING_LLDB_SESSION_FILE 为任务固定显式会话。
  • 完成后运行 cli-anything-lldb --json session close,以便分离附加的进程并清理启动的调试对象。
  • 当人类般的交互式 shell 更方便时使用 REPL,而不是因为持久性需要。
  • 未解决的 CLI 断点默认会失败;仅当预期未来会加载模块/符号时传递 --allow-pending。
  • DAP 未解决的断点使用协议语义:在解决之前为 verified: false。
  • DAP continue 对于长时间运行的 GUI 进程是非阻塞的,DAP pause 使用异步中断。
  • 在活动 continue 期间的 DAP 断点更改会首先中断并等待停止状态后再修改 LLDB。
  • 使用 DAP 停止规则配置文件处理特定应用程序的内部陷阱;配置文件更改后重启并重新附加/重新启动。
  • memory find 使用分块扫描,每次调用上限为 1 MiB。
  • 在进程或核心命令之前调用 target create。
  • 期望结构化错误:{"error": "...", "type": "..."}

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相关技能