dbg function names
Tue Aug 10 08:58:03 CEST 2021
On Sun, Aug 8, 2021 at 8:42 AM Trevor Brown <admin@REDACTED> wrote:
> Hi, I've used the dbg module a fair bit over the years, and I am curious
> about the names of the functions. Looking at the list of functions, I
> came up with what I think each function name means:
> The function names are all acronyms (except for the ones that clearly
> aren't like `get_tracer/0` and `stop/0`) and stand for the following:
> * `c` stands for *c*lear
I believe that the solitary `c` stands for *c*all.
> * `cn` stands for *c*lear *n*ode
> * `ctp` stands for *c*lear *t*race *p*attern
> * `ctpe` stands for *c*lear *t*race *p*attern *e*vent
> * `ctpg` stands for *c*lear *t*race *p*attern *g*lobal
> * `ctpl` stands for *c*lear *t*race *p*attern *l*ocal
> * `dtp` stands for *d*elete *t*race *p*attern (not sure if it's delete,
> drop, discard, etc...)
If you type "dbg:h(dtp)" it prints:
dtp() -> ok
- Deletes all saved match_spec's.
dtp(N) -> ok
- Deletes a specific saved match_spec.
So it is `delete`, just as you guessed.
> * `wtp` stands for *w*rite *t*race *p*attern
> * `rtp` stands for *r*ead *t*race *p*attern
> * `n` stands for *n*ode
> * `i` stands for *i*nformation
> * `p` stands for *p*rocess
> * `tp` stands for *t*race *p*attern (implicitly global)
> * `tpl` stands for *t*race *p*attern *l*ocal
> * `h` stands for *h*elp
> * `ln` stands for *l*ist *n*odes
> * `ltp` stands for *l*ist *t*race *p*atterns
> Can anyone confirm if I am correct here? And if so, reference any docs
> explaining this? I personally find that understanding the acronyms makes
> the functions easier to remember, so it's a shame the official docs
> don't explain this if I am correct.
I use the same words to describe the acronyms as you have done. I believe
the person that designed the dbg API has left the Erlang world for the time
being, so if we are incorrect we may never know.
If you want to create a PR that adds the names that you have proposed into
the documentation I think that it could be a good starting point in making
the words behind the acronyms official.
> Also, I've always assumed the module name stood for debug, but is that
> true? I haven't found any docs on that either.
I believe that you are correct, but I do not know for sure.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions