3

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?

Community
  • 1
  • 1
ysap
  • 7,723
  • 7
  • 59
  • 122
  • What's wrong with: find -name '*.h' -exec grep -h define.*FALSE {} \; :) – Brian McFarland Jul 07 '15 at 14:41
  • @BrianMcFarland - Is this Eclipse? Is this Windows compatible? – ysap Jul 07 '15 at 14:48
  • @BrianMcFarland - also, does this find the specific definition applicable to a specific reference? I don't think so. – ysap Jul 07 '15 at 14:49
  • No, No, and No. It was a joke, hence the `:)`, though I can see how that got lost among the `{} \;` – Brian McFarland Jul 07 '15 at 14:57
  • In all seriousness though, I rarely run across a question of the form "how to find X where Y?" or "how to find where X is Y?" that cannot be solved by `find`, `grep` and a few other similar tools. Faster than your eclipse solution? Probably not. Faster than googling & posting on SO to *find* the eclipse solution? definitely. As for windows, that's what `cygwin` is for. – Brian McFarland Jul 07 '15 at 15:01
  • 1
    @BrianMcFarland - `:)` point taken... As for Cygwin - do you count the time of downloading/installing/learning/using in your timing benchmark ;-). Anyway - as I mentioned in the previous comment, when there are multiple definitions across nested headers, then figuring the specific definitions using `grep` can become a serious PITA. – ysap Jul 07 '15 at 15:30
  • @BrianMcFarland - oh, and BTW, you don't install Eclipse to *find* that reference. You are *working* in Eclipse environment already, and using its tools is probably the fastest, and most native way to find the answer. – ysap Jul 07 '15 at 15:31

1 Answers1

5

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.

ysap
  • 7,723
  • 7
  • 59
  • 122