Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Does CDT indexer use absolute or relative path?
Does CDT indexer use absolute or relative path? [message #218326] Tue, 01 July 2008 19:49 Go to next message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

Hi,

I built index for one project and exported it. The project source is
then moved to a different directory. When I tried to import the project
from the new location, the indexer started indexing again.

Does this mean that the indexer uses absolute path? And in order to
import a previously exported index, we should not move the project
source after exporting?

Thanks
Maggie
Re: Does CDT indexer use absolute or relative path? [message #218344 is a reply to message #218326] Wed, 02 July 2008 04:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nomail.for.you

I think is using absolute paths, I am unable to move my projects from one
computer to other one also.. I am waiting for an answer also or patch to
fix that.
Re: Does CDT indexer use absolute or relative path? [message #218368 is a reply to message #218326] Wed, 02 July 2008 09:06 Go to previous messageGo to next message
Eclipse UserFriend
Maggie wrote:
> Hi,
>
> I built index for one project and exported it. The project source is
> then moved to a different directory. When I tried to import the project
> from the new location, the indexer started indexing again.
>
> Does this mean that the indexer uses absolute path? And in order to
> import a previously exported index, we should not move the project
> source after exporting?
>
> Thanks
> Maggie

Please read the following thread on cdt-dev:
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg10527.html

HTH
--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Does CDT indexer use absolute or relative path? [message #218395 is a reply to message #218368] Wed, 02 July 2008 11:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

Hi Anton,

Thanks for the pointer. But it still doesn't answer my question. We did
build PDOM file and export the project. After exporting, we got the
..setting/cdt_index.zip under ${project_loc}.

If the ${project_loc} is /foo/bar/project_root, then importing the
project from this location, everything works fine. However, if the
project is moved from /foo/bar/project_root to /foo/bar/OLD/project_root
(as what usually happens with a nightly script), importing the project
from this location would trigger indexer.

Thus the assumption that the indexer uses /foo/bar/project_root and
treats resource under /foo/bar/OLD/project_root as unindexed sources.

Is this assumption true?

Thanks
Maggie

Anton Leherbauer wrote:
> Maggie wrote:
>> Hi,
>>
>> I built index for one project and exported it. The project source is
>> then moved to a different directory. When I tried to import the
>> project from the new location, the indexer started indexing again.
>>
>> Does this mean that the indexer uses absolute path? And in order to
>> import a previously exported index, we should not move the project
>> source after exporting?
>>
>> Thanks
>> Maggie
>
> Please read the following thread on cdt-dev:
> http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg10527.html
>
> HTH
Re: Does CDT indexer use absolute or relative path? [message #218440 is a reply to message #218395] Thu, 03 July 2008 04:27 Go to previous messageGo to next message
Eclipse UserFriend
Maggie wrote:
> Hi Anton,
>
> Thanks for the pointer. But it still doesn't answer my question. We did
> build PDOM file and export the project. After exporting, we got the
> .setting/cdt_index.zip under ${project_loc}.
>
> If the ${project_loc} is /foo/bar/project_root, then importing the
> project from this location, everything works fine. However, if the
> project is moved from /foo/bar/project_root to /foo/bar/OLD/project_root
> (as what usually happens with a nightly script), importing the project
> from this location would trigger indexer.
>
> Thus the assumption that the indexer uses /foo/bar/project_root and
> treats resource under /foo/bar/OLD/project_root as unindexed sources.

The feature would be quite useless if it used absolute paths.

I tried exactly that same scenario and it works for me.
Not a single file got reindexed.

Note that the indexer does check each file whether it seems to have
changed wrt the exported index.
This is done based on a checksum of the file contents.

HTH
--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Does CDT indexer use absolute or relative path? [message #218898 is a reply to message #218440] Tue, 08 July 2008 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

> Note that the indexer does check each file whether it seems to have
> changed wrt the exported index.
> This is done based on a checksum of the file contents.

This could be the case as the indexer finished much quicker than
indexing freshly.

Another 2 follow up questions:

1. In the scenario of a index was built and exported nightly, do users
have to import the project everyday to get the latest indexing information?

It appears that the PDOM file stays at the old time stamp. So I think
the answer is YES? Is there any good idea on how to make this importing
an automatic task?

2. After importing the project, the PDOM file was generated under the
new workspace pretty quick, but Eclipse spends a lot of time in
"Refreshing workspace". Especially if the workspace already has a couple
of big projects in it. And it seems the period is even longer if the
other projects were imported a few days back hence most of their
resources have newer time stamps now.

How can I make Eclipse just refresh the newly imported project instead
of the entire workspace?

Thanks
Maggie

Anton Leherbauer wrote:
> Maggie wrote:
>> Hi Anton,
>>
>> Thanks for the pointer. But it still doesn't answer my question. We
>> did build PDOM file and export the project. After exporting, we got
>> the .setting/cdt_index.zip under ${project_loc}.
>>
>> If the ${project_loc} is /foo/bar/project_root, then importing the
>> project from this location, everything works fine. However, if the
>> project is moved from /foo/bar/project_root to
>> /foo/bar/OLD/project_root (as what usually happens with a nightly
>> script), importing the project from this location would trigger indexer.
>>
>> Thus the assumption that the indexer uses /foo/bar/project_root and
>> treats resource under /foo/bar/OLD/project_root as unindexed sources.
>
> The feature would be quite useless if it used absolute paths.
>
> I tried exactly that same scenario and it works for me.
> Not a single file got reindexed.
>
> Note that the indexer does check each file whether it seems to have
> changed wrt the exported index.
> This is done based on a checksum of the file contents.
>
> HTH
Re: Does CDT indexer use absolute or relative path? [message #218978 is a reply to message #218898] Wed, 09 July 2008 04:45 Go to previous messageGo to next message
Eclipse UserFriend
Maggie wrote:
> 1. In the scenario of a index was built and exported nightly, do users
> have to import the project everyday to get the latest indexing information?
>
> It appears that the PDOM file stays at the old time stamp. So I think
> the answer is YES? Is there any good idea on how to make this importing
> an automatic task?

The imported PDOM is used as a normal index, ie. it gets updated with
changed files, etc as usual. There is no need to import it every day.

> 2. After importing the project, the PDOM file was generated under the
> new workspace pretty quick, but Eclipse spends a lot of time in
> "Refreshing workspace". Especially if the workspace already has a couple
> of big projects in it. And it seems the period is even longer if the
> other projects were imported a few days back hence most of their
> resources have newer time stamps now.
>
> How can I make Eclipse just refresh the newly imported project instead
> of the entire workspace?

When a project is imported only this project gets refreshed, although
the progress message says "Refreshing workspace".

Toni
--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Does CDT indexer use absolute or relative path? [message #219033 is a reply to message #218978] Wed, 09 July 2008 14:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

Anton Leherbauer wrote:
> Maggie wrote:
>> 1. In the scenario of a index was built and exported nightly, do users
>> have to import the project everyday to get the latest indexing
>> information?
>>
>> It appears that the PDOM file stays at the old time stamp. So I think
>> the answer is YES? Is there any good idea on how to make this
>> importing an automatic task?
>
> The imported PDOM is used as a normal index, ie. it gets updated with
> changed files, etc as usual. There is no need to import it every day.

In my experiment, when the resource is changed, I only see a dialog
asking "The file has been changed on the file system. Do you want to
load the changes?". After I click "Yes" the new file is loaded but no
indexer activity and the time stamp on the PDOM file stays the same.

In Windows->Preferences->C/C++->Indexer setting, both "Automatically
update the index" and "Update index immediately after every file-change"
are checked.

However, if I check "Index all file (files neither built not included,
also)" which was not checked by default, the indexer started. But it
took the indexer 40 mins to complete after a simple change like adding a
new function in 3 files (definition in .h, declaration in one .c and
calling it in another .c). Note that the indexing from ground zero for
the same project took 1 - 1.5 hour. Is this expected or I may have
missed something?

Another thing is that we disabled the builders for the project. Could
this make the indexer less efficient?


>
>> 2. After importing the project, the PDOM file was generated under the
>> new workspace pretty quick, but Eclipse spends a lot of time in
>> "Refreshing workspace". Especially if the workspace already has a
>> couple of big projects in it. And it seems the period is even longer
>> if the other projects were imported a few days back hence most of
>> their resources have newer time stamps now.
>>
>> How can I make Eclipse just refresh the newly imported project instead
>> of the entire workspace?
>
> When a project is imported only this project gets refreshed, although
> the progress message says "Refreshing workspace".

Thanks for the confirmation. But what could be cause of time variation
we see when importing the same project to different workspace. The
importing/refreshing could take 5 minutes to over 20 for the same
project in different workspace. That doesn't sounds normal to me.

Thanks
Maggie

>
> Toni
Re: Does CDT indexer use absolute or relative path? [message #219119 is a reply to message #219033] Thu, 10 July 2008 04:07 Go to previous messageGo to next message
Eclipse UserFriend
Maggie wrote:
> Anton Leherbauer wrote:
>> Maggie wrote:
>>> 1. In the scenario of a index was built and exported nightly, do
>>> users have to import the project everyday to get the latest indexing
>>> information?
>>>
>>> It appears that the PDOM file stays at the old time stamp. So I think
>>> the answer is YES? Is there any good idea on how to make this
>>> importing an automatic task?
>>
>> The imported PDOM is used as a normal index, ie. it gets updated with
>> changed files, etc as usual. There is no need to import it every day.
>
> In my experiment, when the resource is changed, I only see a dialog
> asking "The file has been changed on the file system. Do you want to
> load the changes?". After I click "Yes" the new file is loaded but no
> indexer activity and the time stamp on the PDOM file stays the same.

It is normal that the timestamp of the PDOM file does not change,
because the timestamp is only updated when the file is closed.
At least this is the case on Windows.

> In Windows->Preferences->C/C++->Indexer setting, both "Automatically
> update the index" and "Update index immediately after every file-change"
> are checked.
>
> However, if I check "Index all file (files neither built not included,
> also)" which was not checked by default, the indexer started. But it
> took the indexer 40 mins to complete after a simple change like adding a
> new function in 3 files (definition in .h, declaration in one .c and
> calling it in another .c). Note that the indexing from ground zero for
> the same project took 1 - 1.5 hour. Is this expected or I may have
> missed something?

This would indicate that many files were not indexed before enabling
"index all files". I don't think a small change alone would make the
indexer run for 40 minutes.
BTW, you can check whether a file is indexed or not by enabling the
label decorator "C/C++ Indexed Files" in the Preferences.
This decorator marks indexed files in the Project Explorer by adding a
tiny dot on the file icon.

> Another thing is that we disabled the builders for the project. Could
> this make the indexer less efficient?

No.

>
>>
>>> 2. After importing the project, the PDOM file was generated under the
>>> new workspace pretty quick, but Eclipse spends a lot of time in
>>> "Refreshing workspace". Especially if the workspace already has a
>>> couple of big projects in it. And it seems the period is even longer
>>> if the other projects were imported a few days back hence most of
>>> their resources have newer time stamps now.
>>>
>>> How can I make Eclipse just refresh the newly imported project
>>> instead of the entire workspace?
>>
>> When a project is imported only this project gets refreshed, although
>> the progress message says "Refreshing workspace".
>
> Thanks for the confirmation. But what could be cause of time variation
> we see when importing the same project to different workspace. The
> importing/refreshing could take 5 minutes to over 20 for the same
> project in different workspace. That doesn't sounds normal to me.

That's hard to tell without knowing the details.
In general, a larger workspace is slower, esp. when the Java heap size
gets at its limit.

--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Does CDT indexer use absolute or relative path? [message #219251 is a reply to message #219119] Thu, 10 July 2008 20:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: maggie.eclipse.gmail.com

>> BTW, you can check whether a file is indexed or not by enabling the
>> label decorator "C/C++ Indexed Files" in the Preferences.
>> This decorator marks indexed files in the Project Explorer by adding a
>> tiny dot on the file icon.

Thanks for the tip. But it seems this is new in Ganymede unless I looked
at the wrong place in Europa.

Maggie

Anton Leherbauer wrote:
> Maggie wrote:
>> Anton Leherbauer wrote:
>>> Maggie wrote:
>>>> 1. In the scenario of a index was built and exported nightly, do
>>>> users have to import the project everyday to get the latest indexing
>>>> information?
>>>>
>>>> It appears that the PDOM file stays at the old time stamp. So I
>>>> think the answer is YES? Is there any good idea on how to make this
>>>> importing an automatic task?
>>>
>>> The imported PDOM is used as a normal index, ie. it gets updated with
>>> changed files, etc as usual. There is no need to import it every day.
>>
>> In my experiment, when the resource is changed, I only see a dialog
>> asking "The file has been changed on the file system. Do you want to
>> load the changes?". After I click "Yes" the new file is loaded but no
>> indexer activity and the time stamp on the PDOM file stays the same.
>
> It is normal that the timestamp of the PDOM file does not change,
> because the timestamp is only updated when the file is closed.
> At least this is the case on Windows.
>
>> In Windows->Preferences->C/C++->Indexer setting, both "Automatically
>> update the index" and "Update index immediately after every
>> file-change" are checked.
>>
>> However, if I check "Index all file (files neither built not included,
>> also)" which was not checked by default, the indexer started. But it
>> took the indexer 40 mins to complete after a simple change like adding
>> a new function in 3 files (definition in .h, declaration in one .c and
>> calling it in another .c). Note that the indexing from ground zero for
>> the same project took 1 - 1.5 hour. Is this expected or I may have
>> missed something?
>
> This would indicate that many files were not indexed before enabling
> "index all files". I don't think a small change alone would make the
> indexer run for 40 minutes.
> BTW, you can check whether a file is indexed or not by enabling the
> label decorator "C/C++ Indexed Files" in the Preferences.
> This decorator marks indexed files in the Project Explorer by adding a
> tiny dot on the file icon.
>
>> Another thing is that we disabled the builders for the project. Could
>> this make the indexer less efficient?
>
> No.
>
>>
>>>
>>>> 2. After importing the project, the PDOM file was generated under
>>>> the new workspace pretty quick, but Eclipse spends a lot of time in
>>>> "Refreshing workspace". Especially if the workspace already has a
>>>> couple of big projects in it. And it seems the period is even longer
>>>> if the other projects were imported a few days back hence most of
>>>> their resources have newer time stamps now.
>>>>
>>>> How can I make Eclipse just refresh the newly imported project
>>>> instead of the entire workspace?
>>>
>>> When a project is imported only this project gets refreshed, although
>>> the progress message says "Refreshing workspace".
>>
>> Thanks for the confirmation. But what could be cause of time variation
>> we see when importing the same project to different workspace. The
>> importing/refreshing could take 5 minutes to over 20 for the same
>> project in different workspace. That doesn't sounds normal to me.
>
> That's hard to tell without knowing the details.
> In general, a larger workspace is slower, esp. when the Java heap size
> gets at its limit.
>
Re: Does CDT indexer use absolute or relative path? [message #219303 is a reply to message #219251] Fri, 11 July 2008 04:49 Go to previous message
Eclipse UserFriend
Maggie wrote:
>>> BTW, you can check whether a file is indexed or not by enabling the
>>> label decorator "C/C++ Indexed Files" in the Preferences.
>>> This decorator marks indexed files in the Project Explorer by adding
>>> a tiny dot on the file icon.
>
> Thanks for the tip. But it seems this is new in Ganymede unless I looked
> at the wrong place in Europa.
>

That's right. It is new in Ganymede.
Previous Topic:CDT Hangs with large project
Next Topic:Problem Browsing Imported C++ Source
Goto Forum:
  


Current Time: Fri Jul 18 17:56:22 EDT 2025

Powered by FUDForum. Page generated in 0.31581 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top