Skip to content

Debugging the DMLA runtime using the launcher

While this has not been documented, the launcher actually has a utility that makes it possible to attach a JVM remote debugger to the DMLA runtime the launcher starts. This comes in handy when debugging the LSP server, or any other modes without using the IntelliJ launch configs to start the runtime with a debugger attached. Use the arg as follows: dmla run [args...] --jvmdbg <wait, none, silent>

  • wait will pause execution (before main) until the JVM remote debugger is attached
  • silent will start execution, but a debugger can be attached to the running process at any time
  • none is the default, it disables JVM debugging

The port used by the rutime is 5006. If the need arises to change this, the option may be extended with an optional <PORT> parameter.

While starting the runtime in a command prompt/terminal using GraalVM directly is not recommended, the --showcmd switch can be used to obtain the JVM launch parameters used by the launcher, which might come in handy for creating custom build/launch scripts.

IntelliJ remote JVM debugger config

Use the config JVM Remote from the git repository, or copy the following settings: JVM remote debugger config (While any other JVM remote debugger might work, proceed at your own risk (//discretion).)

Quick iterations

The script copyToUserFolder.bat (provided in the root directory of the DMLA3.1 project) overwrites the runtime used by the launcher with the latest shadowJar. Using this in combination with the launcher's jvmdbg parameter can essentially provide the same environment as the IntelliJ launch configs.