From 7f048c5d71534d458351513e84bb879c47f2c76e Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 11 Jan 2013 11:07:25 +0100 Subject: debugger: View terms as unicode-strings Changed the displayed variables to be printed with ~tp to show default all lists and utf-8 binaries as unicode strings. If the user want to see the content without unicode strings he can click on them to see the content as integers, if not it only contains latin1 because ~p converts that. There is currently no way to display it as lists with indentation, so I choose to keep it as it was. --- lib/debugger/src/dbg_wx_trace.erl | 4 ++-- lib/debugger/src/dbg_wx_trace_win.erl | 2 +- lib/debugger/src/dbg_wx_win.erl | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl index f61df93aec..0a3cac905f 100644 --- a/lib/debugger/src/dbg_wx_trace.erl +++ b/lib/debugger/src/dbg_wx_trace.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2012. All Rights Reserved. +%% Copyright Ericsson AB 2008-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -513,7 +513,7 @@ gui_cmd({edit, {Var, Val}}, State) -> cancel -> State; {Var, Term} -> - Cmd = atom_to_list(Var)++"="++io_lib:format("~p", [Term]), + Cmd = atom_to_list(Var)++"="++io_lib:format("~w", [Term]), gui_cmd({user_command, lists:flatten(Cmd)}, State) end. diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl index ffe7401904..8b206ccd78 100644 --- a/lib/debugger/src/dbg_wx_trace_win.erl +++ b/lib/debugger/src/dbg_wx_trace_win.erl @@ -567,7 +567,7 @@ update_bindings(#winInfo{bind=#sub{out=BA}}, Bs) -> wx:foldl(fun({Var,Val},Row) -> wxListCtrl:insertItem(BA, Row, ""), wxListCtrl:setItem(BA, Row, 0, dbg_wx_win:to_string(Var)), - wxListCtrl:setItem(BA, Row, 1, dbg_wx_win:to_string("~500P",[Val, 80])), + wxListCtrl:setItem(BA, Row, 1, dbg_wx_win:to_string("~99999tP",[Val, 20])), Row+1 end, 0, Bs), put(bindings,Bs), diff --git a/lib/debugger/src/dbg_wx_win.erl b/lib/debugger/src/dbg_wx_win.erl index faf3cc178f..3cb6edd953 100644 --- a/lib/debugger/src/dbg_wx_win.erl +++ b/lib/debugger/src/dbg_wx_win.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -252,9 +252,9 @@ notify(Win,Message) -> %%-------------------------------------------------------------------- entry(Parent, Title, Prompt, {Type, Value}) -> - Ted = wxTextEntryDialog:new(Parent, to_string(Prompt), - [{caption, to_string(Title)}, - {value, to_string(Value)}]), + Ted = wxTextEntryDialog:new(Parent, to_string(Prompt), + [{caption, to_string(Title)}, + {value, to_string("~999999tp",Value)}]), case wxDialog:showModal(Ted) of ?wxID_OK -> @@ -306,7 +306,7 @@ to_string([]) -> ""; to_string(List) when is_list(List) -> List; to_string(Term) -> - io_lib:format("~p",[Term]). + io_lib:format("~tp",[Term]). to_string(Format,Args) -> io_lib:format(Format, Args). -- cgit v1.2.3