Are there any context-sensitive code search tools?

Posted by Vicky on Stack Overflow See other posts from Stack Overflow or by Vicky
Published on 2010-05-20T10:42:13Z Indexed on 2010/05/20 11:00 UTC
Read the original article Hit count: 184

Filed under:
|
|

I have been getting very frustrated recently in dealing with a massive bulk of legacy code which I am trying to get familiar with.

Say I try to search for a particular function call, I get loads of results that turn out to be completely irrelevant; some of them are easy to spot, eg a comment saying

// Fixed functionality in foo() so don't need to handle this here any more

But others are much harder to spot manually, because they turn out to be calls from other functions in modules that are only compiled in certain cases, or are part of a much larger block of code that is #if 0'd out in its entirety.

What I'd like would be a search tool that would allow me to search for a term and give me the choice to include or exclude commented out or #if 0'd out code. Then the search results would be displayed alongside a list of #defines that are required in order for that snippet of code to be relevant.

I'm working in C / C++, but other than the specific comment syntax I guess the techniques should be more generally applicable.

Does such a tool exist?

© Stack Overflow or respective owner

Related posts about search

Related posts about context