Character debugging in Erlang

I am working on some simple programs to learn Erlang, and whenever I try to use a debugger, I get "Invalid ray file or without abstract code: test_module", and nothing interesting happens. It seems to me that I am compiling my modules without debugging symbols, but I cannot find how to fix it.

That's what I'm doing:

>c(test).
>debugger:quick(test, start, []).
** Invalid beam file or no abstract code: test

I feel that I must be missing something obvious. I also tried this:

>debugger:start().

which appears in a beautiful window, but downloading files (test.erl, test.beam) gives me similar error messages.

+6
source share
2 answers

you need to compile the debug_info file, i.e.

compile:file("path/to/file.erl",[debug_info]).
+10
source

- , debug_info .

, , debug_info:

5> session_svr:module_info(compile).
[{version,"7.3.1"},
 {options,[debug_info,
           {i,"/home/pbk/local/dev/erlang/scheduler/include"}]},
 {source,"/home/pbk/local/dev/erlang/scheduler/src/session_svr.erl"}]

, , "/..." session_svr.beam :

** Invalid beam file or no abstract code: "/home/pbk/local/dev/erlang/scheduler/ebin/session_svr.beam"
0

All Articles