I sometimes need to modify OSS code or other peoples' code (usually C-based, but sometimes C++/Java) and find myself "grep"ing headers for types, function declarations etc. as I follow code flow and try to understand the system. Is there a good tool that exists to aid in code browsing. I'd love to be able to click on a type and be taken to the declaration or click on a function name and be taken to it's implementation. I'm on a linux box, so replies like "just use Visual Studio" won't necessarily work for me. Thanks!
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
Any IDE will work fine. Netbeans and Eclipse are java based but have plugins for C/C++
Doxygen is wonderful. I've had to get across several legacy code bases that I was never involved in before, and it's been fantastic for that (even though the code bases were not documented using Doxygen format).
IntelliJ is pretty good as a source browser under Linux. It's got really good support for jumping between source and function declarations. Haven't tried it with C/C++ code, but it works well with Ruby and Java.
I use kscope, which uses cscope in the background, but provides function lists etc. as well. Seems to handle large projects like the linux kernel well too. The kscope homepage has a good concise description of what it does and doesn't do.
Doxygen can generate an set of web pages that include a source browser. Not quite as fancy as an IDE, but all it needs is a web browser.
If you are involved in projects which have a mix of HLL code along with Assembly i'd recommend Opengrok, i have recently shifted to Opengrok and find it amazing, Opengrok + Firefox + Extensions is the best combination in my opinion, a few firefox extensions like Scrapbook etc allow you to modify and add notes while you are browsing code, again this is mostly for 'Browsing' through code and not for modifying it on the fly.