Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoints do not work in some cases #80

Open
lolveley opened this issue Feb 16, 2017 · 5 comments
Open

Breakpoints do not work in some cases #80

lolveley opened this issue Feb 16, 2017 · 5 comments
Labels

Comments

@lolveley
Copy link

lolveley commented Feb 16, 2017

hello,

I installed vscode, ocaml extension with merlin on ubuntu 16.10, and all works great (merlin features) but I can't get the debugging. I followed the little video given in your readme.md file, but it doesn't apparently suffice :-(
here is my launch.json file:
{
"version": "0.2.0",
"configurations": [

    {
        "name": "OCaml",
        "type": "ocamldebug",
        "request": "launch",
        "program": "/home/lowley/Documents/ocaml/01test/a.out",
        "stopOnEntry": false
    }
]

}

...and my tasks.json file:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "ocamlc",
"isShellCommand": true,
"args": ["-g", "essai1.ml"],
"showOutput": "always"
}
when I hit F5, the program runs the a.out file, and don't stop at the unconditional breakpoint I put in its middle. In the debug console, the result shows the end of the program has been reached.

What did I miss?

thank you
lowley

@hackwaly
Copy link
Owner

Doest stopOnEntry option works?

@lolveley
Copy link
Author

hello

thank you for your reply.
I set "stopOnEntry" to true, and now I partially manage to debug my program. But there's still some caveats :

  • I set a breakpoint at line 3. if I hit F5 to start the debugging, the debugging toolbar is displayed, but the breakpoint line is not displayed in a particular color, and the variable spies contain the value "Canceled". so I think the debugging has begun but there could be a bug...
    if I hit F10(next statement) a yellow line is displayed but in the pervasive file. A few more F10 hits bring me back to my program, with the debugging line in yellow and the spies containing correct values.
  • 2ndly, after having stopped the debugging, I changed the breakpoint line from the 3rd line to the first.
    I hit F5 and the debugging toolbar is displayed but the breakpoint is automatically changed and moved to the 3rd line! still, the current debugging line is not displayed in yellow.
    sorry for my scholar english!

@hackwaly
Copy link
Owner

The problems seem ocamldebug's. Ocamldebug has many small issues like those. I can help you less.

Can you paste your ocaml source here? Maybe your breakpoint hasn't been hit.

@lolveley
Copy link
Author

yes, here it is:

let year = 20126
let leap = (year mod 4 = 0 && year mod 100 <> 0) || year mod 400 = 0
let msg = if leap then "is" else "is not"
let () = Printf.printf "%d %s a leap year\n" year msg

do you think it could works better on windows than on ubuntu?

@lolveley lolveley reopened this Feb 17, 2017
@hackwaly
Copy link
Owner

let () = 
    let year = 20126 in
    let leap = (year mod 4 = 0 && year mod 100 <> 0) || year mod 400 = 0 in
    let msg = if leap then "is" else "is not" in
    let () = Printf.printf "%d %s a leap year\n" year msg

This can be debugged well.

@hackwaly hackwaly changed the title no debugging Breakpoints do not work in some cases Mar 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants