diff options
author | Hans Nilsson <[email protected]> | 2018-03-29 12:00:38 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-03-29 12:00:38 +0200 |
commit | f2fc2178ffad5fb890b4cc8ae0d44e3096c98103 (patch) | |
tree | c7d17aa5d23d0d9a0efe45435d1b7581f222a20d /lib/ssh/src/ssh_shell.erl | |
parent | c7ae37130690648f2934e033c4d8ab9551d61ac9 (diff) | |
parent | a785db13533e1fba0f8459b3a5e5ea96ba0299c1 (diff) | |
download | otp-f2fc2178ffad5fb890b4cc8ae0d44e3096c98103.tar.gz otp-f2fc2178ffad5fb890b4cc8ae0d44e3096c98103.tar.bz2 otp-f2fc2178ffad5fb890b4cc8ae0d44e3096c98103.zip |
Merge branch 'hans/ssh/dbg/OTP-14896'
* hans/ssh/dbg/OTP-14896:
ssh: New test suite ssh_dbg_SUITE for testing ssh_dbg
ssh: Use the new ssh_dbg module
ssh: New ssh_dbg module
ssh: Add ssh_connection_handler:alg/1 for test purposes
ssh: Unused fields #ssh.hkey and #ssh.kex removed
ssh: Simplify ssh_connection and ssh_connection_handler and their internal interfaces
Diffstat (limited to 'lib/ssh/src/ssh_shell.erl')
-rw-r--r-- | lib/ssh/src/ssh_shell.erl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh_shell.erl b/lib/ssh/src/ssh_shell.erl index 17224b6ef4..085534592d 100644 --- a/lib/ssh/src/ssh_shell.erl +++ b/lib/ssh/src/ssh_shell.erl @@ -22,6 +22,7 @@ -module(ssh_shell). +-include("ssh.hrl"). -include("ssh_connect.hrl"). %%% As this is an user interactive client it behaves like a daemon @@ -34,6 +35,8 @@ %% Spawn export -export([input_loop/2]). +-export([dbg_trace/3]). + -record(state, { io, %% Io process @@ -194,3 +197,20 @@ get_ancestors() -> A when is_list(A) -> A; _ -> [] end. + +%%%################################################################ +%%%# +%%%# Tracing +%%%# + +dbg_trace(points, _, _) -> [terminate]; + +dbg_trace(flags, terminate, _) -> [c]; +dbg_trace(on, terminate, _) -> dbg:tp(?MODULE, terminate, 2, x); +dbg_trace(off, terminate, _) -> dbg:ctpg(?MODULE, terminate, 2); +dbg_trace(format, terminate, {call, {?MODULE,terminate, [Reason, State]}}) -> + ["Shell Terminating:\n", + io_lib:format("Reason: ~p,~nState:~n~s", [Reason, wr_record(State)]) + ]. + +?wr_record(state). |