What is a good tool to aid in browsing/following C

2019-02-01 17:40发布

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!

27条回答
Luminary・发光体
2楼-- · 2019-02-01 18:15

I've had great success using doxygen. For best results (particularly when creating documentation for c++) install graphviz and enable in your doxygen configuration file.

This will automatically generate dependency maps and class diagrams that are linked to the rest of the html documentation.

查看更多
叛逆
3楼-- · 2019-02-01 18:16

A language-sensitive source code search engine can be found at SD Source Code Search Engine. It can handle many languages at the same time. Searches can be performed for patterns in a specific langauge, or patterns across languages (such as "find identifiers involving TAX"). By being sensitive to langauge tokens, the number of false positives is reduced, saving time for the user. It understands C, C++, C#, COBOL, Java, ECMAScript, Java, XML, Verilog, VHDL, and a number of other languages.

查看更多
唯我独甜
4楼-- · 2019-02-01 18:17

I've not used it directly, but I have used sites created with lxr and thought it very handy. It converts your project into line-numbered and cross-referenced HTML files, using links to cross-reference function and file names. There are some examples of projects source indexed with it here.

It doesn't appear that there is a version newer than 2006, but it may still work for what you want.

查看更多
混吃等死
5楼-- · 2019-02-01 18:17

I use Anjuta IDE. Not bad. Not sure how it compares to Eclipse IDE.

查看更多
Ridiculous、
6楼-- · 2019-02-01 18:18

cscope. (wanted to mod up other scope post, but i don't have karma yet).

  • global search and replace
  • find all places a function is called
  • find all places called by a function
  • find files including this file.

really simple usage: $ cscope -R

if you don't know vi, then change your EDITOR and VIEWER environmental variables to your preferred editor.

查看更多
【Aperson】
7楼-- · 2019-02-01 18:21

Even if you are not a developer go for Source Insight

And if you are, its a MUST HAVE :)

查看更多
登录 后发表回答