diff options
author | Björn Gustavsson <[email protected]> | 2015-07-03 14:23:39 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-07-03 14:23:39 +0200 |
commit | 99003f395207a23935bfd2859f9c7121da5110eb (patch) | |
tree | c796395f38e14c7190cadbebfe7068788d7b945d /erts/emulator/test | |
parent | c28bfd7e33e5e08a01737ff2ff82f1e6e1e0e484 (diff) | |
parent | 16317f73f79265eba8e0cef4adaea6f6858d389b (diff) | |
download | otp-99003f395207a23935bfd2859f9c7121da5110eb.tar.gz otp-99003f395207a23935bfd2859f9c7121da5110eb.tar.bz2 otp-99003f395207a23935bfd2859f9c7121da5110eb.zip |
Merge branch 'bjorn/erts/beam_debug' into maint
* bjorn/erts/beam_debug:
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) -> |