aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_listing.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-11-22 15:53:29 +0100
committerBjörn Gustavsson <[email protected]>2017-11-22 15:56:27 +0100
commit2d34363405f327e4883876f8917b6eeb127f5b6a (patch)
tree6162b53e5eff796b2de526b00de81d7a003b8977 /lib/compiler/src/beam_listing.erl
parent9198b5075e25250c15145b942a9d0c4ea023896e (diff)
downloadotp-2d34363405f327e4883876f8917b6eeb127f5b6a.tar.gz
otp-2d34363405f327e4883876f8917b6eeb127f5b6a.tar.bz2
otp-2d34363405f327e4883876f8917b6eeb127f5b6a.zip
Fix broken to_dis after merge from maint to master
d8d07a7593d811 that added the to_dis option to the compiler no longer works when merged to master. That is because of 79f28cfd8df1b7 that removed some unused code in erts_debug. Fix this by adding a new function erts_debug:dis_to_file/2 and use it from compile module where we have access to the filename (in beam_listing we only have an opened file).
Diffstat (limited to 'lib/compiler/src/beam_listing.erl')
-rw-r--r--lib/compiler/src/beam_listing.erl13
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/compiler/src/beam_listing.erl b/lib/compiler/src/beam_listing.erl
index d1d00017e9..73c6501fe5 100644
--- a/lib/compiler/src/beam_listing.erl
+++ b/lib/compiler/src/beam_listing.erl
@@ -54,19 +54,6 @@ module(Stream, {Mod,Exp,Attr,Code,NumLabels}) ->
[Name, Arity, Entry]),
io:put_chars(Stream, format_asm(Asm))
end, Code);
-module(Stream, Code) when is_binary(Code) ->
- #beam_file{ module = Module, compile_info = CInfo } = beam_disasm:file(Code),
- Loaded = code:is_loaded(Module),
- Sticky = code:is_sticky(Module),
- [code:unstick_mod(Module) || Sticky],
-
- {module, Module} = code:load_binary(Module, proplists:get_value(source, CInfo), Code),
- ok = erts_debug:df(Stream, Module),
-
- %% Restore loaded module
- _ = [{module, Module} = code:load_file(Module) || Loaded =/= false],
- [code:stick_mod(Module) || Sticky],
- ok;
module(Stream, [_|_]=Fs) ->
%% Form-based abstract format.
foreach(fun (F) -> io:format(Stream, "~p.\n", [F]) end, Fs).