aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_icmd.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-03-31 07:22:02 +0200
committerBjörn Gustavsson <[email protected]>2011-08-16 08:58:47 +0200
commit3ccc4730e54f0f9e86bf96360b7600ab8c9e1d47 (patch)
tree994796c3b34c131d7db98295e13e7cfdcb2b6982 /lib/debugger/src/dbg_icmd.erl
parent778eece5cdc55f19daf354ed374a556dde37cafa (diff)
downloadotp-3ccc4730e54f0f9e86bf96360b7600ab8c9e1d47.tar.gz
otp-3ccc4730e54f0f9e86bf96360b7600ab8c9e1d47.tar.bz2
otp-3ccc4730e54f0f9e86bf96360b7600ab8c9e1d47.zip
Rewrite stack handling
Problems with the current stack implementation: * The GUI assumes that the stack frame pushed on the stack is level 2. If the 'no_tail' option is set for the process, there may not be an entry for level 2. * In each stack entry, the line number is the line number of the caller, not the line number for the function in the 'mfa' field as might be expected. That complicates generation of a stacktrace with line number information. Change the implementation as follows: * Keep the information for the current function (its MFA and current line number) in the #ieval{} record. Don't push it onto the stack. Only push the information when another function is called. That will ensure that the MFA and the line number is found in the same stack entry. That also has the advantage that if the 'no_tail' option is set, the stack not need to be modified for tail-recursive calls. * Make sure that there always is an entry for level two.
Diffstat (limited to 'lib/debugger/src/dbg_icmd.erl')
-rw-r--r--lib/debugger/src/dbg_icmd.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/debugger/src/dbg_icmd.erl b/lib/debugger/src/dbg_icmd.erl
index c158aad1cf..b230efaa7a 100644
--- a/lib/debugger/src/dbg_icmd.erl
+++ b/lib/debugger/src/dbg_icmd.erl
@@ -345,8 +345,8 @@ handle_user_msg({get,stack_frame,From,{Dir,SP}}, _Status, _Bs,_Ieval) ->
reply(From, stack_frame, dbg_istk:stack_frame(Dir, SP));
handle_user_msg({get,messages,From,_}, _Status, _Bs, _Ieval) ->
reply(From, messages, messages());
-handle_user_msg({get,backtrace,From,N}, _Status, _Bs, _Ieval) ->
- reply(From, backtrace, dbg_istk:backtrace(N)).
+handle_user_msg({get,backtrace,From,N}, _Status, _Bs, Ieval) ->
+ reply(From, backtrace, dbg_istk:backtrace(N, Ieval)).
set_stack_trace(true) ->
set_stack_trace(all);