[erlang-questions] Weird behavior with the visual debugger.

Dan Gudmundsson <>
Wed Nov 26 10:49:18 CET 2014


There is no way around timeouts without modifying your code, what I try to
say is:
write your code so that the timeouts are macros and infinity when debug
compiled.

Something like this (untested):

-ifdef(DEBUG).
-define(TIMEOUT(TIME), inifinity).
-else.
-define(TIMEOUT(TIME), (TIME)).
-endif.


fetch(Data) ->
     gen_server:call(server, {Fetch,Data}, ?TIMEOUT(5000)).

or

receive Msg -> do_something(Msg)
after ?TIMEOUT(5000) -> timeout
end.

/Dan

On Tue, Nov 25, 2014 at 8:47 PM, Matthieu Tourne <>
wrote:

> Dan, could you go a little bit into details how you would get around to do
> this ? Again, very new to the Erlang world.
>
> Imants, Thank you I already have this as my user_default.erl [1], but not
> exactly what I've been looking for.
>
>
> [1] http://www.snookles.com/erlang/user_default.erl
>
> On Tue, Nov 25, 2014 at 1:52 AM, Imants Cekusins <> wrote:
>
>> Just in case: dbg functions allow filtering by module, function.
>>
>> It is possible to trace errors only. Call args & return values are
>> available too.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141126/39718849/attachment.html>


More information about the erlang-questions mailing list