82 points · by phab · 5y ago · 35 comments
Related "CodeQuery"(https://github.com/ruben2020/codequery) which uses both cscope and ctags databases (i use both for C/C++ code from within vim) and provides a GUI frontend.
Combine with "Doxygen" and "GNU cflow" (https://www.gnu.org/software/cflow/) and you get a very good view of the static structure of any codebase.
To get a Runtime view i prefer the call graph emitted by the profiler gprof.
I built https://twitter.com/PredragGruevski/status/13447256045208780... just for fun as an exploration of this space, and I'm wondering where the limits are :)
The hardest part for me has been setting up the list of files and folders to scan for the project and trying to eliminate errors. Fortunately you still get useful data depending on the errors.
Nowadays I'm using the global search feature of vscode for code exploration. Combined with the available language server for each language, it seems to work well enough for me currently.
https://sourceforge.net/projects/cscope/files/
I set the forward proxy automatically rewrite http://subdomain.sourceforge.net links into the above https:// format.
Also helpful for exploration of unknown code. However, in general it navigates between files opened already (as it generates ctags on open). But allows loading an externally generated ctags file. Also does symbol usage lookup and auto-completion.
cacope has excellent emacs integration as well.
for c++, unfortunately, cscope was ok till about c++-98, but modern incarnation of the standard seem to have given rise to a slew of tools for code navigation.
most notable amongst them being around the notion of compilation databases and language servers etc. unfortunately though, for large codebases (>= 1 giga-lines) in my experience they don’t seem to offer anything better, and need to be used in conjunction with grep and their modern incarnations f.e ripgrep etc. making the entire workflow quite unwieldy...
Currently an unmaintained project. https://sourceforge.net/projects/kscope/
I switched a few years ago, maybe i wasn't using all of cscope's strengths?
The reason i like it is because it is implemented in the classic "Unix Tools" manner i.e. small, fast, self-contained, good feature set and easily integrated with many editors. Now of course you have lots more tools with similar functionalities but i find most to be too big and unwieldy with lots of dependencies and a pain to setup. If you have ever been forced to work on minimal systems with no Desktop GUIs, remote targets etc. you come to appreciate small powerful tools which you can carry with you everywhere.
As they say, "if it ain't broke, don't fix it".