@pagan I played around a bit with your suggestion. I noticed that the :: syntax can only be used as an argument to showstat (or to its low-level companion debugopts). Thus, it can only be used to view procedures. To view the contents of other module locals, one still needs to use the kernelopts setting. This may be needed to fully understand module code. For example, isprime is implemented as a ModuleApply. After showstat(isprime), we see between statements 6 and 7 that a reference is made to a set special_primes. This is a local of module isprime. (Do eval(isprime) to view the header of isprime as a module.) To view special_primes, do
(The eval is redundant in this case, special_primes being a set; I just include it to cover the other cases.)
This would a good time to mention that one often needs to also issue the command interface(verboseproc= 3) before viewing the code and remember table of a procedure with eval.