aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_iload.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2012-11-13 11:01:48 +0100
committerAnthony Ramine <[email protected]>2013-12-12 12:54:24 +0100
commita122254898597d73658e72070862e2da0d1cf85b (patch)
tree6f3aa497c30b1faf01fb4805ba8603e1253318ba /lib/debugger/src/dbg_iload.erl
parent1b5c922b37c9c60dcfa53894a9968735019822e7 (diff)
downloadotp-a122254898597d73658e72070862e2da0d1cf85b.tar.gz
otp-a122254898597d73658e72070862e2da0d1cf85b.tar.bz2
otp-a122254898597d73658e72070862e2da0d1cf85b.zip
Support named funs in the debugger interpreter
The current code for the evaluation of ordinary funs is dependent on the order on variables in the fun environment as returned by erlang:fun_info(Fun, env). As it happened, adding the code for named funs changed the order in the environment for ordinary funs. To avoid the problem in the future, make sure that we only have one free variable in the funs that we will need to inspect using erlang:fun_info(Fun, env).
Diffstat (limited to 'lib/debugger/src/dbg_iload.erl')
-rw-r--r--lib/debugger/src/dbg_iload.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/debugger/src/dbg_iload.erl b/lib/debugger/src/dbg_iload.erl
index 3c95ef8068..9806692afc 100644
--- a/lib/debugger/src/dbg_iload.erl
+++ b/lib/debugger/src/dbg_iload.erl
@@ -369,6 +369,9 @@ expr({'fun',Line,{function,F,A},{_Index,_OldUniq,Name}}, _Lc) ->
As = new_vars(A, Line),
Cs = [{clause,Line,As,[],[{local_call,Line,F,As,true}]}],
{make_fun,Line,Name,Cs};
+expr({named_fun,Line,FName,Cs0,{_,_,Name}}, _Lc) when is_atom(Name) ->
+ Cs = fun_clauses(Cs0),
+ {make_named_fun,Line,Name,FName,Cs};
expr({'fun',Line,{function,{atom,_,M},{atom,_,F},{integer,_,A}}}, _Lc)
when 0 =< A, A =< 255 ->
%% New format in R15 for fun M:F/A (literal values).