3.10.6. Debugging

By default, the runtime is optimized for speed and will assume that the application code is correct. Hence, it will not perform most validity checks. To enable validity checks, run the application with the version.debug configuration variable set to true. This will enable many internal validity checks that may be violated when the application code is incorrect.

To debug an application with a regular debugger, please compile its code with the regular debugging flags and also the -keep flag (Mercurium). This flag forces Mercurium to dump the transformed code in the local file system, so that it is available for the debugger.

The runtime system has a component named “loader” that is the responsible for selecting a runtime variant that meets the requirements set by the user though the configuration variables. The loader is also responsible for calling some functions that initialize the runtime variant and convert the main function into a regular task. To debug problems due to the installation, run the application with the loader.verbose configuration variable set to true.