|
From: | Shigio YAMAGUCHI |
Subject: | Re: GTAGSLIBPATH definition search |
Date: | Wed, 25 Feb 2015 19:03:38 +0900 |
Hi,
Yes, of course.
Here is what I do (* is command, > is output) :
* global --version
> global (GNU GLOBAL) 6.3.4
* cd /usr/include
* sudo gtags -c
* cd ~/workspace/project/
* gtags -c
* export GTAGSLIBPATH=/usr/include
* global -dxMT resolve
> Warning: source file './boost/asio/detail/resolver_service.hpp' is not available.
> resolve 59 ../../../../usr/include/boost/asio/detail/resolver_service.hpp
> resolve 91 ../../../../usr/include/boost/asio/detail/resolver_service.hpp
There are several other matches but I have omitted them to keep things concise and clear. The pattern is the same - Warning about './boost/....' file not available and match results for '../../../../usr/include/boost/....'.
* cat ../../../../usr/include/boost/asio/detail/resolver_service.hpp
Works just fine, the file opens without problems.
I also tried creating library DB in another folder without sudo:
* (pwd = /usr/include) gtags -c ~/temp
* export GTAGSLIBPATH=~/temp
The result is a bit weird, the relative file path in the match is relative to the location of the library DB (~/temp in this case):
> Warning: source file './boost/asio/detail/resolver_service.hpp' is not available.
> resolve 59 ../../temp/boost/asio/detail/resolver_service.hpp
> resolve 91 ../../temp/boost/asio/detail/resolver_service.hpp
Logically,
'../../temp/boost/asio/detail/resolver_service.hpp'
doesn't exist.
I also see that if I create DB for the project in another folder, let's say I do
* (pwd = ~/workspace/project) gtags -c ~/temp
then I need to set GTAGSROOT to the project root and GTAGSDBPATH to the DB path to be able to use global successfully.
Is it possible to store the GTAGSROOT in the DB file itself (the project root is known at DB creation time)?
Is it also possible to make a command line option to global to specify DB path (instead of using GTAGSDBPATH)? For example --gtagsdbpath=<path>.
This will be useful if you have several projects and you make DB files for all of them at different places. Now you'll need to change GTAGSROOT and GTAGSDBPATH for every project.
Thanks & Regards,
Pavel
[Prev in Thread] | Current Thread | [Next in Thread] |