All Projects → laike9m → Cyberbrain

laike9m / Cyberbrain

Licence: mit
Python debugging, redefined.

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to Cyberbrain

Debugging
Talk about general debugging strategies. How to be less confused and frustrated.
Stars: ✭ 86 (-95.71%)
Mutual labels:  debugging
Debug
A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers
Stars: ✭ 9,912 (+394.12%)
Mutual labels:  debugging
Sniffer
Networking activity logger for Swift
Stars: ✭ 108 (-94.62%)
Mutual labels:  debugging
Clitools
🔧 CliTools for Docker, PHP / MySQL development, debugging and synchonization
Stars: ✭ 86 (-95.71%)
Mutual labels:  debugging
Python Aspectlib
An aspect-oriented programming, monkey-patch and decorators library. It is useful when changing behavior in existing code is desired. It includes tools for debugging and testing: simple mock/record and a complete capture/replay framework.
Stars: ✭ 90 (-95.51%)
Mutual labels:  debugging
Cargo Embed
a cargo extension for working with microcontrollers
Stars: ✭ 100 (-95.01%)
Mutual labels:  debugging
Training Material
A collection of code examples as well as presentations for training purposes
Stars: ✭ 85 (-95.76%)
Mutual labels:  debugging
Scala Trace Debug
Macro based print debugging. Locates log statements in your IDE.
Stars: ✭ 110 (-94.52%)
Mutual labels:  debugging
Ksniff
Kubectl plugin to ease sniffing on kubernetes pods using tcpdump and wireshark
Stars: ✭ 1,339 (-33.25%)
Mutual labels:  debugging
Console Log Viewer
Displays logs and Javascript errors in an overlay on top of your site. Useful for mobile webdevelopment. Enabled in 5 seconds
Stars: ✭ 103 (-94.87%)
Mutual labels:  debugging
React Native Logs
Performance-aware simple logger for React-Native with namespaces, custom levels and custom transports (colored console, file writing, etc.)
Stars: ✭ 84 (-95.81%)
Mutual labels:  debugging
Injectallthethings
Seven different DLL injection techniques in one single project.
Stars: ✭ 1,297 (-35.34%)
Mutual labels:  debugging
Repl
REPL rewrite for Node.js ✨🐢🚀✨
Stars: ✭ 101 (-94.97%)
Mutual labels:  debugging
Google It Automation With Python
Repository to keep track of Google IT Automation with Python provided by Coursera
Stars: ✭ 86 (-95.71%)
Mutual labels:  debugging
Httpcat
httpcat is a simple utility for constructing raw HTTP requests on the command line.
Stars: ✭ 109 (-94.57%)
Mutual labels:  debugging
Vlog
An in-display logging library for Android 📲
Stars: ✭ 86 (-95.71%)
Mutual labels:  debugging
Scala Debugger
Scala libraries and tooling utilizing the Java Debugger Interface.
Stars: ✭ 100 (-95.01%)
Mutual labels:  debugging
Nailgun
Nailgun attack on ARM devices.
Stars: ✭ 114 (-94.32%)
Mutual labels:  debugging
Httptoolkit Android
Automatic Android interception & debugging with HTTP Toolkit, for Android
Stars: ✭ 107 (-94.67%)
Mutual labels:  debugging
Birdseye
Graphical Python debugger which lets you easily view the values of all evaluated expressions
Stars: ✭ 1,373 (-31.56%)
Mutual labels:  debugging

Cyberbrain: Python debugging, redefined.

support-version PyPI implementation PyPI version shields.io "GitHub Discussions" Discord Twitter

Cyberbrain1(电子脑) aims to free programmers from debugging. It lets you:

  • Backtrace variable changes.

  • See every state of program execution, including variables' values

  • Debug loops with confidence.

Never spend hours stepping through a program, let Cyberbrain tell you what happened.

Read more about existing features, and roadmaps for features to come.

I gave a talk at PyCascades 2021 about Cyberbrain, watch it here.

Install

Cyberbrain consists of a Python library and various editor/IDE integrations. Currently it supports VS Code and Gitpod. See our plan on expanding the support.

To install Cyberbrain:

pip install cyberbrain
code --install-extension laike9m.cyberbrain

You can also install from PyPI , VS Code marketplace or Open VSX .

Or, you can try Cyberbrain online: Open in Gitpod

How to Use

Suppose you want to trace a function foo, just decorate it with @trace:

from cyberbrain import trace

# As of now, you can only have one @trace decorator in the whole program.
# We may change this in version 2.0, see https://github.com/laike9m/Cyberbrain/discussions/73

@trace  # Disable tracing with `@trace(disabled=True)`
def foo():
    ...

Cyberbrain keeps your workflow unchanged. You run a program (from vscode or command line, both work), and a new panel will be opened to visualize how your program executed.

The following gif demonstrates the workflow (click to view the full size image):

usage

Read our documentation to learn more about Cyberbrain's features and limitations.

Note on use

  • Cyberbrain may conflict with other debuggers. If you set breakpoints and use VSC's debugger, Cyberbrain may not function normally. Generally speaking, prefer "Run Without Debugging" (like shown in the gif).
  • If you have multiple VS Code window opened, the trace graph will always be created in the first one. #72 is tracking this issue.
  • When having multiple decorators, you should put @trace as the innermost one.
    @app.route("/")
    @trace
    def hello_world():
        x = [1, 2, 3]
        return "Hello, World!"

Roadmaps

Updated 2020.11

Cyberbrain is new and under active development, bugs are expected. If you met any, please create an issue. At this point, you should NOT use Cyberbrain in production. We'll release 1.0 when it's ready for production.

Major features planned for future versions are listed below. It may change over time.

Version Features
1.0 Code & trace interaction (#7), API specification
2.0 Multi-frame tracing (👉 I need your feedback for this feature)
3.0 async support, remote debugging
4.0 Fine-grained symbol tracing
5.0 Multi-threading support

Visit the project's kanban to learn more about the current development schedule.

How does it compare to other tools?

PySnooper PySnooper and Cyberbrain share the same goal of reducing programmers' work while debugging, with a fundamental difference: Cyberbrain traces and shows the sources of each variable change, while PySnooper only logs them. The differences should be pretty obvious after you tried both.
Debug Visualizer Debug visualizer and Cyberbrain have different goals. Debug visualizer visualizes data structures, while Cyberbrain visualizes program execution (but also lets you inspect values).
Python Tutor Python Tutor is for education purposes, you can't use it to debug your own programs. It's a brilliant tool for its purpose and I do it like it very much.
Static analysis Cyberbrain is *NOT* static analyis. It's runtime tracing. Static analysis can't provide enough information for debugging.

Community

Interested in Contributing?

See the development guide. This project follows the all-contributors specification. Contributions of ANY kind welcome!

All Contributors

Thanks goes to these wonderful contributors


Alex Hall

🤔

Frost Ming

🐛 📖

Funloading

💻

Ikko Ashimine

💻

Kaustubh Gupta

📝

Ram Rachum

🤔

Siyuan Xu

🐛

Victor Sun

💻 🤔

dingge2016

💵 💻

foo bar

💵

inkuang

🐛

laixintao

📖

yihong

💵 🤔

林玮 (Jade Lin)

🐛 🤔

Support

Cyberbrain is a huge and complicated project that will last for years, but once finished, it will reshape how people think and do debugging. Your support can help sustain it. Let's make it the best Python debugging tool 🤟!

❤️ Sponsor on GitHub

1: The name of this project originates from Ghost in the Shell, quote:

Cyberization is the process whereby a normal brain is physically integrated with electronic components to produce an augmented organ referred to as a cyberbrain.

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].