Reputation: 41
Is this information contained in these chunks of the Beam file? Or is there another way?
Upvotes: -1
Views: 225
Reputation: 41618
For a beam file compiled from Erlang, you can get the number of lines like this:
{ok,{_ModuleName,[{debug_info,{debug_info_v1,erl_abstract_code, DebugInfoData}}]}} =
beam_lib:chunks("my_module", [debug_info]).
{ok, Defs} = erl_abstract_code:debug_info(erlang_v1, x, DebugInfoData, []).
{eof, {Lines, _}} = lists:last(Defs).
Replace "my_module"
with the file name of the beam file without the .beam
extension.
Upvotes: 0