Skip to content

Add crash subcommand: symbolicate whole Apple .ips/.crash reports - #14

Open
everettjf wants to merge 1 commit into
mainfrom
claude/crash-log-symbolication
Open

everettjf wants to merge 1 commit into
mainfrom
claude/crash-log-symbolication

Conversation

@everettjf

Copy link
Copy Markdown
Owner

Summary

Adds a crash subcommand that symbolicates an entire Apple crash report and rewrites it in place:

  • Both formats — modern .ips (JSON metadata line + JSON body with usedImages/threads) and legacy .crash (text Binary Images: table + thread frames). Format is auto-detected.
  • Per-image symbol matching — every referenced image is matched against one or more --dsym-dir directories by Mach-O UUID or ELF build-id. The directories are indexed once, then each image's frames are symbolized in a single pass through the existing engine (so dSYM/debuglink/fat-slice handling all apply).
  • In-place rewrite.ips frames gain symbol/symbolLocation/sourceFile/sourceLine; .crash frame lines get their trailing detail replaced with symbol (file:line) (or symbol + offset). Images without a matching dSYM are left untouched, so partial symbol sets still yield a usable report.
  • I/O — reads a report path or stdin; writes stdout or --output <FILE>.

Usage:

atosl crash MyApp-2024.ips --dsym-dir ./dsyms
cat MyApp.crash | atosl crash --dsym-dir ./dsyms > MyApp.symbolicated.crash

Implementation notes

  • New src/crash.rs module; reuses with_symbolizer, the directory UUID/build-id index, and normalize_hex_id (now pub(crate)).
  • The crash token is routed to its own parser before the default address parser, so the report path never competes with the top-level positional addresses (clap can't disambiguate a bare positional from a subcommand). The flat atosl -o ... -l ... <addr> interface is unchanged.
  • Remote/HTTP debuginfod is still out of scope; image lookup uses local --dsym-dir directories (and the existing debuginfod cache via the engine).

Test plan

  • cargo fmt, cargo clippy --all-targets -- -D warnings, cargo test (all green locally)
  • New Linux-gated integration tests symbolicate a real ELF fixture (matched by build-id) through both the .crash text and .ips JSON paths end-to-end
  • Existing 12 CLI tests and the flat interface unaffected

Note: real-world Apple .ips/.crash files reference Mach-O images, which can only be exercised end-to-end on macOS; the Linux CI tests cover the parsers and the full orchestration via build-id-matched ELF fixtures.

https://claude.ai/code/session_01XAne4ituXPChWeo9TjA3z7


Generated by Claude Code

Add `atosl crash <REPORT>` for symbolicating entire Apple crash reports:
modern .ips (JSON) and legacy .crash (text). Each referenced image is
matched against --dsym-dir directories by UUID/build-id (indexed once),
resolved through the existing engine, and the report is rewritten in
place with symbolicated frames. Images without a match are left as-is.

The `crash` token is routed before the default address parser so the
report path never collides with positional addresses.

https://claude.ai/code/session_01XAne4ituXPChWeo9TjA3z7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants