aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_wx_trace_win.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2013-02-22 15:09:25 +0100
committerHans Bolinder <[email protected]>2013-03-07 13:54:33 +0100
commitd0bb666c8811615981db8721c119ee6450857272 (patch)
tree8d9f67dfe26e61ff9a69e9a7f86eb302e1f1d7ab /lib/debugger/src/dbg_wx_trace_win.erl
parenta8c7417e2e1b6e20c1f1a7247a04579b77ce9037 (diff)
downloadotp-d0bb666c8811615981db8721c119ee6450857272.tar.gz
otp-d0bb666c8811615981db8721c119ee6450857272.tar.bz2
otp-d0bb666c8811615981db8721c119ee6450857272.zip
[debugger] Add an option 'Strings'
A new checkbox has been added. When it is checked, the range set by the 'erl' flag '+pc' is used for determining when to print lists of integers as strings. When it is unchecked, integer lists are never printed as strings. A minor incompatibility: settings saved by Erlang R16B01 or later cannot be read by Erlang R16B or earlier.
Diffstat (limited to 'lib/debugger/src/dbg_wx_trace_win.erl')
-rw-r--r--lib/debugger/src/dbg_wx_trace_win.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl
index e54ce3913f..48935c66a5 100644
--- a/lib/debugger/src/dbg_wx_trace_win.erl
+++ b/lib/debugger/src/dbg_wx_trace_win.erl
@@ -35,6 +35,7 @@
select_line/2, selected_line/1,
eval_output/3, % Evaluator area
update_bindings/2, % Bindings area
+ update_strings/1,
trace_output/2, % Trace area
handle_event/2
]).
@@ -200,6 +201,7 @@ create_win(Parent, Title, Windows, Menus) ->
wxFrame:show(Win),
put(window, Win),
+ put(strings, [str_on]),
Wi
end,
@@ -567,12 +569,20 @@ 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("~99999tP",[Val, 20])),
+ Format = case get(strings) of
+ [] -> "~999999lP";
+ [str_on] -> "~999999tP"
+ end,
+ wxListCtrl:setItem(BA, Row, 1, dbg_wx_win:to_string(Format,[Val, 20])),
Row+1
end, 0, Bs),
put(bindings,Bs),
ok.
+update_strings(Strings) ->
+ _ = put(strings, Strings),
+ ok.
+
%%--------------------------------------------------------------------
%% trace_output(Str)
%% Str = string()
@@ -853,7 +863,10 @@ handle_event(#wx{id=?EVAL_ENTRY, event=#wxCommand{type=command_text_enter}},
handle_event(#wx{event=#wxList{type=command_list_item_selected, itemIndex=Row}},Wi) ->
Bs = get(bindings),
{Var,Val} = lists:nth(Row+1, Bs),
- Str = io_lib:format("< ~s = ~lp~n", [Var, Val]),
+ Str = case get(strings) of
+ [] -> io_lib:format("< ~s = ~lp~n", [Var, Val]);
+ [str_on] -> io_lib:format("< ~s = ~tp~n", [Var, Val])
+ end,
eval_output(Wi, Str, bold),
ignore;
handle_event(#wx{event=#wxList{type=command_list_item_activated, itemIndex=Row}},_Wi) ->