Add symbols_elf / symbolsElfPath pass-through to Sim - #13
Open
ShahriarAhnaf wants to merge 1 commit into
Open
Conversation
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>
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
Sim(elf=..., symbols_elf="path")forwards toSessionMachine.SymbolsElfPath(simantic-core#307) for the single-machine form.symbolsElfPath(same key as the CLI's--scenarioYAML from simantic-cli#184, so a scenario dict stays copy-pasteable).trace_memory=[...]now forwards toSessionSpec.TraceMemory, mirroring the existingtrace_symbols=.backend="rust"raisesNotSupportedfor both, matching how it already handlestrace_symbols/trace_interrupts.docs/session-api.mdupdated; two new tests intests/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-allonsim-fixtures/build/zephyr/zephyr.elf(nucleo_f401re), run against the pinned core build (ff4bdfe):sim.symbol("main")raises (Could not find any address for symbol: main)symbols_elf=<full ELF>:sim.symbol("main")resolves correctly, matches the unstripped baseline addresssymbolsElfPathformtrace_memory=["main"]accepted without error (SessionSpec.TraceMemory)backend="rust"+symbols_elf=raisesNotSupportedas expectedThe committed tests use the existing
same file, both rolessmoke-test pattern (no stripped fixture is checked into this repo), asserting the run boots correctly withsymbols_elf/symbolsElfPathset — 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