All Projects → CCExtractor → Vardbg

CCExtractor / Vardbg

Licence: mit
A simple Python debugger and profiler that generates animated visualizations of program flow, useful for algorithm learning.

Programming Languages

python
139335 projects - #7 most used programming language
flow
126 projects

Projects that are alternatives of or similar to Vardbg

Yii2 Debug
Debug Extension for Yii 2
Stars: ✭ 179 (-67.03%)
Mutual labels:  hacktoberfest, debugger, profiler
Phpspy
Low-overhead sampling profiler for PHP 7+
Stars: ✭ 1,105 (+103.5%)
Mutual labels:  hacktoberfest, profiler
Reclass.net
More than a ReClass port to the .NET platform.
Stars: ✭ 766 (+41.07%)
Mutual labels:  hacktoberfest, debugger
React Native Network Logger
An HTTP network request monitor for React Native with in-app interface for iOS and Android with no native code
Stars: ✭ 161 (-70.35%)
Mutual labels:  hacktoberfest, debugger
Unityheapexplorer
A Memory Profiler, Debugger and Analyzer for Unity 2019.3 and newer.
Stars: ✭ 179 (-67.03%)
Mutual labels:  debugger, profiler
Ruby jard
Just Another Ruby Debugger. Provide a rich Terminal UI that visualizes everything your need, navigates your program with pleasure, stops at matter places only, reduces manual and mental efforts. You can now focus on real debugging.
Stars: ✭ 669 (+23.2%)
Mutual labels:  hacktoberfest, debugger
X64dbg
An open-source x64/x32 debugger for windows.
Stars: ✭ 37,825 (+6865.93%)
Mutual labels:  hacktoberfest, debugger
Cloud Ops Sandbox
Cloud Operations Sandbox is an open source tool that helps practitioners to learn Service Reliability Engineering practices from Google and apply them on their cloud services using Cloud Operations suite of tools.
Stars: ✭ 191 (-64.83%)
Mutual labels:  debugger, profiler
Nlp profiler
A simple NLP library allows profiling datasets with one or more text columns. When given a dataset and a column name containing text data, NLP Profiler will return either high-level insights or low-level/granular statistical information about the text in that column.
Stars: ✭ 181 (-66.67%)
Mutual labels:  hacktoberfest, profiler
Mond
A scripting language for .NET Core
Stars: ✭ 237 (-56.35%)
Mutual labels:  hacktoberfest, debugger
haskell-code-spot
Visual tool to spot odd runtime behaviour of Haskell programs.
Stars: ✭ 106 (-80.48%)
Mutual labels:  debugger, profiler
Tracy
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
Stars: ✭ 1,345 (+147.7%)
Mutual labels:  debugger, profiler
Gleebug
Debugging Framework for Windows.
Stars: ✭ 1,168 (+115.1%)
Mutual labels:  hacktoberfest, debugger
Agi
Android GPU Inspector
Stars: ✭ 327 (-39.78%)
Mutual labels:  debugger, profiler
Puffin
🐦 Simple instrumentation profiler for Rust 🦀
Stars: ✭ 274 (-49.54%)
Mutual labels:  hacktoberfest, profiler
Powershelleditorservices
A common platform for PowerShell development support in any editor or application!
Stars: ✭ 394 (-27.44%)
Mutual labels:  hacktoberfest, debugger
Tuinity
Stars: ✭ 531 (-2.21%)
Mutual labels:  hacktoberfest
Silk.net
The high-speed OpenAL, OpenGL, Vulkan, and GLFW bindings library your mother warned you about.
Stars: ✭ 534 (-1.66%)
Mutual labels:  hacktoberfest
Timecop
A time tracking app that respects your privacy and the gets the job done without being fancy.
Stars: ✭ 536 (-1.29%)
Mutual labels:  hacktoberfest
Cargo Deny
❌ Cargo plugin for linting your dependencies 🦀
Stars: ✭ 533 (-1.84%)
Mutual labels:  hacktoberfest

vardbg

Available on PyPI

A simple Python debugger and profiler that generates animated visualizations of program flow. It is meant to help with learning algorithms by allowing you to visualize what the algorithms are doing.

Python 3.6 or newer is required due to the use of f-strings.

This project was created during Google Code-in 2019 for CCExtractor Development.

Demo

Insertion Sort Demo

Features

  • Tracking the history of each variable and its contents
  • Tracking elements within containers (lists, sets, dicts, etc.)
  • Ignoring specific variables
  • Profiling the execution of each line
  • Summarizing all variables and execution times after execution
  • Passing arguments to debugged programs
  • Exporting execution history in JSON format and replaying (including program output)
  • Creating videos that show program flow, execution times, variables (with relationships), and output
  • Writing videos in MP4, GIF, and WebP formats

Installation

The latest tagged version can be obtained from PyPI:

pip install vardbg

Alternatively, one can clone this repository and run it directly after installing dependencies:

git clone https://github.com/CCExtractor/vardbg
cd vardbg
python3 -m venv venv
source venv/bin/activate
pip install poetry
poetry install .
./debug.py

It can also be installed from the repository:

pip install .

The above instructions assume the use of a virtual environment to avoid interfering with the system install of Python.

Usage

All of the debugger's subcommands and options are documented in the usage help, which is readily available on the command line.

For example, this command will debug the function quick_sort from the file sort.py with the arguments 9 3 5 1 and record the session to a JSON file named sort1.json:

vardbg run sort.py quick_sort -o qsort.json -a 9 -a 3 -a 5 -a 1

A video can then be generated from the above recording:

vardbg replay qsort.json -v sort_vis.mp4

It is possible to generate videos live while running the debugged program, but this is discouraged because the overhead of video creation inflates execution times greatly and thus ruins profiler results. However, if profiling is not important to you, it is a valid use case.

Configuration

The video generator has many options: resolution, speed, fonts, and sizes. These options can be modified using a TOML config file. The default config documents the available options, which can be customized in an minimal overlay config without having to duplicate the entire config. The config can then be used by passing the -c argument on the command line.

An example of a simple overlay is the config used to generate official demo videos for embedding in READMEs. This simple config increases the speed (FPS) slightly and adds an intro screen at the beginning of the video.

Behavior Control

Special comments can be added to lines of code that define variables to control how vardbg handles said variable:

  • # vardbg: ignore — do not display this variable or track its values
  • # vardbg: ref lst[i] — treat variable i as the index/key of an element in container lst (only shown in videos)

Specifying the name of the variable may appear to be redundant, but there are two reasons behind this: reliably parsing all code that defines variables is very hard (there are more possible methods than one might think — loops, unpacking, direct assignments, exec calls, etc.), and more than one variable can be declared on a line. For example, tuple unpacking and function arguments are common occurrences of multiple variables being added on a single line. Thus, specifying the variable name in references is mandatory to prevent ambiguity.

Contributing

Feel free to contribute to this project! You can add features, fix bugs, or make any other improvements you see fit. We just ask that you follow the code style guidelines to keep the code consistent and coherent. These guidelines can easily be enforced before pushing with the pre-commit framework, which can install Git pre-commit hooks with the pre-commit install command.

Once your contribution meets the guidelines, open a pull request to make things official.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].