[erlang-questions] counter.erl example from "Concurrent Programming in ERLANG" - debugging

Alain O'Dea alain.odea@REDACTED
Tue Mar 15 01:15:34 CET 2011


Hi Wes:

On 2011-03-14, at 19:03, Wes James <comptekki@REDACTED> wrote:

> I run the counter.erl in the shell - Pid=counter:start().  Then ran
> counter:value(Pid) - returns 0.  I wanted to see how this works in the
> debugger so I run (after starting new shell or f() ):
> 
> 
> c(counter,[debug_info]).
> im().
> ii(counter).
> iaa([init]).
> 
> 
> then Pid=counter:start().
> 
> It then runs through some of the code lines in the debugger.  I then
> run counter:value(Pid), but then it just freezes after I press enter.
> Can the debugger not debug this?
> 
> got out of the shell then back in and just ran up to
> counter:value(Pid) again and it returns 0.  So the debugger is not
> liking something.
> 
> thx,
> 
> -wes

Out of curiosity, why are you using that
particular book?  Erlang and its tools may have changed enough to break it's examples.

Much more current resources are available:

Frédéric Trottier-Hébert's Learn You Some Erlang for Great Good:
http://learnyousomeerlang.com/

Joe Armstrong's Programming Erlang, Software for a Concurrent World:
http://pragprog.com/titles/jaerlang/programming-erlang

Martin Logan, Richard Carlsson and Eric Merritt's Erlang and OTP in Action:
http://www.manning.com/logan/

Francesco Cesarini and Simon Thompson's Erlang Programming:
http://oreilly.com/catalog/9780596518189


More information about the erlang-questions mailing list