https://github.com/hackwaly/vscode-ocaml-debugger
OCaml debugger for VS Code
https://github.com/hackwaly/vscode-ocaml-debugger
debugger vscode-extension
Last synced: 9 months ago
JSON representation
OCaml debugger for VS Code
- Host: GitHub
- URL: https://github.com/hackwaly/vscode-ocaml-debugger
- Owner: hackwaly
- Created: 2018-09-29T19:25:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-15T07:58:09.000Z (over 6 years ago)
- Last Synced: 2025-09-08T20:35:08.468Z (9 months ago)
- Topics: debugger, vscode-extension
- Language: JavaScript
- Size: 29.3 KB
- Stars: 14
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OCaml Debugger
***[Please report issuses here](https://github.com/hackwaly/ocamlearlybird/issues)***
## Prerequisite
```
opam install earlybird
```
### Sample launch.json
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "OCaml Debug",
"type": "ocaml-debugger",
"request": "launch",
"program": "${workspaceFolder}/a.out"
}
]
}
```
Assuming a file at `src/main.ml`
```ocaml
let fizzbuzz i = match ((i mod 3), (i mod 5)) with
| (0, 0) -> "fizbuzz"
| (_, 0) -> "buzz"
| (0, _) -> "fizz"
| (_, _) -> string_of_int i;;
let do_fizzbuzz n = for i = 1 to n do
print_endline (fizzbuzz i)
done;;
do_fizzbuzz 100;;
```
Compile `main.ml`
```bash
ocamlc -g src/main.ml
# creates a.out in root of the project
```
Then set breakpoint in `main.ml` and run **"OCaml Debug"** from the VS Code Debug panel.
## FAQ