Stepping forward after hitting a breakpoint is a familiar experience but what if you can step back in time? Frequently developers find themselves hunting for failure clues (e.g. error text) in the log files and then searching for that in the code. Once the log statement is found in the source code, the developer is left to re-construct the context for the error.
Not anymore! Time-Travel debugging (TTD) allows developers to look at the faulting code within the full fidelity of the debugger with all the runtime context preserved. TTD works on the record and playback principle, the record mode creates a trace file during execution which can then be played back allowing developers to deeply inspect the code as it was during the original execution.
TTD functionality is being added to Node-ChakraCore and is supported by VSCode. We are developing in the open and want to share our progress to get feedback, bug reports, functionality requests, and pull-requests from the community.
-
TTD reaches Beta milestone on Windows
- Added new feature "Reverse Continue"
- Improved performance and reliability
-
TTD preview available on macOS and Ubuntu 16.04
- Added TTD support on experimental Node-ChakraCore cross-platform builds
To get started with TTD you will need the following:
- Install VSCode Insider build
- Install Node-ChakraCore
To record a trace for debugging run the TTD enabled build of node with the record flag:
node.exe -TTRecord:<Location to save Trace> <app script>
Where the location of the saved trace is a relative path from the location of the TTD node.exe file.
node.exe -TTReplay:<Location of saved Trace>
Make the following additions to the launch.json configuration in the VSCode project:
- Add the following to
runtimeArgs
["-TTDebug:<Location of saved Trace>", "-TTBreakFirst"]
. - Set the runtime executable and cwd paths as needed for the TTD enabled build of node.js and location of the saved trace.
The code for the Remote File System sample demo'ed at NodeInteractive is available here.
(Note: This demo requires TypeScript)
Please let us know on our issues page if you have any question or comment.