Skip to content

Add symbols_elf / symbolsElfPath pass-through to Sim - #13

Open
ShahriarAhnaf wants to merge 1 commit into
mainfrom
agent/pysymbols-7f2a
Open

Add symbols_elf / symbolsElfPath pass-through to Sim#13
ShahriarAhnaf wants to merge 1 commit into
mainfrom
agent/pysymbols-7f2a

Conversation

@ShahriarAhnaf

Copy link
Copy Markdown
Contributor

Summary

  • Sim(elf=..., symbols_elf="path") forwards to SessionMachine.SymbolsElfPath (simantic-core#307) for the single-machine form.
  • Scenario machine dicts honour symbolsElfPath (same key as the CLI's --scenario YAML from simantic-cli#184, so a scenario dict stays copy-pasteable).
  • trace_memory=[...] now forwards to SessionSpec.TraceMemory, mirroring the existing trace_symbols=.
  • backend="rust" raises NotSupported for both, matching how it already handles trace_symbols/trace_interrupts.
  • docs/session-api.md updated; two new tests in tests/test_session.py, gated the same way as the file's existing engine tests ($SIMANTIC_SIM + $SIMANTIC_SESSION_ELF/REPL).

Verification

No stripped-image + companion-ELF fixture exists yet in sim-fixtures, so I built one for manual verification: arm-none-eabi-strip --strip-all on sim-fixtures/build/zephyr/zephyr.elf (nucleo_f401re), run against the pinned core build (ff4bdfe):

  • stripped image alone: sim.symbol("main") raises (Could not find any address for symbol: main)
  • stripped image + symbols_elf=<full ELF>: sim.symbol("main") resolves correctly, matches the unstripped baseline address
  • same check for the scenario-dict symbolsElfPath form
  • trace_memory=["main"] accepted without error (SessionSpec.TraceMemory)
  • backend="rust" + symbols_elf= raises NotSupported as expected

The committed tests use the existing same file, both roles smoke-test pattern (no stripped fixture is checked into this repo), asserting the run boots correctly with symbols_elf/symbolsElfPath set — not a symbol-resolution round trip, since loading the identical ELF twice for its own symbols is a distinct (and, I found, currently broken) code path in Core, unrelated to this change. Ran locally against a real stripped/full pair (not committed) and confirmed both new tests pass.

uv run pytest tests/ -q → 123 passed, 4 skipped (engine/fixture-gated, as before).

Refs simantic-dev/simantic-cli#182

🤖 Generated with Claude Code

SessionMachine.SymbolsElfPath (simantic-core#307) attaches a companion
ELF that carries debug symbols for a stripped boot image, e.g. a
PlatformIO/IDF firmware.elf alongside a stripped flash container. Sim
now forwards it: symbols_elf= for the single-machine form, and
symbolsElfPath in scenario machine dicts (same key as the CLI's
scenario YAML). Also plumb trace_memory=[...] through to
SessionSpec.TraceMemory alongside the existing trace_symbols=.

Verified against the pinned core build (simantic-core ff4bdfe) with a
zephyr.elf stripped via arm-none-eabi-strip as the image and the full
ELF as symbols_elf: symbol() fails on the stripped image alone and
resolves once the companion ELF is attached.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant