Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find where a macro is defined in a project?

I have a project with dozens of source module and dozens header files, some are nested. Working with ARM's Eclipse for DS-5 I get an error indication from the Indexer but not from the compiler.

The IDE complains that the FALSE macro in one of the source modules of a static library is undefined. However, it does compile OK.

In a 2nd project on the same codebase (another static library) there is no such problem.

Searching through the whole workspace there are multiple definitions in multiple headers for this macro. How can I trace which specific definition is the one that takes effect in the code?

Note - I found this similar question regarding MSVS and a nice trick as an answer, but is there a direct way to achieve this in Eclipse?

like image 447
ysap Avatar asked Feb 03 '26 17:02

ysap


1 Answers

OK, I found the answer:

  1. Select the macro
  2. Right-click and select "Explore Macro Expansion" (or Ctrl+=)
  3. In the dialog window that opens, click the button at the bottom "Open Declaration"

The place of declaration now opens in the editor.

like image 194
ysap Avatar answered Feb 05 '26 07:02

ysap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!