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 | |
parent | 60c836afbb7c993f3bd635e12c80f018aa017e3b (diff) | |
download | otp-7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4.tar.gz otp-7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4.tar.bz2 otp-7eaaf5dd6140eda8b3892ef23e1fcf70be90d7c4.zip |
debugger: Improve handling of Unicode
-rw-r--r-- | lib/debugger/src/dbg_ieval.erl | 8 | ||||
-rw-r--r-- | lib/debugger/src/dbg_wx_break_win.erl | 4 | ||||
-rw-r--r-- | lib/debugger/src/dbg_wx_mon_win.erl | 4 | ||||
-rw-r--r-- | lib/debugger/src/dbg_wx_trace.erl | 19 | ||||
-rw-r--r-- | lib/debugger/src/dbg_wx_win.erl | 2 | ||||
-rw-r--r-- | lib/debugger/src/i.erl | 8 |
6 files changed, 29 insertions, 16 deletions
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl index 88c7caacb0..8009d62629 100644 --- a/lib/debugger/src/dbg_ieval.erl +++ b/lib/debugger/src/dbg_ieval.erl @@ -353,15 +353,15 @@ format_trace(What, Args, P) -> {Called, {Le,Li,M,F,As}} = Args, case Called of extern -> - io_lib:format("++ (~w) <~w> ~w:~w~ts~n", + io_lib:format("++ (~w) <~w> ~w:~tw~ts~n", [Le,Li,M,F,format_args(As, P)]); local -> - io_lib:format("++ (~w) <~w> ~w~ts~n", + io_lib:format("++ (~w) <~w> ~tw~ts~n", [Le,Li,F,format_args(As, P)]) end; call_fun -> {Le,Li,F,As} = Args, - io_lib:format("++ (~w) <~w> ~w~ts~n", + io_lib:format("++ (~w) <~w> ~tw~ts~n", [Le, Li, F, format_args(As, P)]); return -> {Le,Val} = Args, @@ -370,7 +370,7 @@ format_trace(What, Args, P) -> bif -> {Le,Li,M,F,As} = Args, - io_lib:format("++ (~w) <~w> ~w:~w~ts~n", + io_lib:format("++ (~w) <~w> ~w:~tw~ts~n", [Le, Li, M, F, format_args(As, P)]) end. diff --git a/lib/debugger/src/dbg_wx_break_win.erl b/lib/debugger/src/dbg_wx_break_win.erl index 770681510d..10e9272254 100644 --- a/lib/debugger/src/dbg_wx_break_win.erl +++ b/lib/debugger/src/dbg_wx_break_win.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2016. All Rights Reserved. +%% Copyright Ericsson AB 2008-2017. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -159,7 +159,7 @@ create_win(Parent, Pos, Type, Mod, Line) -> %%-------------------------------------------------------------------- update_functions(WinInfo, Funcs) -> Items = lists:map(fun([N, A]) -> - lists:flatten(io_lib:format("~p/~p", [N,A])) + lists:flatten(io_lib:format("~tw/~w", [N,A])) end, Funcs), wxListBox:set(WinInfo#winInfo.listbox, Items), diff --git a/lib/debugger/src/dbg_wx_mon_win.erl b/lib/debugger/src/dbg_wx_mon_win.erl index 9737c9e67f..fcd954454b 100644 --- a/lib/debugger/src/dbg_wx_mon_win.erl +++ b/lib/debugger/src/dbg_wx_mon_win.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2016. All Rights Reserved. +%% Copyright Ericsson AB 2008-2017. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -342,7 +342,7 @@ add_process(WinInfo, Pid, Name, {Mod,Func,Args}, Status, Info) -> Row = (WinInfo#winInfo.row), Name2 = case Name of undefined -> ""; _ -> to_string(Name) end, - FuncS = to_string("~w:~w/~w", [Mod, Func, length(Args)]), + FuncS = to_string("~w:~tw/~w", [Mod, Func, length(Args)]), Info2 = case Info of {} -> ""; _ -> to_string(Info) end, Pid2 = to_string("~p",[Pid]), 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) -> diff --git a/lib/debugger/src/dbg_wx_win.erl b/lib/debugger/src/dbg_wx_win.erl index f1298154ab..9f59915476 100644 --- a/lib/debugger/src/dbg_wx_win.erl +++ b/lib/debugger/src/dbg_wx_win.erl @@ -299,7 +299,7 @@ open_help(_Parent, HelpHtmlFile) -> %%-------------------------------------------------------------------- to_string(Atom) when is_atom(Atom) -> - atom_to_list(Atom); + io_lib:format("~tw", [Atom]); to_string(Integer) when is_integer(Integer) -> integer_to_list(Integer); to_string([]) -> ""; diff --git a/lib/debugger/src/i.erl b/lib/debugger/src/i.erl index 2da3e77618..62ce8d0e20 100644 --- a/lib/debugger/src/i.erl +++ b/lib/debugger/src/i.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2016. All Rights Reserved. +%% Copyright Ericsson AB 1998-2017. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -307,13 +307,13 @@ ip() -> ip([{Pid,{M,F,A},Status,{}}|Stats]) -> hformat(io_lib:format("~w",[Pid]), - io_lib:format("~p:~p/~p",[M,F,length(A)]), + io_lib:format("~w:~tw/~w",[M,F,length(A)]), io_lib:format("~w",[Status]), ""), ip(Stats); ip([{Pid,{M,F,A},Status,Info}|Stats]) -> hformat(io_lib:format("~w",[Pid]), - io_lib:format("~p:~p/~p",[M,F,length(A)]), + io_lib:format("~w:~tw/~w",[M,F,length(A)]), io_lib:format("~w",[Status]), io_lib:format("~w",[Info])), ip(Stats); @@ -321,7 +321,7 @@ ip([]) -> ok. hformat(A1, A2, A3, A4) -> - format("~-12s ~-21s ~-9s ~-21s~n", [A1,A2,A3,A4]). + format("~-12s ~-21ts ~-9s ~-21s~n", [A1,A2,A3,A4]). %% ------------------------------------------- |