aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_ieval.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-03-24 11:29:05 +0100
committerBjörn Gustavsson <[email protected]>2011-08-18 10:00:30 +0200
commit959a660d8867aa1690d70f656316db98ed8a504f (patch)
tree35320bd983b28fd8208c2c800bfd04c4eba3a31b /lib/debugger/src/dbg_ieval.erl
parentc67dcea4a123ad7871040ec991674533953f8c48 (diff)
downloadotp-959a660d8867aa1690d70f656316db98ed8a504f.tar.gz
otp-959a660d8867aa1690d70f656316db98ed8a504f.tar.bz2
otp-959a660d8867aa1690d70f656316db98ed8a504f.zip
debugger: Include line numbers in exceptions
Diffstat (limited to 'lib/debugger/src/dbg_ieval.erl')
-rw-r--r--lib/debugger/src/dbg_ieval.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index 70600121b3..df725ed9e5 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -462,8 +462,9 @@ do_eval_function(Mod, Name, As0, Bs0, Called, Ieval0) ->
trace(call, {Called, {Le,Li,Mod,Name,As0}}),
Ieval = Ieval0#ieval{module=Mod,function=Name,arguments=As0},
case get_function(Mod, Name, As0, Called) of
- Cs when is_list(Cs) ->
- fnk_clauses(Cs, As0, erl_eval:new_bindings(), Ieval);
+ [{clause,FcLine,_,_,_}|_]=Cs ->
+ fnk_clauses(Cs, As0, erl_eval:new_bindings(),
+ Ieval#ieval{line=FcLine});
not_interpreted when Top -> % We are leaving interpreted code
{value, {dbg_apply,Mod,Name,As0}, Bs0};
@@ -836,7 +837,7 @@ expr({safe_bif,Line,M,F,As0}, Bs0, #ieval{level=Le}=Ieval0) ->
{As,Bs} = eval_list(As0, Bs0, Ieval1),
trace(bif, {Le,Line,M,F,As}),
Ieval2 = dbg_istk:push(Bs0, Ieval1, false),
- Ieval = Ieval2#ieval{module=M,function=F,arguments=As},
+ Ieval = Ieval2#ieval{module=M,function=F,arguments=As,line=-1},
{_,Value,_} = Res = safe_bif(M, F, As, Bs, Ieval),
trace(return, {Le,Value}),
dbg_istk:pop(),
@@ -848,7 +849,7 @@ expr({bif,Line,M,F,As0}, Bs0, #ieval{level=Le}=Ieval0) ->
{As,Bs} = eval_list(As0, Bs0, Ieval1),
trace(bif, {Le,Line,M,F,As}),
Ieval2 = dbg_istk:push(Bs0, Ieval1, false),
- Ieval = Ieval2#ieval{module=M,function=F,arguments=As},
+ Ieval = Ieval2#ieval{module=M,function=F,arguments=As,line=-1},
{_,Value,_} = Res = debugged_cmd({apply,M,F,As}, Bs, Ieval),
trace(return, {Le,Value}),
dbg_istk:pop(),