I’ve been spending quite a bit of my time lately learning my way around a big new code base. Being able to set random breakpoints and step through the code is a godsend, but quite often, it can be tricky to quickly narrow things down to the area you’re interested in. What I realised this afternoon is that my life would be much easier if I had a debugger combined with a free text search.
In the first instance, it would be enough to just search the source lines which are being executed (and maybe break whenever there’s a match). That would let me, for example, find exactly where that extra parameter is being added to my URL without having to step through everything or grep the source code for what turns out to be a very common string.
To take it a step further, it would be really handy if it searched values of variables along the way to catch the case where the parameter name was pulled out of a config file or database).
Of course, it would probably be very difficult to implement (at least in a compiled language) in a way that has reasonable performance, but even a very slow solution would work well from what I’m currently doing. Maybe the another way of looking at the problem is that I want to search through only the code which was actually executed during a particular invocation…
Anyway, it’s probably not something I’ll be heading off trying to implement (and I imagine at some point someone will tell me you can already do it in smalltalk), but it certainly would have been handy if it had been in eclipse today.