-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add documentation on how to debug Goblint with VS Code #216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's not mentioned anywhere, I'm guessing earlybird doesn't require a particular OCaml version anymore? Or if it does, then it should be mentioned here.
docs/Debugging.md
Outdated
|
||
To build a Goblint executable with debug information, run the following command within the `analyzer` directory. | ||
|
||
`make debug` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't gotten around to trying earlybird but when I read about it, it required OCaml bytecode compilation. I see this debug target does that:
Lines 61 to 63 in 11dcafd
;; debug) | |
ocb -tag debug $TARGET.d.byte && | |
cp _build/$TARGET.d.byte goblint.byte |
Unlike the normal native build, this one still uses ocamlbuild instead of dune. Although this isn't necessarily about the documentation, I'm wondering if we could easily change this target to also build using dune.
This would be especially useful for speed because ocamlbuild doesn't do parallel building like dune I think, so it takes much longer.
docs/Debugging.md
Outdated
Install the [`hackwaly.ocamlearlybird` extension](https://marketplace.visualstudio.com/items?itemName=hackwaly.ocamlearlybird) in your installation of Visual Studio Code. | ||
To be able to use this extension, you additionally need to install `ocamlearlybird` on the opam switch you use for Goblint. To do this, run the following command in the `analyzer` directory: | ||
|
||
`opam install earlybird` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should also be part of make dev
?
Lines 98 to 101 in 11dcafd
;; dev) | |
echo "Installing opam packages for development..." | |
opam install utop ocaml-lsp-server ocp-indent ocamlformat ounit2 | |
# ocaml-lsp-server is needed for https://github.com/ocamllabs/vscode-ocaml-platform |
docs/Debugging.md
Outdated
] | ||
} | ||
``` | ||
Note that the individual strings in `arguments` cannot contain spaces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess they can, but then such argument would be passed as if it was quoted in the shell to contain a literal space.
I just noticed something slightly annoying now. Having the bytecode build around makes regression testing script ask this every time: analyzer/scripts/update_suite.rb Lines 43 to 47 in a71e9ed
Maybe we should make it an option of the script instead? |
Maybe yes, but I would go with this behavior of asking as the default. If I have both around, it is not clear which one is up-to-date, and as a creature of habit one tends to run But maybe we could provide flags |
The latest version of earlybird does work with OCaml 4.11 and 4.12. As OCaml 4.11.1 is the default switch for the Goblint setup right now, it should not be necessary to specify the OCaml version here. |
I added some |
Done. |
Add a Markdown description on how to debug Goblint with VS Code, using the
hackwaly.ocamlearlybird
extension. Closes #215. Related to #208.