Obtaining the current state of the gen_fsm

Ulf Wiger (AL/EAB) <>
Fri Apr 22 10:33:05 CEST 2005


sys:get_status(FSM) will reveal the internal gen_fsm state,
which will give you information about the current state of
your program.

You can also run a call trace with call returns on your 
callback module, e.g. (simple tty trace from the shell):

dbg:tracer().
dbg:tp(myCallback, '_', '_', [{'_',[],[{message,{return_trace}}]}]).
dbg:p(all, [c]).

/Uffe

> -----Original Message-----
> From: 
> [mailto:]On Behalf Of Joel Reymont
> Sent: den 22 april 2005 10:25
> To: Erlang Users' List
> Subject: Obtaining the current state of the gen_fsm
> 
> 
> Folks,
> 
> How would you suggest debugging a gen_fsm as a whole?
> 
> I understand that I can invoke each state fun and see what the return
> value is but this seems suboptimal at times. 
> 
> Is there a way to obtain the internal state of the FSM? Then 
> I can have a
> general all-FSM event to return internal state /used for debugging
> purposes/ and my tests could check the current state of the FSM before
> the test and after.
> 
>     Thanks, Joel
> 
> -- 
> http://wagerlabs.com/tech
> 
> 
> 



More information about the erlang-questions mailing list