Community
Participate
Working Groups
Build Identifier: 20100917-0705 I have the following situation: For each make target I have created a build configuration. Then I have different make targets. The first with define DEBUG_LEVEL=0 and the second with define DEBUG_LEVEL=2. What should happen is that when I make target one, the DEBUG_LEVEL=2 areas in the editor should be greyed out and when I make target two, the DEBUG_LEVEL=0 areas should be greyed out. The problem must be in the Scanner. In the file <workspace>/.metadata/.plugins/org.eclipse.cdt.make.core/<project_name>.sc I have the following scanner result: ... <definedSymbol symbol="DEBUG_LEVEL=2"/> <definedSymbol symbol="DEBUG_LEVEL=0"/> ... The scanner just adds the new scanner results on each run. What I would like to have is that the scanner throws away the old results and just uses the new ones. Or the scanner handles defines with values correctly by looking for the define names and if it already exists just replace the define values. Reproducible: Always
I think it is not really clear what I mean with make targets, sorry. The name of my build configuration matches a target in my Makefile. In eclipse in the "make target"-view I added several targets that point to ${ConfigName} with several different defines (e.g. DEBUG_LEVEL=2). ConfigName is an eclipse variable, that contains the build configuration name. Now I can start different configs in the eclipse "make target"-view for each build configuration. Everything is working fine, except the above explained scanner problems.
Do you use "per project" or "per file" Discovery Profile? "Per project" won't be able to handle that by nature as it just adds up to the project list not aware where existing entries came from. You can try "per file" but I am skeptical about it as well, probably the current design does not support that either.
I just tested "per file" Discovery Profile, but this also did not work. Do you have any suggestion for me? Is my setup that uncommon or do I have to configure Eclipse in a different way?
The problem is, that the new value of the symbol is just added and not replaced. It is in ScannerConfigUtil.java -> function scAddSymbolsList2SymbolEntryMap. There is a call to "rc |= sEntry.add(value, active);". But when does it make sense to add the new value and keep the old one?
There are 2 possible reasons I can think of. One is that for "per-project" type entries for all resources are accumulated in one storage per project. Another reason is that they are accumulated together to be displayed under "Includes" which displays all the include path entries for all resources.
Created attachment 182020 [details] cdt patch The attached change resolves the problem for me. It sets all "old/previous" symbol values to inactive. But I have problems to create a cdt deploy package.
Another solution could be, if the new define value is always inserted in the value list at index zero respectively moved to index zero. But I did not tested it yet. The problem is, that the editor does not know what areas to grey out if a define can have more than one value.
Are there any news on this? I'm really looking forward to find a proper solution for this issue. I hope the problem is clear: If a symbol can have more than one value, than it is not clear what code regions are active and what not.
We are moving toward a different approach for scanner discovery, see bug 290631. It should be easier to solve problems like this one with it. I plan to go over this and other tasks once the framework is in place, hopefully before CDT 8.0 is released.