Hi, all. All the issues of beta1 have been fixed. Beta2 will be released soon.
btw is it expected that
- during debugging the debugger is stepping through
_build/default/proj.ml
notproj.ml
? - breakpoints need to be set in
_build/default/proj.ml
not inproj.ml
?
In beta2, you can set breakpoints on proj.ml as well as _build/default/proj.ml.
But indeed the source used by debugger is _build/default/proj.ml. So it is expected that stepping through _build/default/proj.ml.
Indeed I can. But unfortunately for me they don’t quite work… I’m on Ubuntu 20.04 / VSCodium 1.53.2
I’ve executed git pull
on my checkout of ocamlearlybird
repo from Github. I’m on commit 175eee657085fb89fa683f99c5f4109aba5bc0b2
now. I have updated both opam
side and VSCod(e/ium)
side from this commit.
Here’s how my testing went:
Scenario 1
- I double-clicked to the left of my code line in
proj.ml
- I saw a red dot
- I launched debugging via the following
launch.js
:{ "version": "0.2.0", "configurations": [ { "name": "try debug", "type": "ocamlearlybird", "request": "launch", "program": "${workspaceRoot}/_build/default/proj1.bc", "stopOnEntry": false, "yieldSteps": 4096, "onlyDebugGlob": "<${workspaceRoot}/_build/default/**/*>", "cwd": "${workspaceRoot}" } ] }
- what I expect to see: program execution stopped at that line of code
- what I saw instead: program executed completely to the end
If instead I place the breakpoint in _build/default/proj.ml
- on the same line - and launch debugger via the same launch.json
program execution indeed does stop on that line of code.
Scenario 2
As an experiment I
- changed my
launch.js
like this"stopOnEntry": true
- started the debugger via this launch config
- observed I’m in
PAUSED ON ENTRY
state - then placed a breakpoint in
proj1.ml
- what I expected to see: I expected a red dot to appear
- what I saw instead: a grey circle appeared
- I then pressed the blue arrow pointing right
- what I expected to see: I expected the debugger to stop on the line I placed the breakpoint into
- what I saw instead: execution proceeded to the end of the program
If while in PAUSED ON ENTRY
state instead of proj1.ml
I place that breakpoint in _build/default/proj.ml
- on the same line - I do see a red dot (as expected) and after pressing the blue right arrow program execution does stop on that line of code.
You should modify the launch configuration
"onlyDebugGlob": "<${workspaceRoot}/_build/default/**/*>",
to
"onlyDebugGlob": "<${workspaceRoot}/**/*>",
it works
It’s probably then a good time now to update the prime example on GitHub - hackwaly/ocamlearlybird: OCaml debug adapter
Update: thx! It’s up-to-date now
Could somebody shed some light and explain in more details? I have the same issue but do not know how to use the loaded scrips. Thanks in advance
I think that in the latest version you can define breakpoints in the original file itself. Nevertheless, when you start debuggind you have a section on the debugger called loaded scripts with the source files loaded from your _build directory. You just have to select which one you want to set breakpoint in.
Thank a lot for your reply!
Maybe i could ask just one more: once debugging session starts, the execution jumps to system libraries first. Is there a way to make sure that it stops at the entry point of source.ml file and skips the libraries?
Thanks in advance!
There is a config item called onlyDebugGlob.