Skip to content
This repository has been archived by the owner on Feb 27, 2025. It is now read-only.

Debug mode questions #107

Open
ArunPidugu opened this issue Jun 28, 2017 · 4 comments
Open

Debug mode questions #107

ArunPidugu opened this issue Jun 28, 2017 · 4 comments

Comments

@ArunPidugu
Copy link

So I've been playing around with this plugin have a few questions about using debug mode:

screen shot 2017-06-27 at 8 30 25 pm

First, I originally put a breakpoint on line 8, but instead of line 8 it stops at line 9 (but if I put the breakpoint at line 7 it will correctly stop at line 7. Also, is there currently no support for viewing the current values of variables in the sidebar?

@hackwaly
Copy link
Owner

hackwaly commented Jun 28, 2017

Hello, @ArunPidugu

The debug support is depend on ocamldebug. The breakpoint sometimes can't be set to desired position is ocamldebug's limitation. You can try set column breakpoint (Shift + F9) instead of just line breakpoint. And there is no way to list variables when debugging. You can put cursor hover on variable to see it's value.

Now I'm working on a fresh new debug support by implement it in pure ocaml and directly use (skip ocamldebug) https://github.com/ocaml/ocaml/blob/trunk/byterun/caml/debugger.h protocol. As now I can see it solves a few problems that can't be solved by using ocamldebug, such as Next command (F10) sometimes step in a function, etc.

You can track the progress by watch the project https://github.com/hackwaly/ocamlvsdebug

@hackwaly
Copy link
Owner

I've tested that list variables in stack is possible (in new debug implementation).

image

@nadako
Copy link

nadako commented Aug 11, 2017

I'd love to check it out. I can see the ocaml project in the repo you linked, but how do I integrate it with VSCode?

@hackwaly
Copy link
Owner

hackwaly commented Aug 13, 2017

@nadako It is incomplete. If you'd like to try. Checkout the master branch of ocamlvsdebug. See the ${workspaceRoot}/.vscode/launch.json file. In vscode press F5 will launch ocamlvsdebug in server mode. Then you add a "debugServer": 4712 option to the launch.json of your test ocaml project. You can now use the ocamlvsdebug to debug your test ocaml project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants