aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_ieval.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-07 14:01:06 +0100
committerBjörn Gustavsson <[email protected]>2011-11-07 14:01:06 +0100
commitd0f1b81f1f0a8955c09d8a626d2d747950c52459 (patch)
tree6a4c727e7d122cb73ecffd6db8d39d4daf7874df /lib/debugger/src/dbg_ieval.erl
parent2d4f4dca7a511dd61cc99f01bdf2a3dadaef9e5e (diff)
parentff432e262e65243cbc983fcb002527f8fae8c78b (diff)
downloadotp-d0f1b81f1f0a8955c09d8a626d2d747950c52459.tar.gz
otp-d0f1b81f1f0a8955c09d8a626d2d747950c52459.tar.bz2
otp-d0f1b81f1f0a8955c09d8a626d2d747950c52459.zip
Merge branch 'bjorn/external-funs/OTP-9643'
* bjorn/external-funs/OTP-9643: EEP-23: Allow variables in fun M:F/A Reference manual: Improve the documentation for external funs Test calling a parameterized module within a fun beam_loader: Support external funs in the literal pool
Diffstat (limited to 'lib/debugger/src/dbg_ieval.erl')
-rw-r--r--lib/debugger/src/dbg_ieval.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index df725ed9e5..2e88c35741 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -768,6 +768,21 @@ expr({make_fun,Line,Name,Cs}, Bs, #ieval{module=Module}=Ieval) ->
end,
{value,Fun,Bs};
+%% Construct an external fun.
+expr({make_ext_fun,Line,MFA0}, Bs0, Ieval0) ->
+ {[M,F,A],Bs} = eval_list(MFA0, Bs0, Ieval0),
+ try erlang:make_fun(M, F, A) of
+ Value ->
+ {value,Value,Bs}
+ catch
+ error:badarg ->
+ Ieval1 = Ieval0#ieval{line=Line},
+ Ieval2 = dbg_istk:push(Bs0, Ieval1, false),
+ Ieval = Ieval2#ieval{module=erlang,function=make_fun,
+ arguments=[M,F,A],line=-1},
+ exception(error, badarg, Bs, Ieval, true)
+ end;
+
%% Common test adaptation
expr({call_remote,0,ct_line,line,As0,Lc}, Bs0, Ieval0) ->
{As,_Bs} = eval_list(As0, Bs0, Ieval0),