aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'lib/debugger')
-rw-r--r--lib/debugger/src/dbg_debugged.erl5
-rw-r--r--lib/debugger/src/dbg_ieval.erl6
-rw-r--r--lib/debugger/src/dbg_ui_trace.erl12
-rw-r--r--lib/debugger/src/dbg_ui_trace_win.erl4
-rw-r--r--lib/debugger/src/dbg_wx_code.erl33
-rw-r--r--lib/debugger/src/dbg_wx_filedialog_win.erl9
-rw-r--r--lib/debugger/src/dbg_wx_trace.erl14
-rw-r--r--lib/debugger/src/dbg_wx_trace_win.erl19
-rw-r--r--lib/debugger/src/dbg_wx_win.erl10
-rw-r--r--lib/debugger/src/int.erl25
10 files changed, 76 insertions, 61 deletions
diff --git a/lib/debugger/src/dbg_debugged.erl b/lib/debugger/src/dbg_debugged.erl
index 4d9ffc4f3b..c21ad486e8 100644
--- a/lib/debugger/src/dbg_debugged.erl
+++ b/lib/debugger/src/dbg_debugged.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-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
@@ -104,7 +104,8 @@ handle_command(Command) ->
reply({apply,M,F,As}) ->
{value, erlang:apply(M,F,As)};
reply({eval,Expr,Bs}) ->
- erl_eval:expr(Expr, Bs). % {value, Value, Bs2}
+ %% Bindings is an orddict (sort them)
+ erl_eval:expr(Expr, lists:sort(Bs)). % {value, Value, Bs2}
%% Demonitor and delete message from inbox
%%
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index 2e88c35741..3c084c53ac 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-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
@@ -249,7 +249,7 @@ meta_loop(Debugged, Bs, #ieval{level=Le} = Ieval) ->
{sys, Debugged, {value,Val}} ->
{value, Val, Bs};
{sys, Debugged, {value,Val,Bs2}} ->
- {value, Val, Bs2};
+ {value, Val, merge_bindings(Bs2, Bs, Ieval)};
{sys, Debugged, {exception,{Class,Reason,Stk}}} ->
case get(exit_info) of
@@ -1248,7 +1248,7 @@ if_clauses([], Bs, Ieval) ->
exception(error, if_clause, Bs, Ieval).
%% case_clauses(Value, Clauses, Bindings, Error, Ieval)
-%% Error = try_clause � case_clause
+%% Error = try_clause | case_clause
case_clauses(Val, [{clause,_,[P],G,B}|Cs], Bs0, Error, Ieval) ->
case match(P, Val, Bs0) of
{match,Bs} ->
diff --git a/lib/debugger/src/dbg_ui_trace.erl b/lib/debugger/src/dbg_ui_trace.erl
index d318987f60..8017069c50 100644
--- a/lib/debugger/src/dbg_ui_trace.erl
+++ b/lib/debugger/src/dbg_ui_trace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -31,10 +31,10 @@
pid, % pid() Debugged process
meta, % pid() Meta process
- status, % {Status,Mod,Line} � {exit,Where,Reason}
- % Status = init � idle | break
- % | wait_break � wait_running
- % � running
+ status, % {Status,Mod,Line} | {exit,Where,Reason}
+ % Status = init | idle | break
+ % | wait_break | wait_running
+ % | running
% Where={Mod,Line} | null
cm, % atom() | undefined Current module
@@ -718,7 +718,7 @@ menus() ->
%% enable(Status) -> [MenuItem]
%% Status = init % when first message from Meta has arrived
-%% | idle | break | exit | wait_break � wait_running | running
+%% | idle | break | exit | wait_break | wait_running | running
enable(init) -> [];
enable(idle) -> ['Stop','Kill'];
enable(break) -> ['Step','Next','Continue','Finish','Skip',
diff --git a/lib/debugger/src/dbg_ui_trace_win.erl b/lib/debugger/src/dbg_ui_trace_win.erl
index 1b439cbf18..beb3fbd71e 100644
--- a/lib/debugger/src/dbg_ui_trace_win.erl
+++ b/lib/debugger/src/dbg_ui_trace_win.erl
@@ -418,8 +418,8 @@ clear_breaks(WinInfo, Mod) ->
%%--------------------------------------------------------------------
%% display(Arg)
%% Arg = idle | {Status,Mod,Line} | {running,Mod}
-%% � {exit,Where,Reason} | {text,Text}
-%% Status = break | wait � Level
+%% | {exit,Where,Reason} | {text,Text}
+%% Status = break | wait | Level
%% Level = int()
%% Mod = atom()
%% Line = integer()
diff --git a/lib/debugger/src/dbg_wx_code.erl b/lib/debugger/src/dbg_wx_code.erl
index 99826d9bdb..9853a5dbae 100644
--- a/lib/debugger/src/dbg_wx_code.erl
+++ b/lib/debugger/src/dbg_wx_code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. 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
@@ -30,6 +30,21 @@
-define(stc, wxStyledTextCtrl).
+%% For wx-2.9 usage
+-ifndef(wxSTC_ERLANG_COMMENT_FUNCTION).
+-define(wxSTC_ERLANG_COMMENT_FUNCTION, 14).
+-define(wxSTC_ERLANG_COMMENT_MODULE, 15).
+-define(wxSTC_ERLANG_COMMENT_DOC, 16).
+-define(wxSTC_ERLANG_COMMENT_DOC_MACRO, 17).
+-define(wxSTC_ERLANG_ATOM_QUOTED, 18).
+-define(wxSTC_ERLANG_MACRO_QUOTED, 19).
+-define(wxSTC_ERLANG_RECORD_QUOTED, 20).
+-define(wxSTC_ERLANG_NODE_NAME_QUOTED, 21).
+-define(wxSTC_ERLANG_BIFS, 22).
+-define(wxSTC_ERLANG_MODULES, 23).
+-define(wxSTC_ERLANG_MODULES_ATT, 24).
+-endif.
+
code_area(Parent) ->
FixedFont = wxFont:new(10, ?wxFONTFAMILY_TELETYPE, ?wxNORMAL, ?wxNORMAL,[]),
%%Ed = wxStyledTextCtrl:new(Parent, [{size, {700, 500}}]),
@@ -58,7 +73,21 @@ code_area(Parent) ->
{?wxSTC_ERLANG_MACRO, {40,144,170}},
{?wxSTC_ERLANG_RECORD, {40,100,20}},
{?wxSTC_ERLANG_SEPARATOR,{0,0,0}},
- {?wxSTC_ERLANG_NODE_NAME,{0,0,0}}],
+ {?wxSTC_ERLANG_NODE_NAME,{0,0,0}},
+ %% Optional 2.9 stuff
+ {?wxSTC_ERLANG_COMMENT_FUNCTION, {160,53,35}},
+ {?wxSTC_ERLANG_COMMENT_MODULE, {160,53,35}},
+ {?wxSTC_ERLANG_COMMENT_DOC, {160,53,35}},
+ {?wxSTC_ERLANG_COMMENT_DOC_MACRO, {160,53,35}},
+ {?wxSTC_ERLANG_ATOM_QUOTED, {0,0,0}},
+ {?wxSTC_ERLANG_MACRO_QUOTED, {40,144,170}},
+ {?wxSTC_ERLANG_RECORD_QUOTED, {40,100,20}},
+ {?wxSTC_ERLANG_NODE_NAME_QUOTED, {0,0,0}},
+ {?wxSTC_ERLANG_BIFS, {130,40,172}},
+ {?wxSTC_ERLANG_MODULES, {64,102,244}},
+ {?wxSTC_ERLANG_MODULES_ATT, {64,102,244}}
+ ],
+
SetStyle = fun({Style, Color}) ->
?stc:styleSetFont(Ed, Style, FixedFont),
?stc:styleSetForeground(Ed, Style, Color)
diff --git a/lib/debugger/src/dbg_wx_filedialog_win.erl b/lib/debugger/src/dbg_wx_filedialog_win.erl
index f109652a70..c8ecb7b5d4 100644
--- a/lib/debugger/src/dbg_wx_filedialog_win.erl
+++ b/lib/debugger/src/dbg_wx_filedialog_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -381,7 +381,6 @@ show_completion(Wanted, State = #state{text=TC, win=Win, list=LC, completion=Com
Last = wxTextCtrl:getLastPosition(TC),
wxTextCtrl:setSelection(TC, Start, Last),
destroy_completion(Comp),
- wxWindow:setFocus(TC),
State#state{ptext=Path, completion=undefined};
Paths when Comp =:= undefined ->
{PosX,PosY} = wxListCtrl:getPosition(LC),
@@ -406,14 +405,16 @@ show_completion(Wanted, State = #state{text=TC, win=Win, list=LC, completion=Com
%% wxListBox:connect(LB, command_listbox_doubleclicked),
wxListBox:connect(LB, command_listbox_selected),
wxWindow:show(Temp),
+ %% setFocus does a select all on 2.9 sigh..
+ {Start, Last} = wxTextCtrl:getSelection(TC),
wxWindow:setFocus(TC),
+ wxTextCtrl:setSelection(TC, Start, Last),
State#state{completion = {Temp, LB}, ptext=Wanted};
Paths ->
{_Temp, LB} = Comp,
wxListBox:clear(LB),
Files = [filename:basename(File) || File <- Paths],
- wxListBox:insertItems(LB,Files,0),
- wxWindow:setFocus(TC),
+ Files /= [] andalso wxListBox:insertItems(LB,Files,0),
State#state{ptext=Wanted}
end.
diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl
index 2fdf39ba5a..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-2011. 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
@@ -32,10 +32,10 @@
pid, % pid() Debugged process
meta, % pid() Meta process
- status, % {Status,Mod,Line} � {exit,Where,Reason}
- % Status = init � idle | break
- % | wait_break � wait_running
- % � running
+ status, % {Status,Mod,Line} | {exit,Where,Reason}
+ % Status = init | idle | break
+ % | wait_break | wait_running
+ % | running
% Where={Mod,Line} | null
cm, % atom() | undefined Current module
@@ -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.
@@ -740,7 +740,7 @@ menus() ->
%% enable(Status) -> [MenuItem]
%% Status = init % when first message from Meta has arrived
-%% | idle | break | exit | wait_break � wait_running | running
+%% | idle | break | exit | wait_break | wait_running | running
enable(init) -> [];
enable(idle) -> ['Stop','Kill'];
enable(break) -> ['Step','Next','Continue','Finish','Skip',
diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl
index 68e8e0b844..8b206ccd78 100644
--- a/lib/debugger/src/dbg_wx_trace_win.erl
+++ b/lib/debugger/src/dbg_wx_trace_win.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
@@ -19,7 +19,6 @@
%%
-module(dbg_wx_trace_win).
--compile([{nowarn_deprecated_function,{gs,config,2}}]).
%% External exports
-export([init/0, stop/1]).
@@ -431,8 +430,8 @@ clear_breaks(WinInfo, Mod) ->
%%--------------------------------------------------------------------
%% display(Arg)
%% Arg = idle | {Status,Mod,Line} | {running,Mod}
-%% � {exit,Where,Reason} | {text,Text}
-%% Status = break | wait � Level
+%% | {exit,Where,Reason} | {text,Text}
+%% Status = break | wait | Level
%% Level = int()
%% Mod = atom()
%% Line = integer()
@@ -481,13 +480,9 @@ display(#winInfo{window=Win, sb=Sb},Arg) ->
%% Contents = string()
%% Note: remove_code/2 should not be used for currently shown module.
%%--------------------------------------------------------------------
-is_shown(WinInfo, Mod) ->
- case lists:keyfind(Mod, 1, WinInfo#winInfo.editors) of
- {Mod, Editor} ->
- gs:config(Editor, raise), %% BUGBUG
- {true, WinInfo#winInfo{editor={Mod, Editor}}};
- false -> false
- end.
+is_shown(_WinInfo, _Mod) ->
+ %% Previously cached modules here, nyi so return false
+ false.
show_code(WinInfo = #winInfo{editor={_, Ed}}, Mod, Contents) ->
%% Insert code and update breakpoints, if any
@@ -572,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).
diff --git a/lib/debugger/src/int.erl b/lib/debugger/src/int.erl
index b3a8a07f03..1c9f2eddd1 100644
--- a/lib/debugger/src/int.erl
+++ b/lib/debugger/src/int.erl
@@ -626,18 +626,18 @@ find_src(Beam) ->
find_beam(Mod, Src) ->
SrcDir = filename:dirname(Src),
- BeamFile = packages:last(Mod) ++ code:objfile_extension(),
+ BeamFile = atom_to_list(Mod) ++ code:objfile_extension(),
File = filename:join(SrcDir, BeamFile),
case is_file(File) of
true -> File;
- false -> find_beam_1(Mod, SrcDir)
+ false -> find_beam_1(Mod, BeamFile, SrcDir)
end.
-find_beam_1(Mod, SrcDir) ->
- RootDir = find_root_dir(SrcDir, packages:first(Mod)),
+find_beam_1(Mod, BeamFile, SrcDir) ->
+ RootDir = filename:dirname(SrcDir),
EbinDir = filename:join(RootDir, "ebin"),
CodePath = [EbinDir | code:get_path()],
- BeamFile = to_path(Mod) ++ code:objfile_extension(),
+ BeamFile = atom_to_list(Mod) ++ code:objfile_extension(),
lists:foldl(fun(_, Beam) when is_list(Beam) -> Beam;
(Dir, error) ->
File = filename:join(Dir, BeamFile),
@@ -649,14 +649,6 @@ find_beam_1(Mod, SrcDir) ->
error,
CodePath).
-to_path(X) ->
- filename:join(packages:split(X)).
-
-find_root_dir(Dir, [_|Ss]) ->
- find_root_dir(filename:dirname(Dir), Ss);
-find_root_dir(Dir, []) ->
- filename:dirname(Dir).
-
check_beam(BeamBin) when is_binary(BeamBin) ->
case beam_lib:chunks(BeamBin, [abstract_code,exports]) of
{ok,{_Mod,[{abstract_code,no_abstract_code}|_]}} ->
@@ -711,14 +703,11 @@ scan_module_name_2(_, _) ->
scan_module_name_3(Ts) ->
case erl_parse:parse_form(Ts) of
- {ok, {attribute,_,module,{M,_}}} -> module_atom(M);
- {ok, {attribute,_,module,M}} -> module_atom(M);
+ {ok, {attribute,_,module,{M,_}}} -> M;
+ {ok, {attribute,_,module,M}} -> M;
_ -> error
end.
-module_atom(A) when is_atom(A) -> A;
-module_atom(L) when is_list(L) -> list_to_atom(packages:concat(L)).
-
%%--Stop interpreting modules-----------------------------------------
del_mod(AbsMod, Dist) ->