aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-08-18 11:18:37 +0200
committerRaimo Niskanen <[email protected]>2016-08-18 11:18:37 +0200
commit9b1179d8c8c411a245c59fc7092e4a7a98f76663 (patch)
tree73fc3a479ecb95bebb3924c4e62265b1adab7a28 /lib/stdlib
parentb6541d133f166a3f28cc3b2daf14c59024312c60 (diff)
downloadotp-9b1179d8c8c411a245c59fc7092e4a7a98f76663.tar.gz
otp-9b1179d8c8c411a245c59fc7092e4a7a98f76663.tar.bz2
otp-9b1179d8c8c411a245c59fc7092e4a7a98f76663.zip
Improve sys debug
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/gen_statem.erl16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl
index eee7d60e9d..3b3477b282 100644
--- a/lib/stdlib/src/gen_statem.erl
+++ b/lib/stdlib/src/gen_statem.erl
@@ -666,14 +666,14 @@ format_status(
%% them, not as the real erlang messages. Use trace for that.
%%---------------------------------------------------------------------------
-print_event(Dev, {in,Event}, {Name,_}) ->
+print_event(Dev, {in,Event}, {Name,State}) ->
io:format(
- Dev, "*DBG* ~p receive ~s~n",
- [Name,event_string(Event)]);
-print_event(Dev, {out,Reply,{To,_Tag}}, {Name,_}) ->
+ Dev, "*DBG* ~p receive ~s in state ~p~n",
+ [Name,event_string(Event),State]);
+print_event(Dev, {out,Reply,{To,_Tag}}, {Name,State}) ->
io:format(
- Dev, "*DBG* ~p send ~p to ~p~n",
- [Name,Reply,To]);
+ Dev, "*DBG* ~p send ~p to ~p from state ~p~n",
+ [Name,Reply,To,State]);
print_event(Dev, {Tag,Event,NextState}, {Name,State}) ->
StateString =
case NextState of
@@ -1064,8 +1064,10 @@ loop_event_actions(
{next_event,Type,Content} ->
case event_type(Type) of
true ->
+ NewDebug =
+ sys_debug(Debug, S, State, {in,{Type,Content}}),
loop_event_actions(
- Parent, Debug, S, Events,
+ Parent, NewDebug, S, Events,
State, NewData, P, Event, NextState, Actions,
Postpone, Hibernate, Timeout,
[{Type,Content}|NextEvents]);