Implement back-in-time debugger for Truffle framework#1
Draft
Implement back-in-time debugger for Truffle framework#1
Conversation
Co-authored-by: entlicher <5479271+entlicher@users.noreply.github.com>
Co-authored-by: entlicher <5479271+entlicher@users.noreply.github.com>
Co-authored-by: entlicher <5479271+entlicher@users.noreply.github.com>
Co-authored-by: entlicher <5479271+entlicher@users.noreply.github.com>
Co-authored-by: entlicher <5479271+entlicher@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add back-in-time debugger based on Truffle framework
Implement back-in-time debugger for Truffle framework
Oct 20, 2025
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.
Overview
This PR implements a comprehensive back-in-time debugging feature for the Truffle framework, enabling developers to record and navigate through execution history during debugging sessions.
Motivation
Modern debuggers often require developers to restart execution when they need to examine a previous program state. This back-in-time debugger eliminates that friction by automatically recording execution history, allowing developers to step backward through their program's execution just as easily as stepping forward.
Implementation
The implementation adds three core components:
1. TimeTravelSnapshot
A new public API class that captures immutable snapshots of execution state:
2. TimeTravelRecorder
An internal class that manages execution history:
3. DebuggerSession Extensions
Extended the existing
DebuggerSessionclass with 9 new public methods:setTimeTravelEnabled(boolean)/isTimeTravelEnabled()- Control recordingcanStepBackward()/canStepForward()- Query navigation optionsgetCurrentSnapshot()/getExecutionHistory()- Access recorded stateclearExecutionHistory()- Manual history managementgetHistoryPosition()/getHistorySize()- Position queriesUsage Example
Key Features
Testing
Added comprehensive test suite (
TimeTravelDebuggerTest.java) with 7 test cases covering:Documentation
Includes extensive documentation:
TimeTravelDebugger.md)TimeTravelDebuggerArchitecture.md)TimeTravelDebuggerExample.java)Performance
Files Changed
DebuggerSession.java(+100 lines)TimeTravelSnapshot.java,TimeTravelRecorder.javaTimeTravelDebuggerTest.javaLimitations
This is a state inspection tool, not full execution replay:
Future Work
Potential enhancements could include:
This implementation provides a solid foundation for back-in-time debugging in Truffle while maintaining the framework's high standards for API design, performance, and code quality.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.