[erlang-questions] dbg:stop/0 confusing
Lukas Larsson
lukas@REDACTED
Mon Oct 5 09:10:27 CEST 2015
Hello!
On Sun, Oct 4, 2015 at 3:45 AM, Leo Liu <sdl.web@REDACTED> wrote:
> Hi there,
>
> I check the source for dbg:stop/0 and it flushes trace messages and then
> stops the `dbg' process. However the doc says:
>
> --------------------------------
> stop() -> ok
>
> Stops the dbg server and clears all trace flags for all processes and
> all trace patterns for all functions. Also shuts down all trace clients
> and closes all trace ports.
>
> Note that no trace patterns are affected by this function.
> --------------------------------
>
> where is this ``clears all trace flags for all processes and all trace
> patterns for all functions'' implemented?
The clearing of trace flags for processes happens automatically by the vm
when the tracer process is terminated. The clearing of trace patterns is
done using dbg:ctp().
> The documentation is confusing
> on the difference between dbg:stop/0 and dbg:stop_clear/0. Help?
>
The documentation is indeed a confusing and I believe wrong. dbg:stop()
does not clean the function trace patterns, while dbg:stop_clear() does. So
the "and all trace patterns for all functions" part of the dbg:stop()
documentation should be removed.
Thanks for pointing this out, I'll put a patch in for the next release.
Unless someone can see something that I cannot?
Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151005/2f1b14eb/attachment.htm>
More information about the erlang-questions
mailing list