traefik / yaegi

Yaegi is Another Elegant Go Interpreter
https://pkg.go.dev/github.com/traefik/yaegi
Apache License 2.0
7.17k stars 356 forks source link

Integrate yaegi with delve -> adds yaegis' interpreter to a debug session #1446

Open alexpGH opened 2 years ago

alexpGH commented 2 years ago

Proposal

Wouldnt it be possible to combine yaegi with delve such, that in a debug session e.g. halted at a break point, all available variables etc. (which could be retrieved from dlv) are available in an interpreter session?

Start your dlv debug session (e.g. in vscode), halt at a breakpoint, execute interpreted go code, using local variables of the debugged code, ideally also being able to call the programs other functions.

Background

When debugging in an interpreter language, one has the possibility to execute some commands on the current program state (e.g. export some variables for plotting, working with variables etc.). To me it seems that, based on yaegi, this should be possible or do I have a misunderstanding?

Workarounds

-

emicklei commented 7 months ago

@alexpGH fyi, I started working on a OSS project (palimbo)with a similar goal. I am working on an IDE extension that allows for modifications of functions , rewinding stacks and proceed with changed behaviour or changed state. I hope the yaegi debugger can do the heavy lifting.

ldez commented 7 months ago

You can also use https://github.com/traefik-contrib/yaegi-debug-adapter

emicklei commented 6 months ago

Hi, I started working on the idea I mentioned and would like discuss ideas and challenges I find. What medium is best to use to ask those questions? Slack? other?

ldez commented 6 months ago

The best place will be https://github.com/traefik/yaegi/discussions