Repository navigation
feat(native): inspect DWARF compile units offline - #8523
Conversation
Documents `inspect_dwarf_units` and `inspect-dwarf-units` for static inspection of DWARF 2–5 in ELF, Mach-O, and PE images, including compressed debug sections. The guide explains pagination, artifact identity, per-unit issues, architecture selection, and coverage reporting. It also describes unresolved relocations and distinguishes missing debug information in the selected file from separate debug files.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed changes appear safe to merge, with no accepted new blocking findings. SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI or MCP request] --> B[DwarfUnitsService]
B --> C[Stable artifact read]
C --> D[Select native image]
D --> E[Locate and decompress sections]
E --> F[Frame units and decode requested page]
F --> G[Check report and create Evidence]
Reviews (29) · Last reviewed commit: "fix(native): preserve DWARF caller contr..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90d840a8c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Charge a failed inflate its declared size, and nothing for a rejected header, so an unreadable optional section no longer exhausts the allowance. - Treat an empty .debug_info as no contents at selection, so a populated copy that follows it is still read and empty copies are not counted unread. - Admit Mach-O sections from an unmapped __DWARF segment by on-disk range instead of VM mapping. - Verifier: parse readelf values after the attribute separator (including indexed strings), stop collecting unit attributes at the first child DIE, anchor unit header matches, and run compiler, linker and dumper commands through createVerifierCommands with one cleanup that keeps the temp directory when a stop fails. Only a nonzero exit or a missing tool skips a variant; a timeout fails the run. - Drop the test that matched verification record prose.
|
Pushed 7d9f698 to this branch. I read each finding against the code at 90d840a and each one held.
Checked locally on Node 24.22.1: typecheck and lint ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d9f698ab0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Charge a failed compressed section the larger of its declared output and the compressed input it read, so aliased failing streams hit the allowance. - Decode GNU //base64 COFF long section names as well as /decimal ones. - Take the Mach-O cpu type and the PE COFF symbol table declaration from their metadata owners instead of rereading file headers in the DWARF reader.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bcd794544
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A valid stream that expands to nothing charged no allowance, so aliased section headers could inflate the same large empty stream repeatedly. The compression owner now reports the larger of decoded output and compressed input on success as it does on failure, and the DWARF reader charges that. Drop `.ok` assertions that ran ahead of the typed error guard, which hid the cause when a read failed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KuWHGvzJkrhCqjtEHUwqyH
…nits # Conflicts: # docs/index.md
GNU readelf prints offsets with %#x, which drops the 0x prefix for zero, so a string at offset zero reads "(indirect string, offset: 0):". Make the prefix optional and cover that output in the verifier test.
…nits Resolve docs/index.md by keeping the new wxapkg guide link from main and the DWARF compile units link from this branch.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Pass stableArtifactInputRecovery into the path/format input error so CLI and MCP callers get the resolved file path to retry, matching the other stable artifact readers.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Resolve conflicts with the binary hardening addition by keeping both entries in the README tables, docs index, VitePress sidebar and package.json verify scripts.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Resolve conflicts from the upstream docs reorganization: keep the DWARF compile units rows in README tables, link the guide from docs/index.md, and register docs/dwarf-units.md in the new documentation.ts sidebar registry. Upstream removed the execution wording exception list in toolEffects.test.ts, so that file takes upstream as is.
Resolve conflicts with the contracts, ports, resources and domain moves on main: the DWARF contract now declares cli and its effects inline, the port lives in src/ports, and the compressed ELF section decoder moves to src/domain/native beside the section name table.
…ARF units Import resources through its index, register the DWARF units provider as a native entry file, and read the Evidence subject format from its identity.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Merged current main into this branch in 8278e68 and fixed the fallout in 90e080a. Conflicts resolved: the DWARF contract now sets |
Add the dwarfUnits capability to PROVIDER_CAPABILITY_CONFORMANCE with the CLI and MCP workflow tests, and add rea-dwarf-units to PROVIDER_LIFECYCLE_COVERAGE as an in-process provider whose operation and cancellation stages name the existing DWARF tests.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Parse the dumper format before reading a value: llvm-dwarfdump wraps an
escaped string in ("..."), while readelf prints the raw value after its
prefix. A readelf comp_dir with quotes was cut to the first quoted run.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Main now counts hand-built resource-constraint refusals. The DWARF section allowance failure is a ParseFailureError limit, so it and the native structural limit go through parseLimitConstraint; only the input read budget refusal stays hand-built and is recorded in the baseline. Also regenerates the Cursor plugin skill and the advertised schema summary for inspect_dwarf_units, adds the DWARF compile units row to the Bulgarian README that main added, and splits the dumper comparison tests to stay under the function length limit.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Merged current main in 30a1147 and fixed the fallout in e4ec4d6: the DWARF section allowance and structural limit refusals now go through |
readPeSectionDirectory decoded PointerToSymbolTable and NumberOfSymbols from the raw COFF bytes beside readPeCoffHeader, which owns that record. The owner now returns symbolTableOffset and symbolCount, reads every field through BinaryReader, and the section directory consumes them.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
inspect_dwarf_units brings the catalog to 256 tools, one more than a single native search_tool query can return. The grok verifier now queries each name the earlier pages missed and checks the union against the catalog, instead of asserting the catalog fits in one page.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
One design change to flag in 8435c37: with |
Preserve the integrated ELF diagnostics and current Grok verifier. Share compression framing between budget preflight and the common decoder while retaining DWARF decompression accounting. Co-authored-by: gensokyo-dev <[email protected]>
Use application admission and the shared caller-parameter selector while retaining resolved defaults for decoding. Migrate selected input limits and fixed ceiling facts to the canonical owner, and verify public and late-cancellation Evidence provenance. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the offline selected-file scope, shared compression-framing owner, canonical limit recovery and caller-selection provenance. Source and public/lifecycle checks passed, with real compiler oracles and real GCC CLI/stdio MCP full/hot-cold validation. Toolchain gaps are recorded. Exact-head CI and automated review remain the merge gates.
Summary
Add offline
inspect-dwarf-units/inspect_dwarf_unitsfor DWARF 2–5 compile-unit headers and unit-DIE build facts in selected ELF, Mach-O or PE files. Reports preserve source ranges, per-unit unknowns, coverage and caller-selected paging/architecture. Targets and separate debug files are not executed or automatically opened.Integrate current ELF diagnostics through one compression-framing owner: budget preflight and decoding admit the same headers, with bounded expansion and retained inflation-work accounting. Shared application admission preserves omitted versus explicit controls, including late-cancellation Evidence. Limits use the canonical error algebra without adding constructor debt.
Validation
Real Zstandard, big-endian ELF and PE DWARF5 were unavailable with this host toolchain; current-host real Mach-O coverage was not run. Local expensive checks were serialized under one CPU and an 8 GiB hard / 6 GiB early-stop memory budget, with no OOM. Full typed lint was not rerun after the preceding integration exceeded that local budget.
Author readiness
Human owner: @mvanhorn