8000 GitHub - akhal3d96/gotutor: Visualize Go code execution.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

akhal3d96/gotutor

 
 

Repository files navigation

GoTutor

GoTutor is a project aimed at capturing the execution steps of a Go program by interacting with the Delve debugger server. It retrieves variable values and stack information at each Go statement.

Features

  • Captures variable values and stack information at each Go statement
  • In the future, I plan to extend this project to visualize the execution steps, similar to Python Tutor.

Limitations

Currently, the project has limitations when handling multiple goroutines. When using next or step on a single goroutine, all goroutines progress, making it difficult to capture the state of other goroutines. This issue is documented in Delve Issue #1529. Attempts to create a client for each goroutine and step through them individually have been unsuccessful and have caused runtime errors in the Delve server.

Usage

the commands follow dlv cli terminology

exec

gotutor exec binary_path

run delve server with the binary that gotutor will interact with to get execution steps

debug

gotutor debug

build the go module in the current directory then contine the same as exec

connect

gotutor connect delve_server_address

connect to already running delve server

the execution steps will be written to steps.json file in the current direcotry

Prerequisites

  • Go (latest version)
  • Delve debugger

Installation

go install github.com/ahmedakef/gotutor@latest

docker

docker build -t gotutor . # or directly use ahmedakef/gotutor image to download it from docker hub
docker run --rm -v $(pwd)/example/main.go:/data/main.go -v $(pwd)/output/:/root/output gotutor debug /data/main.go

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

Visualize Go code execution.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elm 48.4%
  • Go 44.4%
  • HTML 2.2%
  • Shell 1.8%
  • Makefile 1.3%
  • CSS 1.1%
  • Dockerfile 0.8%
0