Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev]Questionabout ICSettingEntry.INCLUDE_FILEandICSettingEntry.MACRO_FILE

I see the problem now.  I had the indexer turned off for the project.
So the file itself was found but the buffer for it was empty because it
couldn't locate the file in the index.  

After digging around in the code a bit, I found that I could turn on the
"Follow unindexed header files when producing the outline view" option
in the C/C++ preference page, and then it would parse the macro file
correctly.

Is this the expected behavior?  Perhaps we should change the label in
the pref to be more explicit?  Or maybe that should be the default
behavior when the indexer is disabled?

Thanks,
Warren
 

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of ext Schorn, Markus
Sent: Wednesday, October 17, 2007 1:46 AM
To: CDT General developers list.
Subject: RE: [cdt-dev]Questionabout
ICSettingEntry.INCLUDE_FILEandICSettingEntry.MACRO_FILE

Hi Warren,
most likely the problem is that the files you are specifying are not
found on the include search path. The difference between macro- and
include-files is that macro files are preprocessed only (i.e. macro
definitions are extracted) whereas include files are actually parsed
(i.e declarations are extracted also).
These options should work just like the gcc's -imacro and -include
commandline options.

Markus.

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of 
> Warren.Paul@xxxxxxxxx
> Sent: Dienstag, 16. Oktober 2007 19:04
> To: cdt-dev@xxxxxxxxxxx
> Subject: RE: [cdt-dev]Questionabout
> ICSettingEntry.INCLUDE_FILEandICSettingEntry.MACRO_FILE
> Importance: Low
> 
> OK, I'm printing out all of the macros to the console at the end of 
> DOMScanner constructor but FOO is not there.  Only the macros I'm 
> returning from my CLanguageData implementation of getEntries when 
> asked for ICLanguageSettingEntry.MACRO.
> 
> Is there any way to specify these in the UI for regular CDT projects 
> so I can test it that way?
> 
> Thanks,
> Warren
> 
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of ext Mike Kucera
> Sent: Tuesday, October 16, 2007 11:18 AM
> To: CDT General developers list.
> Subject: RE: [cdt-dev] Questionabout
> ICSettingEntry.INCLUDE_FILEandICSettingEntry.MACRO_FILE
> 
> The macro definitions are stored in the 'definitions' 
> instance variable.
> You could place a breakpoint at the end of the DOMScanner constructor 
> and inspect the keyTable member of the definitions object, this should

> contain the names of all the macros the preprocessor is aware of. The 
> keyTable can get big so it might be easier to add a bit of code that 
> displays the contents of definitions to the console.
> 
> Mike Kucera
> Software Developer
> IBM CDT Team, Toronto
> mkucera@xxxxxxxxxx
> 
> 
>  
> 
>              <Warren.Paul@noki
> 
>              a.com>
> 
>              Sent by:
> To 
>              cdt-dev-bounces@e         <cdt-dev@xxxxxxxxxxx>
> 
>              clipse.org
> cc
>  
> 
>  
> Subject 
>              10/16/2007 11:39          RE: [cdt-dev] Question about
> 
>              AM
> ICSettingEntry.INCLUDE_FILEandICSet 
>                                        tingEntry.MACRO_FILE
> 
>  
> 
>              Please respond to
> 
>                "CDT General
> 
>              developers list."
> 
>              <cdt-dev@eclipse.
> 
>                    org>
> 
>  
> 
>  
> 
> 
> 
> 
> 
> I can tell you that
> org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner.exte
> ndedScanne
> rInfoSetup(CodeReader,
>  IScannerInfo) gets back the include and macro files correctly and 
> appears to parse them (pushContext is called).  Where do I set a 
> breakpoint so I can actually see the list of macros the parser is 
> using?
> 
> Also, I thought I'd try to reproduce this with a regular make project 
> but I didn't see any UI to specify an include or macro file.
> BTW, what
> exactly is the difference between the two?  A macro file is a header 
> but is only allowed to include macros or something?
> 
> Thanks,
> Warren
> 
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of ext Schorn, Markus
> Sent: Tuesday, October 16, 2007 2:37 AM
> To: CDT General developers list.
> Subject: RE: [cdt-dev] Question about
> ICSettingEntry.INCLUDE_FILEandICSettingEntry.MACRO_FILE
> 
> Yes, this should work. The scanner is configured by means of an 
> IScannerInfo object. Please check whether it contains the macro 
> definition or not.
> Markus.
>  From: cdt-dev-bounces@xxxxxxxxxxx
> [mailto:cdt-dev-bounces@xxxxxxxxxxx]
> On  Behalf Of Warren.Paul@xxxxxxxxx
>  Sent: Dienstag, 16. Oktober 2007 00:08
>  To: cdt-dev@xxxxxxxxxxx
>  Subject: [cdt-dev] Question about ICSettingEntry.INCLUDE_FILE 
> andICSettingEntry.MACRO_FILE
>  Importance: Low
> 
> 
> 
>  I want to define some macros in a file and have the CDT parsers use 
> those  macros when parsing source code.  I tried a simple test, 
> returning a new  CIncludeFileEntry and CMacroFileEntry from my 
> CLanguageData#getEntries  implementation.  I construct those with a 
> full path to a simple header  file in my project.  The header just
> contains:
> 
> 
>  #define FOO 1
> 
> 
>  In a source file if have something like:
> 
> 
>  #ifdef FOO
>  #include <foo.h>
>  #endif
> 
> 
>  But when I open that source file in the editor, the ifdef is grayed 
> out,  indicating that FOO is not defined.  I stepped through the code 
> enough to  know that my end of the code is working correctly (at least

> it appears to  be).  But the BaseScanner code loses me.  Am I missing 
> something?
> Should
>  this work?
> 
> 
>  Thanks,
>  Warren _______________________________________________
>  cdt-dev mailing list
>  cdt-dev@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
> 
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top