P0: Comment CRUD for the decompiler CLI + IDA comment enumeration#205
Merged
Conversation
…ation Comments are modeled by DecLib but the CLI exposed nothing, and IDA's comment enumeration (`_comments`) was an unimplemented stub. This adds a full annotation workflow. - New `decompiler comment set|append|get|delete|list` (nested subcommands). Addresses accept lifted or absolute form; a shared normalizer maps absolute -> lifted so pasted addresses land correctly. - IDA: real `comments()` enumeration (disassembly regular/repeatable comments via idautils.Heads, function header/range comments, and persisted Hexrays user comments read from the netnode without re-decompiling), plus `del_ida_comment` and a richer `get_ida_comment` that also returns disassembly + decompiler comments. - Ghidra: `_del_comment` clearing every comment slot. - Binary Ninja: fixed `_comments` to return Comment objects (was raw strings), fixed `_set_comment` to return True, added `_del_comment`. - Base DecompilerInterface gains public get_comment/delete_comment (direct reads, bypassing the light-artifact cache) with client proxies. - Backend-parametrized tests: set/get, append, list+delete, get-missing. IDA + Ghidra full pass; angr writes only (reads are a known gap). - SKILL.md / docs / CLI docstring updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HfZHdprXg38re1XyKxzGg5
This was referenced Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
DecLib models
Comment, but the CLI exposed nothing, and IDA's comment enumeration (_comments) was an unimplemented stub returning{}. This adds a complete annotation workflow — the primary way an agent leaves durable notes for later.New capabilities
decompiler comment set|append|get|delete|list(nested subcommands).--decompiledtargets the pseudocode view; addresses accept lifted or absolute form (a shared normalizer maps absolute→lifted).compat.comments()): walks disassembly comments (regular + repeatable viaidautils.Heads), function header/range comments, and persisted Hexrays user comments — the last read straight from the netnode viarestore_user_cmts, so no per-function re-decompilation. Also addsdel_ida_commentand a richerget_ida_comment(disasm + decompiler comments, not just function headers)._del_commentclears every comment slot._comments(returned raw strings, nowCommentobjects), fixed_set_commentreturn value, added_del_comment.get_comment/delete_comment(direct reads bypassing the light-artifact cache, so a just-set comment is visible) + client proxies.Example
Tests
Backend-parametrized:
test_comment_set_get,test_comment_append,test_comment_list_and_delete,test_comment_get_missing_exits_nonzero._reads_comments = False), so read assertions skip there.Backend support matrix
Second PR in the IDALib-parity series. Based on
feat/cli-persistence(#204) — review/merge that first.🤖 Generated with Claude Code
https://claude.ai/code/session_01HfZHdprXg38re1XyKxzGg5