Repository navigation
feat: a run cut short on a TTD replay is put back where it started - #202
Merged
Merged
Conversation
TTD does not leave an interrupted replay where it had got to. It prints "the current position is approximately how far we had gone" and then, measured, usually moves it to the trace's end - past every breakpoint the run had not reached, with no hit reported - and now and then to a breakpoint itself, again with no hit (windbg-mcp item 125). A caller reading that stop as progress concludes the breakpoint is never hit. execute_and_wait, settle and run_to_address now read the position before the run, through the debugger data model, and when a deadline or a host's break cuts the run short they SeekTo back to it and read the position and current thread again to confirm. CommandRun::replay and RunToResult::replay carry the outcome as a ReplayLanding. ttd_position is public and typed (TtdPosition), and DebuggeeType::is_ttd_replay gates it: a .run opened by open_trace reports qualifier DEBUG_USER_WINDOWS_IDNA, not a dump qualifier, so a live target pays one GetDebuggeeType per resume and never touches the data model. examples/ttd_position_probe.rs holds the measurements (x64, two traces, every bounded run put back and every following g reaching the breakpoint). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H84hv8GzUbK25UnnEC6eSb
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis 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. |
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.
What changes
TTD does not leave an interrupted replay where it had got to. It prints "the current position is approximately how far we had gone" and then moves it somewhere of its own choosing. Measured, that is usually the trace's end, past every breakpoint the run had not reached, with no hit reported. Now and then it is a breakpoint itself, again with no hit. A caller reading that stop as progress concludes the breakpoint is never hit (windbg-mcp item 125).
execute_and_wait,settleandrun_to_addressput a cut-short replay back. Each reads the position before the run, through the debugger data model (@$curthread.TTD.Position). When a deadline or a host's break cuts the run short, it calls that position object's ownSeekTo, then reads the position and current thread again to confirm.CommandRun::replay/RunToResult::replaycarry the outcome as aReplayLanding:Rewound { to }, orNotRewound { from, left_at }when the travel back failed. They areNoneon every other target.DebugEngine::ttd_positionis public and typed (TtdPosition { sequence, steps }, ordered as the trace is,Displayas!ttreads it).DebuggeeType::is_ttd_replayis the gate. A.runopened byopen_tracereports class 2, qualifier 2 (DEBUG_USER_WINDOWS_IDNA), not a dump qualifier. So a live target pays oneGetDebuggeeTypeper resume and never touches the data model.windowsgainsWin32_System_Com,Win32_System_OleandWin32_System_Variant, whichIModelObject::GetIntrinsicValueis gated on.Breaking:
CommandRunandRunToResultgain a public field. Struct literals addreplay: None(noted in the CHANGELOG's migration section).Measured
examples/ttd_position_probe.rs, x64 host,dbgeng10.0.29547.1002, TTD 1.11.617.0, against two unindexed traces (hostname.exe28 MiB,cmd.exe /c for /L …48 MiB), with a breakpoint onntdll!RtlExitUserProcess.g-settlerun_to_addressAfter every put-back, the next
gstopped at the breakpoint. The seek takes about 1.5 ms and leaves the engine atDEBUG_STATUS_BREAKwith nothing to pump. An ordinary user dump answersttd_position() == None.Tests
cargo test --lib: 469 passed, 13 ignored.test_a_replay_is_the_idna_qualifier_on_a_user_targettest_a_ttd_position_orders_by_sequence_then_steps_and_prints_as_tt_reads_ittest_a_live_target_is_no_replay_and_is_not_put_back, which runs all three bounded paths on a launched process.is_ttd_replayanswer true for any user target fails both of the gate tests.Rewoundwithout seeking fails that tier with the stop left at the end-of-trace IP.cargo clippy --all-targets -D warningsreports ten findings, all in code this PR does not touch (newer toolchain lints). CI does not run clippy here.The new code is FFI (
VariantClear, anAddRef'dpunkValclone), so Miri, which does not run on PRs, has nothing new it can reach.🤖 Generated with Claude Code
https://claude.ai/code/session_01H84hv8GzUbK25UnnEC6eSb