strange global behavior on c++ files

View: New views
3 Messages — Rating Filter:   Alert me  

strange global behavior on c++ files

by mikolaj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

recently I have found some strange behavior of global while working
with C++ files.
The situation:
foo.h:

class Foo {
 public:
        Foo();
        ~Foo();
};

then after indexing, I see everything is ok - result of "global -s -x"
shows 3 lines with "Foo".
However after adding file foo.cpp with the implementation of
constructor/destructor and rebuilding tags,
the result of "global -s -x" shows NOTHING. No any symbols found! (but
"global -x Foo" shows correctly results from foo.cpp).
Do you have idea of the reason of that behavior? Maybe some hints how to fix it?

Best regards
Mikolaj


_______________________________________________
Bug-global mailing list
Bug-global@...
http://lists.gnu.org/mailman/listinfo/bug-global

Re: strange global behavior on c++ files

by Shigio YAMAGUCHI-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

> recently I have found some strange behavior of global while working
> with C++ files.
> The situation:
> foo.h:
>
> class Foo {
>  public:
> Foo();
> ~Foo();
> };
>
> then after indexing, I see everything is ok - result of "global -s -x"
> shows 3 lines with "Foo".
> However after adding file foo.cpp with the implementation of
> constructor/destructor and rebuilding tags,
> the result of "global -s -x" shows NOTHING. No any symbols found! (but
> "global -x Foo" shows correctly results from foo.cpp).
> Do you have idea of the reason of that behavior? Maybe some hints how to fix it?

It seems that Foo.h is considerred to be not C++ but C file.
The mapping of the extension and the language is shown.

c, h => C
c++, cpp, cxx, hxx, hpp, C, H => C++

You can change it using the .globalrc file in your home directory.

$ cd $HOME
$ cp /usr/local/share/gtags/gtags.conf .globalrc

[$HOME/.globalrc]

c:.c.h,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H,...
    ==
        |
        v
c:.c,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H.h,...
                                                                ==
You can also rewrite the configure.ac file directly before building.

Best regards
Shigio
--
Shigio YAMAGUCHI <shigio@...>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


_______________________________________________
Bug-global mailing list
Bug-global@...
http://lists.gnu.org/mailman/listinfo/bug-global

Re: strange global behavior on c++ files

by mikolaj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Aug 21, 2009 at 8:11 AM, Shigio YAMAGUCHI<shigio@...> wrote:
> It seems that Foo.h is considerred to be not C++ but C file.

Thanks Shigio!

now it works great :)

Mikolaj


_______________________________________________
Bug-global mailing list
Bug-global@...
http://lists.gnu.org/mailman/listinfo/bug-global