I'm looking for a tool that can do semantic search in a body of C code.
Example query: "give me all references to field y in struct x defined in file
z.h". I would prefer an open source, command line driven tool. C++ support is
an advantage. Is there such a tool other than cscope?
cscope doesn't preserve the type of tags. In hostapd for example there are more than 900 references to the tag "ifname". However, I'm only interested in the ifname field of a specific struct. cscope can't filter tags according to type.
cscope. If you don't want to use cscope, it would help to explain why. Otherwise you risk getting answers about tools similar to cscope. – sleske May 14 '12 at 8:02Elsaas such a tool, but of course there is no ready to use query language, you have to code your searches in C++. Another, more recent option isClang(eitherlibclang, or clang with xml output, if you grab an older version). – SK-logic May 14 '12 at 8:48