Home » Language IDEs » C / C++ IDE (CDT) » OK, I give - how do I make indexing work?
OK, I give - how do I make indexing work? [message #154262] |
Thu, 15 September 2005 11:05  |
Eclipse User |
|
|
|
Using Eclipse 3.1 + CDT 3.0 on Windows (I get the same behavior under
Linux as well).
I have a large, pre-existing project (thousands of files) that I am
trying to incorporate Eclipse into. So far, I've managed to get basic
development and source-level debugging working, but I can't get any of
the following search-related features to work:
Open Definition
Open Declaration
All Declarations
All References
All References will only find references within the file I am currently
editing, but no where else. All of the other functions return nothing.
All of the involved source files and headers are within the project.
I've tried explicitly setting include paths, source paths and binary
paths all to no effect. I've tried automatic discovery of paths and
symbols and CTags vs Full Indexing. I've tried recreating the project in
a variety of different ways - all to no avail.
At this point, I'm looking at the CDT source code trying to figure out
how the indexer works, but it sure would be nice if someone in the know
could write a document on getting this to work with REAL WORLD projects
beyond the simplistic Hello, World examples in the current docs.
|
|
|
Re: OK, I give - how do I make indexing work? [message #154345 is a reply to message #154262] |
Thu, 15 September 2005 12:47   |
Eclipse User |
|
|
|
Originally posted by: dschaefer.qnx.com
Keath Milligan wrote:
> Using Eclipse 3.1 + CDT 3.0 on Windows (I get the same behavior under
> Linux as well).
>
> I have a large, pre-existing project (thousands of files) that I am
> trying to incorporate Eclipse into. So far, I've managed to get basic
> development and source-level debugging working, but I can't get any of
> the following search-related features to work:
>
> Open Definition
> Open Declaration
> All Declarations
> All References
>
> All References will only find references within the file I am currently
> editing, but no where else. All of the other functions return nothing.
>
> All of the involved source files and headers are within the project.
> I've tried explicitly setting include paths, source paths and binary
> paths all to no effect. I've tried automatic discovery of paths and
> symbols and CTags vs Full Indexing. I've tried recreating the project in
> a variety of different ways - all to no avail.
>
> At this point, I'm looking at the CDT source code trying to figure out
> how the indexer works, but it sure would be nice if someone in the know
> could write a document on getting this to work with REAL WORLD projects
> beyond the simplistic Hello, World examples in the current docs.
Yes, a document is desperately needed. Dealing with large legacy
projects is definitely a challenge that we have. I have been able to get
things to work with the Mozilla source code using the scanner discovery.
It has around 16000 files.
It sounds like you are doing the right things with telling the CDT about
the paths. Did you try per file scanner discovery. I seem to have better
results with that. Also, the scanner discovery works by parsing the
build output. If your makefile hides the commands (such as the Linux
kernel 2.6 does) it won't work.
Hope this helps,
Doug
|
|
|
Re: OK, I give - how do I make indexing work? [message #154353 is a reply to message #154262] |
Thu, 15 September 2005 13:35   |
Eclipse User |
|
|
|
Keath Milligan wrote:
> Using Eclipse 3.1 + CDT 3.0 on Windows (I get the same behavior under
> Linux as well).
>
> I have a large, pre-existing project (thousands of files) that I am
> trying to incorporate Eclipse into. So far, I've managed to get basic
> development and source-level debugging working, but I can't get any of
> the following search-related features to work:
>
> Open Definition
> Open Declaration
> All Declarations
> All References
>
> All References will only find references within the file I am currently
> editing, but no where else. All of the other functions return nothing.
>
> All of the involved source files and headers are within the project.
> I've tried explicitly setting include paths, source paths and binary
> paths all to no effect. I've tried automatic discovery of paths and
> symbols and CTags vs Full Indexing. I've tried recreating the project in
> a variety of different ways - all to no avail.
>
> At this point, I'm looking at the CDT source code trying to figure out
> how the indexer works, but it sure would be nice if someone in the know
> could write a document on getting this to work with REAL WORLD projects
> beyond the simplistic Hello, World examples in the current docs.
One thing you *might* try...
If you open your Project Properties window and go to the C/C++ Include
Paths and Symbols, you'll see all the paths to your include files, both
discovered and explicit.
Among the explicit include paths are two types: Internal and External.
Internal paths are those that are part of the project. External paths
are those outside the project. However, you can create an External path
to a directory that is actually inside the project.
There was a time when creating an Internal include path to a directory
wouldn't work, but creating an External include path to the very same
directory *did* work. This has presumably been fixed and will no longer
help you. But, you might want to try it. My admittedly
less-than-definitive experiments suggest that this still may be an issue.
FWIW. YMMV.
|
|
|
Re: OK, I give - how do I make indexing work? [message #154464 is a reply to message #154345] |
Thu, 15 September 2005 18:48   |
Eclipse User |
|
|
|
Doug Schaefer wrote:
> Yes, a document is desperately needed. Dealing with large legacy
> projects is definitely a challenge that we have. I have been able to get
> things to work with the Mozilla source code using the scanner discovery.
> It has around 16000 files.
>
> It sounds like you are doing the right things with telling the CDT about
> the paths. Did you try per file scanner discovery. I seem to have better
> results with that. Also, the scanner discovery works by parsing the
> build output. If your makefile hides the commands (such as the Linux
> kernel 2.6 does) it won't work.
>
> Hope this helps,
> Doug
Well, after some wrangling, I've managed to get CTags indexing at least
partially working. I'd still like to have full cross-referencing
ability, but we'll take what we can get for now.
Depending on the make output to do this seems really naive to me, but
even after modifying the build to echo its compile commands, I'm still
not having much luck.
One thing that might be nice would some way to have an external script
generate the data the indexer needs. This could be configured as a
builder and it could deal with the complexities of the given build tree.
The current approach just doesn't cut it for real projects.
|
|
|
Re: OK, I give - how do I make indexing work? [message #154496 is a reply to message #154464] |
Thu, 15 September 2005 20:55   |
Eclipse User |
|
|
|
Originally posted by: fireonyoursleeve.hotmail.com
I'm kind of curious why the indexer relies so heavily on gcc output in the
first place. What do systems like SourceInsight do for their c/c++
indexing? Makes it quite annoying if you wish to use CDT with non-gnu
tools.
"Keath Milligan" <keath@keathmilligan.net> wrote in message
news:dgctn3$hq2$1@news.eclipse.org...
> Doug Schaefer wrote:
>> Yes, a document is desperately needed. Dealing with large legacy projects
>> is definitely a challenge that we have. I have been able to get things to
>> work with the Mozilla source code using the scanner discovery. It has
>> around 16000 files.
>>
>> It sounds like you are doing the right things with telling the CDT about
>> the paths. Did you try per file scanner discovery. I seem to have better
>> results with that. Also, the scanner discovery works by parsing the build
>> output. If your makefile hides the commands (such as the Linux kernel 2.6
>> does) it won't work.
>>
>> Hope this helps,
>> Doug
>
> Well, after some wrangling, I've managed to get CTags indexing at least
> partially working. I'd still like to have full cross-referencing ability,
> but we'll take what we can get for now.
>
> Depending on the make output to do this seems really naive to me, but even
> after modifying the build to echo its compile commands, I'm still not
> having much luck.
>
> One thing that might be nice would some way to have an external script
> generate the data the indexer needs. This could be configured as a builder
> and it could deal with the complexities of the given build tree.
>
> The current approach just doesn't cut it for real projects.
|
|
|
Re: OK, I give - how do I make indexing work? [message #154503 is a reply to message #154496] |
Thu, 15 September 2005 22:57   |
Eclipse User |
|
|
|
Originally posted by: dschaefer.qnx.com
Aaron Leiby wrote:
> I'm kind of curious why the indexer relies so heavily on gcc output in the
> first place. What do systems like SourceInsight do for their c/c++
> indexing? Makes it quite annoying if you wish to use CDT with non-gnu
> tools.
Well, I'm definitely looking at ways to make the index less dependent on
build settings. ctags, for example, doesn't need any and this is most
likely what SourceInsight uses for it's info. But ctags does not give
you cross reference information. You need a more complex parser for that.
Doug
>
> "Keath Milligan" <keath@keathmilligan.net> wrote in message
> news:dgctn3$hq2$1@news.eclipse.org...
>
>>Doug Schaefer wrote:
>>
>>>Yes, a document is desperately needed. Dealing with large legacy projects
>>>is definitely a challenge that we have. I have been able to get things to
>>>work with the Mozilla source code using the scanner discovery. It has
>>>around 16000 files.
>>>
>>>It sounds like you are doing the right things with telling the CDT about
>>>the paths. Did you try per file scanner discovery. I seem to have better
>>>results with that. Also, the scanner discovery works by parsing the build
>>>output. If your makefile hides the commands (such as the Linux kernel 2.6
>>>does) it won't work.
>>>
>>>Hope this helps,
>>>Doug
>>
>>Well, after some wrangling, I've managed to get CTags indexing at least
>>partially working. I'd still like to have full cross-referencing ability,
>>but we'll take what we can get for now.
>>
>>Depending on the make output to do this seems really naive to me, but even
>>after modifying the build to echo its compile commands, I'm still not
>>having much luck.
>>
>>One thing that might be nice would some way to have an external script
>>generate the data the indexer needs. This could be configured as a builder
>>and it could deal with the complexities of the given build tree.
>>
>>The current approach just doesn't cut it for real projects.
>
>
>
|
|
| |
Re: OK, I give - how do I make indexing work? [message #155331 is a reply to message #154353] |
Wed, 28 September 2005 15:33  |
Eclipse User |
|
|
|
Originally posted by: james.b.jensen.office.xerox.com
I also have been trying to use Eclipse 3.1.0 and CDT 3.0.0 on a 'real'
project. The project is managed using clearcase. I am trying to setup
eclipse to at least see and index the current project. Eclipse refuses to
use any path information that I set "internal" or "external". If I use
the package explorer and do a "new" "folder" and set it to use existing, I
can see all of the contents of a directory. When I try to set a path
using any method, it shows up in the "Includes" folder, but is empty, and
the indexer still can't find anything.
Anybody had any success seting include paths without building?
Also, I have 50-100 included directories due to the way we use make
recusively to build subdirectories. It would sure be nice to be able to
set paths from a file, or have some kind of recursive path where you can
point it at the parent and let it find all of the headers down lower.
|
|
|
Goto Forum:
Current Time: Wed Jun 18 02:28:04 EDT 2025
Powered by FUDForum. Page generated in 0.05136 seconds
|