wren icon indicating copy to clipboard operation
wren copied to clipboard

Debugger Support

Open SuperWangKai opened this issue 7 years ago • 20 comments

Step over/in/out support, etc.

SuperWangKai avatar Mar 15 '17 05:03 SuperWangKai

Yes, this would be fantastic. It's a lot of work, obviously, but I think it's worth looking into. I'll have to do some thinking to see how to integrate it into the VM in a way that doesn't overwhelm it with complexity or harm performance in release builds. I have some ideas.

munificent avatar Apr 08 '17 19:04 munificent

Any progress with debugger?

Geequlim avatar Jan 12 '18 12:01 Geequlim

I'll be posting more info on debugging soon! We're working on getting it usable and cleaning it up for a PR. It's already usable and working well, but there are things like variable introspection and such that take a bit more effort. You can see the debugger in action here through vscode.

ruby0x1 avatar Jan 12 '18 12:01 ruby0x1

Good news!

Geequlim avatar Jan 12 '18 12:01 Geequlim

@underscorediscovery Great! I can't wait for this!

fy0 avatar Jan 23 '18 16:01 fy0

How is this feature going? Any updates?

SuperWangKai avatar Jun 14 '18 08:06 SuperWangKai

We're working on getting a PR up. (It's not trivial to merge upstream while Bob is occupied though, as it makes changes to the vm itself. A PR can at least be used by others in the mean time though.)

ruby0x1 avatar Jun 14 '18 14:06 ruby0x1

Is this still a thing? What's the debugger status?

RallyTronics avatar Aug 20 '19 16:08 RallyTronics

It's definitely still a thing! I recently got it running on Windows, fixed several bugs and updated the visual studio code plugin to the latest versions.

The biggest blocker on it is that it was/is tied to my codebase a bit, I'm busy working on making it run against master instead (It'll be in a branch initially as it has some important changes to review). Hopefully I'll have the branch up soon.

ruby0x1 avatar Aug 21 '19 02:08 ruby0x1

Great news! I appreciate the ongoing efforts on this.

RallyTronics avatar Aug 21 '19 02:08 RallyTronics

Do I get this right that the debugger would be VS Code based/tied ?

mitack avatar Jul 15 '20 08:07 mitack

The debugger support is built into the vm and isn't tied to anything specific, but the vscode plugin exposes it and makes it usable from there. If you had another system that supports debugger integration it should be possible to make it work there too.

ruby0x1 avatar Jul 15 '20 13:07 ruby0x1

Just an update on where this is at since I've been working on it:

The biggest blocker on it is that it was/is tied to my codebase a bit

I've been resolving this part here recently. My engine was running an older version of wren (for various reasons) which contributed to the disparity, blocking a PR. Pulling just the debugger parts out proved tricky considering the delta with the wren main branch and how much had changed.

I've finally updated it to latest Wren, and I'm testing the debugger again while I continue to clean up the debugger integration. The less surface area the debugger touches, the easier to maintain and keep behind an experimental flag.

This brings the PR for initial debugging support much closer.

ruby0x1 avatar Jul 21 '20 04:07 ruby0x1

@ruby0x1 How is progress going on this? I'm considering writing a dedicated IDE for Wren but am hesitant to start without debugger support.

gkjpettet avatar Oct 04 '20 15:10 gkjpettet

+1 for this feature.

yuppox avatar Jan 09 '21 01:01 yuppox

I would love to have the debugger @ruby0x1 :-)

Vinschni avatar Jun 17 '21 04:06 Vinschni

Just an update on where this is at since I've been working on it:

The biggest blocker on it is that it was/is tied to my codebase a bit

I've been resolving this part here recently. My engine was running an older version of wren (for various reasons) which contributed to the disparity, blocking a PR. Pulling just the debugger parts out proved tricky considering the delta with the wren main branch and how much had changed.

I've finally updated it to latest Wren, and I'm testing the debugger again while I continue to clean up the debugger integration. The less surface area the debugger touches, the easier to maintain and keep behind an experimental flag.

This brings the PR for initial debugging support much closer.

@ruby0x1 Has there been any progress on this at all since July 2020? It seemed like you were close and the dev log from 2017 said there was a working debugger for Wren.

I love Wren and use it as a scripting language in several apps I've written but I'm currently starting a new app that needs a scripting language but it really needs to support basic debugging. I don't want to have to use Lua or something else so I'm just wondering if there's any form of update at all?

gkjpettet avatar Feb 12 '22 10:02 gkjpettet

@ruby0x1 any chance you could publish the branch with your work on the debugger? as I couldn't find anything in your fork repo (https://github.com/ruby0x1/wren)

Even not complete or fully working code would be very helpful for me as I'm doing research and trying to find good examples of how a debugger can be implemented in a interpreter bytecode vm as I would like to learn how to implement that functionality for another language and implementing debuggers is one thing that's not covered in Bob's book.

maks avatar May 05 '22 05:05 maks

Alright everyone step one is finally here: getting the code into the repo branches and untangled 🎉

  • The very wip debugger branch:
    • https://github.com/wren-lang/wren/tree/debugger
    • read this https://github.com/wren-lang/wren/blob/debugger/doc/notes/debugger.md
  • The rough wip vscode extension for using the debugger:
    • https://github.com/wren-lang/wren-vscode

This debugger works but has some places where it'll access a null, and has lots of needed work on things like displaying the contents of variables etc properly. Sometimes the locals can be miscalculated? It's a work in progress!

The original implementation was done by @KeyMaster- (twitter) as a learning experience in luxe, so thanks to them!

ruby0x1 avatar Jun 06 '22 22:06 ruby0x1

Took a quick pick at the implementation, and I don't like it as this. It is, too much tight coupled to the host functions, seems to force network debugging, and does not allow self hosted debugging.

mhermier avatar Oct 11 '22 07:10 mhermier