问题
In Eclipse CDT, How can I see all the macros defined in all the source files under a given directory tree? I don't want to see any macros that are defined in include files that exist outside the given directory tree.
In 'Open Element' dialog (Ctrl+Shift+T), I can uncheck all element types, check only the "Macro" type and then search for '*'. This would show all the macros from the index. There is no control to further filter it based on a "selected resource".
回答1:
I found the answer to this one.
- Click on the directory in the Project Explorer on which you want to perform the search recursively.
- Hit Ctrl+H to get the Search dialog. Go to the 'C/C++ Search' tab.
- In 'Search For' box, uncheck 'Any Element' and check 'Macro'.
- In 'Limit To' box, uncheck 'All Occurrences' and check '"Definitions'.
- In 'Scope' box, select 'Selected resources'.
- Set the search string to '*' (without quotes).
- Finally, hit the 'Search' button.
来源:https://stackoverflow.com/questions/13409010/eclpise-cdt-view-all-macros-defined-in-source-code-in-a-given-directory