debug

debug is a command for Claude Code from jzl-maker/EA-SKILL. It costs 0 tokens per session (8,484 once invoked), scanned A, original, MIT.

A command-line debugging toolkit for embedded programs using J-Link or OpenOCD, tools that connect a computer to a microcontroller for inspection.

In plain words
What is it for?
Use it to collect RTT logs, set breakpoints, watch memory, read registers, or launch source-level debugging with GDB when the required hardware and tools are available.
Why use it?
It helps locate where code runs, check variable values, inspect memory and registers, and investigate causes without adding Python libraries.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to collect RTT logs, set breakpoints, watch memory, read registers, or launch source-level debugging with GDB when the required hardware and tools are available.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jzl-maker/ea-skill/debug
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/jzl-maker/EA-SKILL

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/jzl-maker/ea-skill/debug/github.svg)](https://agentmods.dev/commands/jzl-maker/ea-skill/debug)
Your own site
<a href="https://agentmods.dev/commands/jzl-maker/ea-skill/debug"><img src="https://agentmods.dev/badge/commands/jzl-maker/ea-skill/debug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for debug

Your own site · 80×15
<a href="https://agentmods.dev/commands/jzl-maker/ea-skill/debug"><img src="https://agentmods.dev/badge/commands/jzl-maker/ea-skill/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,484 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.08484
Opus 5.5 $0.00000 $0.03394
Sonnet 5.5 $0.00000 $0.01697
Haiku 4.5 $0.00000 $0.00848

Measured 1mo ago against content hash 9ccf415e33ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/debug.md · 352 lines

How it starts

The opening of the file, as written. The whole thing — 352 lines — stays where its author put it; the contents beside it link to each section on GitHub.

命令: /ea debug (调试)

功能

自主调试五件套,用于「代码跑哪了 / 变量值对不对 / 日志说了什么 / 根因是什么」。双后端:--backend jlink(默认)或 --backend openocd(ST-Link/DAP 用,无停机监控)。

能力 命令 底层工具 是否 halt 目标 后端
RTT 日志(含历史/取证) --rtt snapshot JLink savebin 直读 RAM 不 halt jlink
RTT 日志(只能抓新数据) --rtt start/stop/show JLinkRTTLogger.exe 不 halt jlink
断点定位 --bp <函数名/地址> JLink Commander SetBP + halt halt jlink
内存监视 --mem <变量名/地址> JLink mem32/mem8 halt(--no-halt 可免) jlink
内存监视(免停机) --mem --no-halt JLink savebin 后台读 不 halt jlink
内存监视(免停机) --mem/--regs OpenOCD TCL mdw/reg 不 halt openocd
寄存器 --regs JLink regs / OpenOCD reg halt(ocd 免) 两者
复位+放行 --reset-run JLink Commander r+g 复位后自由运行 jlink
源码级调试(可选) --gdb JLinkGDBServerCL + arm-none-eabi-gdb 由 gdb 控制 jlink

零第三方 Python 依赖:只调用 J-Link / OpenOCD 自带可执行文件。 py 是 Windows Python launcher(python 可能是 Store 假别名,勿用)。

后端选择:有 J-Link 用默认 jlink(支持全功能);只有 ST-Link/DAP 用 --backend openocd(内存/寄存器免断点实时监控,TCL mdw 运行中直读不 halt CPU;--rtt/--bp/--gdb/--reset-run 仅 jlink 后端支持)。

调用方式

BJ="py <SKILL>/tools/jlink-debug/scripts/jlink_debug.py"

# ① 探测工具链(确认 JLink/RTTLogger/GDBServer 是否可用)
$BJ --detect

# ② RTT 取证:直读 RAM,拿回「已经发生」的历史日志(推荐)
$BJ --rtt snapshot                              # 控制块地址自动从 .map 的 _SEGGER_RTT 解析
$BJ --rtt snapshot --cb-addr 0x200014DC         # .map 里没有时手工指定
$BJ --rtt snapshot --out .ea/logs/rtt.log       # 原始字节落盘
$BJ --rtt snapshot --json                       # 结构化输出

# ③ RTT 轮询:目标跑人工交互测试,过程中反复采样
$BJ --rtt snapshot --duration 420 --interval 5 --out .ea/logs/rtt.log
$BJ --rtt snapshot --poll 20 --interval 5

# ④ 复位 + 放行(配合人工按压测试;也可加在 ② 前面先复位)
$BJ --reset-run
$BJ --rtt snapshot --reset-run --duration 420 --interval 5

# ⑤ RTT 实时日志(只能抓 attach 之后的新数据,须先 start 再复位)
$BJ --rtt start --log .ea/logs/rtt.log
$BJ --rtt stop
$BJ --rtt show --log .ea/logs/rtt.log --tail 50
$BJ --rtt show --log .ea/logs/rtt.log --encoding gbk

# ⑥ 断点定位:函数跑哪了?(.map 符号 → SetBP → go → halt → 报告 PC/寄存器)
# ⚠️ 符号名**必须来自本工程**的 .map —— 先用 --list-symbols <关键字> 查(见「符号解析」)
$BJ --bp <本工程函数名> --run-ms 2000
$BJ --bp 0x08001d28                        # 也可直接给地址(Thumb bit 可带可不带)

# ⑦ 内存监视:变量值是多少?
$BJ --mem <本工程变量名>                    # 默认 4×32bit,halt→读→go
$BJ --mem <本工程变量名> --no-halt --watch 10   # 不打断正在跑的目标
$BJ --mem <本工程变量名> --watch 5
$BJ --mem 0x20020228 --count 8 --width 1

# ⑧ 读寄存器
$BJ --regs

# ⑨ 源码级调试(可选,需 arm-none-eabi-gdb)
$BJ --gdb --elf build/app.axf --gdb-script debug.gdb

# ⑩ ST-Link/DAP 后端:内存/寄存器免断点实时监控(OpenOCD,不 halt CPU)
$BJ --backend openocd --mem <本工程变量名> --watch 10 --interval 0.5
$BJ --backend openocd --regs
# --ocd-if stlink(默认)| cmsis-dap;--ocd-target 指定 target(默认 target/stm32f4x.cfg 通用 Cortex-M4)
# OpenOCD 自动拉起/复用(先查 6666 端口,已开则复用不打扰用户进程)

# 辅助:符号表 / 地址解析(AI 先核对映射再下断点)
$BJ --list-symbols <关键字>        # 如 --list-symbols Timer / --list-symbols OM
$BJ --resolve <本工程符号名>

Read the full file on GitHub · 352 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 9ccf415e33ef
  2. 1mo ago Changed · +27 lines 92bc0428d150
  3. 1mo ago Changed · +174 lines af6eb6992c79
  4. 1mo ago First seen · 151 lines · 0 tokens per session scan A 6d4709a15238

Subscribe to this mod's changes

debug is a command published in the GitHub repository jzl-maker/EA-SKILL (9 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,484 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.