Skip to main content

Time-travel debugging engine for Python

Project description

Timetrace Debugger

A Time-Travel Debugging Engine for Python.

Timetrace enables reverse execution, execution timeline recording, and structured debugging of Python programs.


Overview

Traditional debuggers allow forward stepping only.

Timetrace allows you to:

  • Step backward in execution
  • Inspect historical variable states
  • Analyze execution timelines
  • Replay saved debugging sessions

This makes debugging faster, more analytical, and more educational.


Features

  • Reverse execution stepping
  • Execution timeline recording
  • Call stack tracking
  • Exception capture
  • Thread & async tracing
  • Conditional breakpoints
  • Watchpoints
  • Multi-file project support
  • CLI-based interactive interface

Installation

pip install timetrace-debugger

Verify installation:

timetrace --help

Basic Usage

Run Timetrace on a Python file:

timetrace your_script.py

Example:

timetrace app.py

Debugger Commands

Command Action
n Step forward
b Step backward
si Step into
so Step over
su Step out
p Print current state
s Show call stack
g Go to specific step
break Set breakpoint
break if Conditional breakpoint
watch Watch variable
history View variable history
q Quit debugger

Using Timetrace Efficiently

To get the best results, follow these recommended debugging techniques:


1️ Step Forward to Understand Flow

Use:

n

to move line-by-line through execution.

Inspect variables using:

p

This helps understand program logic before locating issues.


2️ Step Backward to Identify Root Cause

If incorrect output appears:

  1. Use:
    b
    
  2. Move backward through execution.
  3. Observe where the variable changed unexpectedly.

This avoids restarting the program repeatedly.


3️ Use Conditional Breakpoints

Instead of stepping through long loops:

break if x > 100

Execution pauses only when the condition becomes true.

Best for:

  • Loop debugging
  • Edge-case detection
  • Logical condition failures

4️ Watch Critical Variables

Track variable changes:

watch x

View full history:

history x

Useful for:

  • Recursive functions
  • State mutation debugging
  • Complex calculations

5️ Analyze Recursion Using Stack View

In recursive programs:

s

This displays the call stack.

Helps in:

  • Understanding recursion depth
  • Tracking nested calls
  • Identifying infinite recursion

6️ Save & Replay Sessions

Save execution session:

timetrace script.py --save session.json

Replay later:

timetrace --replay session.json

Useful for:

  • Sharing debugging sessions
  • Reviewing past executions
  • Demonstrations

7️ Multi-File Projects

Run Timetrace from your project root:

timetrace main.py

Ensures:

  • Proper module tracing
  • Accurate import resolution
  • Complete execution capture

Academic Use

Timetrace is especially useful for:

  • Understanding recursion
  • Learning stack behavior
  • Debugging lab assignments
  • Visualizing variable changes
  • Teaching program flow
  • Improving analytical debugging skills

Limitations

  • Very large programs may consume more memory
  • Heavy multiprocessing not fully supported
  • GUI applications are CLI-debug only
  • Designed primarily for debugging logic, not high-load production systems

License

MIT License
Copyright (c) 2026 Varkala Shashidhar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timetrace_debugger-1.0.4.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timetrace_debugger-1.0.4-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file timetrace_debugger-1.0.4.tar.gz.

File metadata

  • Download URL: timetrace_debugger-1.0.4.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for timetrace_debugger-1.0.4.tar.gz
Algorithm Hash digest
SHA256 8a6d3edf209814e43fe18d60516186e05bed3797c573ca10085a3f4ecd3a8661
MD5 0f1a757c668672e6daa1b69f0fdf88f5
BLAKE2b-256 b33fc098b274680ca926947dd04695633eca8b03285e5360528461a085898b11

See more details on using hashes here.

File details

Details for the file timetrace_debugger-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for timetrace_debugger-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 252d555c4ad225b360f18c832833ab81d8c8772bb5be191e196565e77af2e0cf
MD5 a38883bb864dd4721696b407863284aa
BLAKE2b-256 363f0acc56a9a346d88bb72e2026dfa6536d0c8e37411e662daaaf30c0ead0e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page