diff options
author | Hans Bolinder <[email protected]> | 2017-06-16 16:26:06 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-09-05 11:02:25 +0200 |
commit | 7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4 (patch) | |
tree | 6d4533546f16dca9ff99d9b125e65fe3659db6cc /lib/debugger/src/dbg_wx_trace.erl | |
parent | 60c836afbb7c993f3bd635e12c80f018aa017e3b (diff) | |
download | otp-7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4.tar.gz otp-7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4.tar.bz2 otp-7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4.zip |
debugger: Improve handling of Unicode
Diffstat (limited to 'lib/debugger/src/dbg_wx_trace.erl')
-rw-r--r-- | lib/debugger/src/dbg_wx_trace.erl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl index f4ee30618c..b1e0e03b4c 100644 --- a/lib/debugger/src/dbg_wx_trace.erl +++ b/lib/debugger/src/dbg_wx_trace.erl @@ -345,11 +345,12 @@ gui_cmd('Back Trace', State) -> P = p(State), lists:foreach( fun({Le, {Mod,Func,Args}}) -> - Str = io_lib:format("~p > ~p:~p"++P++"~n", - [Le, Mod, Func, Args]), + Str = io_lib:format("~p > ~w:~tw~ts\n", + [Le, Mod, Func, format_args(Args, P)]), dbg_wx_trace_win:trace_output(State#state.win,Str); ({Le, {Fun,Args}}) -> - Str = io_lib:format("~p > ~p"++P++"~n", [Le, Fun, Args]), + Str = io_lib:format("~p > ~p~ts~n", + [Le, Fun, format_args(Args, P)]), dbg_wx_trace_win:trace_output(State#state.win,Str); (_) -> ignore end, @@ -539,6 +540,18 @@ add_break(WI, Coords, Type, Mod, Line) -> Win = dbg_wx_trace_win:get_window(WI), dbg_wx_break:start(Win, Coords, Type, Mod, Line). +format_args(As, P) when is_list(As) -> + [$(,format_args1(As, P),$)]; +format_args(A, P) -> + [$/,io_lib:format(P, [A])]. + +format_args1([A], P) -> + [io_lib:format(P, [A])]; +format_args1([A|As], P) -> + [io_lib:format(P, [A]),$,|format_args1(As, P)]; +format_args1([], _) -> + []. + %%--Commands from the interpreter------------------------------------- int_cmd({interpret, Mod}, State) -> |