#! /usr/bin/env bash
#
# Run the osemgrep program with ocamldebug.
#
# Example of use:
#  $ ./debug
#  ...
#  (ocd) set arguments -j 1 --debug -e 'foo($X, $Y)' -l java tests/java/concrete_syntax.java
#  (ocd) run
#  ...
# The --debug arguments to is to change the behavior of semgrep and
# let the exn bubble up, for a better debugging experience.
# The -j 1 is to not use multiple processes, which is better for ocamldebug.
#

set -eu

# run-ocamldebug.sh calls `dune build` directly, which needs TREESITTER_*.
source "$(dirname "$0")/tree-sitter-config.sh"

./scripts/run-ocamldebug.sh ./_build/install/default/bin/osemgrep.bc
