在 Erlang/OTP 中调试时如何修复 "Invalid beam file or no abstract code" 错误?
How to fix "Invalid beam file or no abstract code" error when debugging in Erlang/OTP?
我试图简单地使用调试器,但是文档中给出的任何方法都会导致 Monitor > Module > Interpret > *.beam
到 return 错误:** Invalid beam file or no abstract code: "/path/z12.beam"
.
我试过的生成调试信息的方法是:
Linux shell erlc +debug_info z12.erl
二郎shell> c(z12, [debug_info]).
直接在文件中compile:file(z12, [debug_info]).
但是其中 none 似乎有效。有办法解决这个问题吗?
与其选择 .beam 文件,不如尝试使用 .erl 文件,它会起作用。
实际上,您可以使用启动调试器的 erl shell 本身轻松加载模块。
c("erl_file_path",[debug_info]).
int:i("path/module_name").
示例:
12> c("/home/badri/hello.erl",[debug_info]).
{ok,hello}
15> int:i("/home/badri/hello").
{module,hello}
我试图简单地使用调试器,但是文档中给出的任何方法都会导致 Monitor > Module > Interpret > *.beam
到 return 错误:** Invalid beam file or no abstract code: "/path/z12.beam"
.
我试过的生成调试信息的方法是:
Linux shell
erlc +debug_info z12.erl
二郎shell
> c(z12, [debug_info]).
直接在文件中
compile:file(z12, [debug_info]).
但是其中 none 似乎有效。有办法解决这个问题吗?
与其选择 .beam 文件,不如尝试使用 .erl 文件,它会起作用。
实际上,您可以使用启动调试器的 erl shell 本身轻松加载模块。
c("erl_file_path",[debug_info]).
int:i("path/module_name").
示例:
12> c("/home/badri/hello.erl",[debug_info]).
{ok,hello}
15> int:i("/home/badri/hello").
{module,hello}