Code Browsing

I read far more code than I write. My most used tools are emacs, find, xargs and grep (M-x grep-find). But this brute force search:

Tags are nice. The semanticdb might be nice (haven't tried seriously). But for accurate code browsing of a tree that has been built, the final truth could be found in the compilation products - more specifically the debug info. Is there a package for emacs that would take debug info and higlight source code based on it, i.e. e.g. show source lines that have produced code differently from dead code? (this is the info debuggers indirectly show when debugging in mixed source/assembly mode). Using debug info would also allow very reliable tags-like "go to the definition of" operation.

To optimize things, gcc could dump the needed info in more readily suitable form for emacs to use. For detecting dead code based on conditional compilation, dump from the preprocessing phase would be enough. But for e.g. indicating unused macros in a header file differently from macros that have been used, something else than the preprocessed C code would be useful.

As a start - how about simply generating accurate tags from debug info? Or have tags as one dump option for gcc? Hmm.. objdump seems to be able to dump tags but whats the format? Aha - exuberant ctags. But the only elisp package I could find to support the format is vtags.el and that wants the tag file to have some additional header and wants the tags sorted. OK - that could be scripted but then it seems that e.g. line information for variables is always zero. And the only debug info that works for objdump is -gstabs? Hmm.. is this somehow related to the state of debugging tools in general?

Last modified: Sun Jun 11 16:39:18 EEST 2006