fix(simics7): replace set-bookmark with snapshot for repro mode#354
fix(simics7): replace set-bookmark with snapshot for repro mode#354Wenzel wants to merge 2 commits into
Conversation
Simics 7.70+ removed the `set-bookmark` / `reverse-to` CLI commands that relied on reverse-execution micro-checkpoints. TSFFS repro mode was calling `set-bookmark start` unconditionally, causing a SimExc_General error on Simics 7. This change: - Gates the `set-bookmark` call with `#[cfg(simics_version = "6")]` - On Simics 7, repro mode reuses the existing `tsffs-origin-snapshot` that is already saved at harness start - Updates log messages to display version-appropriate restore commands: - Simics 6: "reverse-to start" - Simics 7: "restore-snapshot tsffs-origin-snapshot" - Updates documentation to explain the difference between versions Fixes #287 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates TSFFS repro-mode behavior to avoid using the removed Simics 7 set-bookmark CLI command by relying on the existing origin snapshot, while also making the “restore” instruction shown to users version-aware.
Changes:
- Gate the repro
set-bookmark startcall behind#[cfg(simics_version = "6")]to avoid Simics 7 runtime CLI errors. - Introduce
Tsffs::REPRO_RESTORE_COMMANDand use it in “Stopped for repro” log messages to show the correct restore command per Simics version. - Update documentation to explain the Simics 6 (bookmark) vs Simics 7 (snapshot) repro workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/lib.rs |
Adds version-gated restore-command constant and gates set-bookmark for Simics 6 only. |
src/haps/mod.rs |
Updates repro stop log lines to print the version-appropriate restore command. |
docs/src/tutorials/edk2-uefi/reproducing-runs.md |
Documents Simics 6 vs 7 repro restore procedure and updates sample output. |
docs/src/fuzzing/analyzing-results.md |
Clarifies repro “restore point” behavior differs between Simics 6 (bookmark) and Simics 7 (snapshot). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// `set-bookmark`/`reverse-to`. | ||
| #[cfg(simics_version = "6")] | ||
| pub const REPRO_RESTORE_COMMAND: &'static str = "reverse-to start"; | ||
| #[cfg(simics_version = "7")] | ||
| pub const REPRO_RESTORE_COMMAND: &'static str = "restore-snapshot tsffs-origin-snapshot"; |
There was a problem hiding this comment.
Fixed. Replaced the const with a repro_restore_command() method that constructs the Simics 7 variant via Self::SNAPSHOT_NAME, so it can't drift.
| SIMICS output: | ||
|
|
||
| ```txt | ||
| [tsffs info] Stopped for repro. Restore to start bookmark with 'reverse-to start' | ||
| [tsffs info] Stopped for repro. Restore origin state with 'restore-snapshot tsffs-origin-snapshot' |
There was a problem hiding this comment.
Fixed. The block is now labelled as Simics 7 output with a note that Simics 6 shows reverse-to start instead.
- Replace REPRO_RESTORE_COMMAND const with repro_restore_command() method so the Simics 7 variant is built from SNAPSHOT_NAME and cannot drift - Label the GDB stub example output block as Simics 7 to avoid confusing Simics 6 users who will see a different restore command Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
set-bookmarkcall with#[cfg(simics_version = "6")]— the command was removed in Simics 7.70+tsffs-origin-snapshot(already saved at harness start)REPRO_RESTORE_COMMANDconstant to display the correct restore command per version in log messagesTest plan
cargo checkpasses on Simics 7 (noset-bookmarkerror)Fixes #287
🤖 Generated with Claude Code