Debugging an Erlang code with Makefile in IntelliJ

140 Views Asked by At

Setup: OTP 26. IntelliJ 2022.3.1 with plugins Erlang 0.11.1162 and Makefile 223.8214.6

Code under preview: The test suite ct_netconfc_SUITE. We could run it from CLI using the command make common_test_test ARGS="-suite ct_netconfc_SUITE".

Goal: I want to debug test suite ct_netconfc_SUITE.

I have set breakpoints in the code. I have created a configuration using Run-->Edit Configurations for the make command specified above. I tried to debug using Run-->Debug-->Makefile-->Run. It successfully runs the configuration. But it did not stop at the breakpoint.

How to stop at the breakpoint?

Other than IntelliJ, what are the other options to debug an Erlang application with Makefile?

Installed Plugins

Makefile Plugin

Erlang plugin

Debug Configurations created for the make command Debug Configurations

Debugging command

Debug - Makefile

1

There are 1 best solutions below

1
On

I think you can use io:format function to debug what you want in the code, for example, print out List attribute:

io:format("I_want_to_print_this_List_~p", [List]).

In erlang, not like other programming languages (java, c#, c++) that can add breakpoints in there, with erlang if you have a million processes are running every second and over a hundred functions, that means impossible to add breakpoins to debug one by one.

As the comment of MadScientist, Makefile just helps us stop/start/build... application or which tool or script.