<p>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!</p>

[{'answer_id': 68252, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 4, 'selected': False, 'text': '<p>You can\'t get anything better than <a href="http://www.sourceinsight.com" rel="noreferrer">SourceInsight</a>.</p>\n'}, {'answer_id': 68253, 'author': 'Blair Conrad', 'author_id': 1199, 'author_profile': 'https://Stackoverflow.com/users/1199', 'pm_score': 3, 'selected': False, 'text': '<p>I\'ve heard amazing things about <a href="http://opengrok.github.io/OpenGrok/" rel="nofollow noreferrer">OpenGrok</a>. I know another team at my place of employ uses it and they find it very handly. From its web site:</p>\n\n<blockquote>\n  <p>OpenGrok is a fast and usable source\n  code search and cross reference\n  engine. It helps you search,\n  cross-reference and navigate your\n  source tree. It can understand various\n  program file formats and version\n  control histories like Mercurial, Git,\n  SCCS, RCS, CVS, Subversion, Teamware,\n  ClearCase, Perforce and Bazaar. In\n  other words it lets you grok\n  (profoundly understand) the open\n  source, hence the name OpenGrok. It is\n  written in Java.</p>\n</blockquote>\n'}, {'answer_id': 68258, 'author': 'cschol', 'author_id': 2386, 'author_profile': 'https://Stackoverflow.com/users/2386', 'pm_score': 3, 'selected': False, 'text': '<p>I use <a href="http://www.vim.org" rel="noreferrer">Vim</a> with <a href="http://ctags.sourceforge.net/" rel="noreferrer">ctags</a> and <a href="http://www.vim.org/scripts/script.php?script_id=273" rel="noreferrer">taglist</a> plugins. You can move the cursor to a variable name and with a key combination it will take you to the declaration of the variable (and back). Taglist will also show an overview of all functions, classes etc. in a side bar. </p>\n'}, {'answer_id': 68259, 'author': 'James Sumners', 'author_id': 7979, 'author_profile': 'https://Stackoverflow.com/users/7979', 'pm_score': 3, 'selected': False, 'text': '<p>The <a href="http://www.eclipse.org/" rel="noreferrer">Eclipse</a> IDE is capable of working with C/C++ in addition to Java. There is a <a href="http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/index.html" rel="noreferrer">write-up</a> on how to configure Eclipse for C/C++ development on IBM\'s Developer Works site.</p>\n\n<p><em>edit:</em> Why has this been voted down? It is a valid answer. Eclipse with the C/C++ addon will allow the question author to do what he is wanting to do. I am not the only one to have suggested, yet the others have not been voted down. So why has this one been voted down?</p>\n'}, {'answer_id': 68261, 'author': 'Todd Gamblin', 'author_id': 9122, 'author_profile': 'https://Stackoverflow.com/users/9122', 'pm_score': 1, 'selected': False, 'text': '<p>If you\'re looking for something simple and ubiquitous, try <a href="http://www.linuxjournal.com/article/153" rel="nofollow noreferrer">etags</a>.  It\'s not going to be as good as the heavyweight tools, but it\'s on pretty much everything and it works with emacs.  Use ctags for vi.</p>\n'}, {'answer_id': 68262, 'author': 'Matt Gregory', 'author_id': 10577, 'author_profile': 'https://Stackoverflow.com/users/10577', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://www.vim.org" rel="nofollow noreferrer">Vim</a> and <a href="http://ctags.sourceforge.net/" rel="nofollow noreferrer">Ctags</a> works for me.</p>\n'}, {'answer_id': 68264, 'author': 'hoyhoy', 'author_id': 3499, 'author_profile': 'https://Stackoverflow.com/users/3499', 'pm_score': 0, 'selected': False, 'text': "<p>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. </p>\n"}, {'answer_id': 68267, 'author': 'HitScan', 'author_id': 9490, 'author_profile': 'https://Stackoverflow.com/users/9490', 'pm_score': 0, 'selected': False, 'text': '<p>I\'ve not used it directly, but I have used sites created with <a href="http://sourceforge.net/projects/lxr" rel="nofollow noreferrer">lxr</a> 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 <a href="http://lxr.linux.no/" rel="nofollow noreferrer">here</a>.</p>\n\n<p>It doesn\'t appear that there is a version newer than 2006, but it may still work for what you want.</p>\n'}, {'answer_id': 68284, 'author': 'DustinB', 'author_id': 7888, 'author_profile': 'https://Stackoverflow.com/users/7888', 'pm_score': 0, 'selected': False, 'text': '<p>I use Anjuta IDE.  Not bad.  Not sure how it compares to Eclipse IDE.</p>\n'}, {'answer_id': 68293, 'author': 'cunkel', 'author_id': 10649, 'author_profile': 'https://Stackoverflow.com/users/10649', 'pm_score': 3, 'selected': False, 'text': '<p><a href="http://www.doxygen.nl/" rel="nofollow noreferrer">Doxygen</a> 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.</p>\n'}, {'answer_id': 68315, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Any IDE will work fine.\nNetbeans and Eclipse are java based but have plugins for C/C++</p>\n'}, {'answer_id': 68367, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>I do a bit in the kernel space, and keep coming back the scope.</p>\n\n<p>For example:</p>\n\n<p>$ cd /usr/src/redhat/BUILD/kernel-version</p>\n\n<p>$ cscope -R -p4</p>\n\n<pre><code>   Find this C symbol:\n   Find this function definition:\n   Find functions called by this function:\n   Find functions calling this function:\n   Find this text string:\n   Change this text string:\n   Find this egrep pattern:\n   Find this file:\n   Find files #including this file:\n</code></pre>\n\n<p>I usually "live" in c-scope when working on someone elses project.  I use this to open files with "gvim" (my IDE), edit things, then quit "back" to c-scope,  It helps me keep task focused. </p>\n\n<p>I believe that cscope can be configured to work with vim and emacs, although I\'ve seen people use other editors also.</p>\n\n<p>Best of luck to you.</p>\n'}, {'answer_id': 68404, 'author': 'Luuk Paulussen', 'author_id': 10394, 'author_profile': 'https://Stackoverflow.com/users/10394', 'pm_score': 0, 'selected': False, 'text': '<p>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\n<a href="http://kscope.sourceforge.net/" rel="nofollow noreferrer">kscope homepage</a> has a good concise description of what it does and doesn\'t do.</p>\n'}, {'answer_id': 68833, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>cscope has always been my favorite. There is also cbrowser, but I have not tried it. ctags is also used a lot.</p>\n'}, {'answer_id': 69143, 'author': 'Leonard', 'author_id': 10888, 'author_profile': 'https://Stackoverflow.com/users/10888', 'pm_score': 1, 'selected': False, 'text': "<p>ctags is very useful. There are two steps involved. First run the program ctags on all your source and include directories. This creates a file named 'tags' in the local directory.  ctags *.c *.h would do fine if all your source is in a single directory. When you work with source in multiple directories, it can be worth running ctags in multiple locations.  Then, within vi, with your cursor on any function, defined type or variable use ctl-] to go to the definition of that entity.  Use etags if you're using emacs.</p>\n"}, {'answer_id': 70106, 'author': 'Laurent K', 'author_id': 2965, 'author_profile': 'https://Stackoverflow.com/users/2965', 'pm_score': 1, 'selected': False, 'text': '<p>I support the use of <a href="http://www.doxygen.nl/" rel="nofollow noreferrer">doxygen</a>.</p>\n\n<p>This tool generated a javadoc like bunch of html pages, allowing to index all the code, to browse in it (where is this function used, and by which function...), like you can do in an IDE. It is very easy to make it work.</p>\n\n<p>I had once to maintain 2000 files of C code of a 15 years old C project. It took me an hour to index the code with doxygen a provide the other developers with the generated doc. (I know, this phrase sounds like an add, but it is true... It\'s really a nice tool)</p>\n\n<p>A wonderful tool, which works on all C-like languages.</p>\n'}, {'answer_id': 70165, 'author': 'Igor Semenov', 'author_id': 11401, 'author_profile': 'https://Stackoverflow.com/users/11401', 'pm_score': 0, 'selected': False, 'text': '<p>I use the <a href="http://www.scitools.com/products/understand/" rel="nofollow noreferrer">Understand for C++</a>. It\'s very handy tool to deal with large amounts of code. It also can calculate code statistics and draw call graph.\nMust have!</p>\n'}, {'answer_id': 70998, 'author': 'Andrew Edgecombe', 'author_id': 11694, 'author_profile': 'https://Stackoverflow.com/users/11694', 'pm_score': 0, 'selected': False, 'text': "<p>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.</p>\n\n<p>This will automatically generate dependency maps and class diagrams that are linked to the rest of the html documentation.</p>\n"}, {'answer_id': 71010, 'author': 'prakash', 'author_id': 123, 'author_profile': 'https://Stackoverflow.com/users/123', 'pm_score': 0, 'selected': False, 'text': '<p>Even if you are not a developer go for <a href="http://www.sourceinsight.com/" rel="nofollow noreferrer"><strong>Source Insight</strong></a></p>\n\n<p>And if you are, its a MUST HAVE :)</p>\n'}, {'answer_id': 73516, 'author': 'Peter K.', 'author_id': 12570, 'author_profile': 'https://Stackoverflow.com/users/12570', 'pm_score': 1, 'selected': False, 'text': "<p>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).</p>\n"}, {'answer_id': 78697, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>cscope. (wanted to mod up other scope post, but i don't have karma yet).</p>\n\n<ul>\n<li>global search and replace</li>\n<li>find all places a function is called</li>\n<li>find all places called by a function</li>\n<li>find files including this file.</li>\n</ul>\n\n<p>really simple usage: $ cscope -R</p>\n\n<p>if you don't know vi, then change your EDITOR  and VIEWER environmental variables to your preferred editor.</p>\n"}, {'answer_id': 703559, 'author': 'sigjuice', 'author_id': 78720, 'author_profile': 'https://Stackoverflow.com/users/78720', 'pm_score': 0, 'selected': False, 'text': '<p>I find <a href="http://www.gnu.org/software/idutils/" rel="nofollow noreferrer">ID Utils</a> quite handy.  It is like an instant recursive grep.  There are bunch of vim recipes to go with it.</p>\n'}, {'answer_id': 832670, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Go for Doxygen and set EXTRACT_ALL to YES.  It is simply powerful and easy.  Once you love it, you can stick to it across all platforms and languages.</p>\n\n<p><a href="http://www.doxygen.org" rel="nofollow noreferrer">http://www.doxygen.org</a></p>\n'}, {'answer_id': 835936, 'author': 'bortzmeyer', 'author_id': 15625, 'author_profile': 'https://Stackoverflow.com/users/15625', 'pm_score': 0, 'selected': False, 'text': '<p>I use and like the free software tool <a href="http://www.gnu.org/software/global/" rel="nofollow noreferrer">GNU global</a>.</p>\n'}, {'answer_id': 1317019, 'author': 'Ira Baxter', 'author_id': 120163, 'author_profile': 'https://Stackoverflow.com/users/120163', 'pm_score': 0, 'selected': False, 'text': '<p>A language-sensitive source code search engine can be found\nat <a href="http://www.semanticdesigns.com/Products/SearchEngine" rel="nofollow noreferrer">SD Source Code Search Engine</a>.   It can handle many languages at the same time.\nSearches can be performed for patterns in a specific langauge,\nor patterns across languages (such as "find identifiers involving TAX").\nBy being sensitive to langauge tokens, the number of false positives is reduced,\nsaving time for the user.  It understands C, C++, C#, COBOL, Java, ECMAScript, Java, XML, Verilog, VHDL, and a number of other languages.</p>\n'}, {'answer_id': 1672132, 'author': 'Adrian', 'author_id': 21157, 'author_profile': 'https://Stackoverflow.com/users/21157', 'pm_score': 0, 'selected': False, 'text': '<p>I use Source-Navigator(TM) from <a href="http://sourcenav.sourceforge.net/" rel="nofollow noreferrer">here</a>. It is quite impressive and helps a lot. It is written in Tcl/Tk, is available as an executable for windows and as source code ready to build on *nix.</p>\n'}, {'answer_id': 5817664, 'author': 'Optimus84', 'author_id': 729173, 'author_profile': 'https://Stackoverflow.com/users/729173', 'pm_score': 1, 'selected': False, 'text': "<p>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.</p>\n"}]
['https://Stackoverflow.com/questions/68247', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']