diff options
author | Björn Gustavsson <[email protected]> | 2015-07-03 14:25:49 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-07-03 14:25:49 +0200 |
commit | 26f1810479a837ab338e7a9e3aef027a9e4b098d (patch) | |
tree | 996f0d33eff15d709f10f6b56fc2a4d058875fac /erts/emulator/test | |
parent | 3db7a35080d2836476a38d85391e1fcb7e7feb86 (diff) | |
parent | 99003f395207a23935bfd2859f9c7121da5110eb (diff) | |
download | otp-26f1810479a837ab338e7a9e3aef027a9e4b098d.tar.gz otp-26f1810479a837ab338e7a9e3aef027a9e4b098d.tar.bz2 otp-26f1810479a837ab338e7a9e3aef027a9e4b098d.zip |
Merge branch 'maint'
* maint:
Add a smoke test of erts_debug:df/1
Correct disassembly of the i_get_map_elements instruction
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/erts_debug_SUITE.erl | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index 3dd77eb920..35677f9953 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -139,23 +139,48 @@ flat_size_big_1(Term, Size0, Limit) when Size0 < Limit -> flat_size_big_1(_, _, _) -> ok. df(Config) when is_list(Config) -> - ?line P0 = pps(), - ?line PrivDir = ?config(priv_dir, Config), - ?line ok = file:set_cwd(PrivDir), - ?line erts_debug:df(?MODULE), - ?line Beam = filename:join(PrivDir, ?MODULE_STRING++".dis"), - ?line {ok,Bin} = file:read_file(Beam), - ?line ok = io:put_chars(binary_to_list(Bin)), - ?line ok = file:delete(Beam), - ?line true = (P0 == pps()), + P0 = pps(), + PrivDir = ?config(priv_dir, Config), + ok = file:set_cwd(PrivDir), + + AllLoaded = [M || {M,_} <- code:all_loaded()], + {Pid,Ref} = spawn_monitor(fun() -> df_smoke(AllLoaded) end), + receive + {'DOWN',Ref,process,Pid,Status} -> + normal = Status + after 20*1000 -> + %% Not finished (i.e. a slow computer). Stop now. + Pid ! stop, + receive + {'DOWN',Ref,process,Pid,Status} -> + normal = Status, + io:format("...") + end + end, + io:nl(), + _ = [_ = file:delete(atom_to_list(M) ++ ".dis") || + M <- AllLoaded], + + true = (P0 == pps()), ok. +df_smoke([M|Ms]) -> + io:format("~p", [M]), + erts_debug:df(M), + receive + stop -> + ok + after 0 -> + df_smoke(Ms) + end; +df_smoke([]) -> ok. + pps() -> {erlang:ports()}. instructions(Config) when is_list(Config) -> - ?line Is = erts_debug:instructions(), - ?line _ = [list_to_atom(I) || I <- Is], + Is = erts_debug:instructions(), + _ = [list_to_atom(I) || I <- Is], ok. id(I) -> |