Expose decompilation line maps in CLI#212
Merged
Merged
Conversation
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.
Summary
decompiler decompile --map-lines --jsonmap_lines=Truerequest through to the backend--rawor text output)test_decompiler_cli.pyin the decompiler CI jobMotivation
DecLib already supports
Decompilation.line_mapacross its backends, but the CLI did not expose it. In our ENOWARS 10 agent logs, all 27 IDA decompilation calls requested statement addresses. Agents used those addresses for navigation, comments, and patch analysis, making this one of the most consistently used gaps between the current MCP and DecLib CLI surfaces.Example output:
A list-of-records contract avoids JSON's string-only object keys and normalizes backend sets/lists into stable, sorted output. It also preserves multiple instruction addresses for one pseudocode line.
Testing
pytest tests/test_decompiler_cli.py::TestCLIFormatters -q— 5 passedpytest tests/test_artifacts.py tests/test_decompiler_cli.py -q -k 'not test_install_skill_default_falls_back_to_claude'— 28 passed, 213 skipped, 1 pre-existing environment-sensitive test deselectedtests/test_artifacts.py tests/test_cli.py) — 11 passeddecompile _main --map-lines --json, and stop all succeeded; output included mapped lines with both single and multiple instruction addressesThe backend-parametrized CLI test will exercise angr, Ghidra, IDA, and Binary Ninja where each dependency/license is available in the existing decompiler CI environment.