This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Which include paths to search?


Hi all,

During my testing of the source window I have found that the parser is not getting passed any paths to search for the "#include"s that are in a file. As a consequence, some errors were being reported and some of the code was not being marked correctly for the highlighting.

Now, the question comes in which paths to pass to the parser. The obvious ones are of course "/usr/include" and "/usr/local/include"(at least on the limited systems I'm familiar they are), but the less obvious one is the arch-specific path which, on an x86-32 is: "/usr/lib/gcc/i386-redhat-linux/4.1.1/include". This path can be gotten using the "gcc -print-file-name=include" command.

All paths used by the gcc compiler can be gotten with the "gcc -v progname.c" command which outputs something like this:

Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
/usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -quiet -v stan_looper.c -quiet -dumpbase stan_looper.c -mtune=generic -auxbase stan_looper -g -version -o /tmp/ccRQRXDX.s
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i386-redhat-linux/4.1.1/include
/usr/include
End of search list.
.
.
.



So, the question is, what is the best way to get the "include" paths into the parameters used to invoke the CDTParser on a particular source file. The above methods could be used during "build" time to create a file containing the paths that could be read when the CDTParser is invoked, but that seems fraught with possible problems. We are accessing the debuginfo on the file, so I am hoping there is some way to determine the proper include paths at runtime from some information stored in there.


Does anyone know of a better way of doing this? I'm wide open for suggestions.

Thanks,

Rick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]