如何修复在Erlang/OTP中调试时出现的“无效射束文件或无抽象代码”错误?

fnatzsnv  于 2022-12-08  发布在  Erlang
关注(0)|答案(2)|浏览(122)

I'm trying to simply use the debugger, however any method given in the docs causes Monitor > Module > Interpret > *.beam to return an error: ** Invalid beam file or no abstract code: "/path/z12.beam" .
The methods to generate debug info I tried are:

  1. Linux shell erlc +debug_info z12.erl
  2. Erlang shell > c(z12, [debug_info]).
  3. Directly in the file compile:file(z12, [debug_info]).
    However none of them seems to work. Is there a way to fix this?
gywdnpxw

gywdnpxw1#

Actually you easily load the module using erl shell itself in which debugger was started.

c("erl_file_path",[debug_info]).
int:i("path/module_name").

example:

12> c("/home/badri/hello.erl",[debug_info]). 
{ok,hello} 
15> int:i("/home/badri/hello"). 
{module,hello}
nnvyjq4y

nnvyjq4y2#

而不是选择.beam文件尝试与.erl文件,它会工作。

相关问题