I'm sure if you're reading this question you are already familiar with my love for
pgfkeys. However, it is absolutely impossible to debug:
\tracingmacros is a total mess, with every key expanding to dozens of complex internal macros. I would like to be able to debug it the same way I can debug a program built by hand using
\def: watch the keys absorb their arguments, expand their values or execute their code, and proceed to the next key. I don't care how
\pgfk@try or whatever is defined, only that it looks for a key and does or doesn't find it, acting accordingly.
Currently, I debug by intimidation:
\tracingmacros=1 and lots of scrolling plus a bit of pattern recognition for the repetitive macro noise. It's too much to hope that there is some way of coercing
pgfkeys into producing nicer output; it would require the author to have hand-coded a selectively populated call stack. I'm wondering, though, if anyone else familiar with this package could tell me how they figure out what's going on with their keys.
Related: How to best debug LaTeX? (by Yossi Farjoun; not coincidentally, this question is also really his, from a recent chat conversation.)
I have written a draft of a package that traces
pgfkeys. I have tested it as much as I can stand, and it seems both to work and to be useful, but I am reluctant to publish it on CTAN before giving it a beta run. Therefore I am making it available only on my own website (no longer available) for now. It consists (for now) just of a
.styfile with a comment block at the top describing how it works.
I would really appreciate any comments you might have, so I'm going to open up a second answer (CW) for feature requests and bug reports. Perhaps it's selfish, but I want reputation from this answer.