Hi:

I have strange behavior that I can't resolve. I am on ubuntu 14.04 64 bit. I downloaded global-6.5 and did:

./configure --with-exuberant-ctags=/usr/bin/ctags-exuberant --disable-gtagscscope --prefix=/usr

"make" and "make check" all pass.

I did a "make install" as root. I then use the following C++ code and generated tags via "gtags" command.


ubuntu-14-64bits> cat -n foo.cc
     1    #include <map>
     2
     3    typedef  int DomainId_t;
     4
     5    typedef std::map<DomainId_t, int> map_t2;
     6
     7    main(){
     8      DomainId_t foo1;
     9      map_t2 mymap;
    10
    11
    12    }


When I then use global to find definitions

ubuntu-14-64bits> global -v --result=grep --nearness --path-style=shorter DomainId_t
foo.cc:3:typedef  int DomainId_t;
foo.cc:5:typedef std::map<DomainId_t, int> map_t2; # <<< UNEXPECTED
2 objects located (using '/home/gthaker/t2/GTAGS').

I don't understand why it also returns foo.cc:5 entry. (Makes no difference if I use "-d" option.)

I have been chasing this for a few days. I have narrowed this down to "gtags" command, since if I generate GTAGS (and GPATH and GRTAGS) on a different machine where I have built global-6.5 earlier I get correct behavior. (So it is not "global", but GTAGS generated by gtags.)

I have:

ubuntu-14-64bits> /usr/bin/gtags --version
gtags (GNU GLOBAL) 6.5
Copyright (c) 2015 Tama Communications Corporation
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
ubuntu-14-64bits> ldd /usr/bin/gtags
    linux-vdso.so.1 =>  (0x00007fff8dbfc000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff124494000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff1240cf000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff1246b1000)

Interestingly, on a MINT system where proper GTAGS* files get generated I see:

mint17-32bits> lsb_release  -a
No LSB modules are available.
Distributor ID:    LinuxMint
Description:    Linux Mint 17 Qiana
Release:    17
Codename:    qiana
mint17-32bits> /usr/bin/gtags --version
gtags (GNU GLOBAL) 6.5
Copyright (c) 2015 Tama Communications Corporation
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
mint17-32bits> ldd /usr/bin/gtags
    linux-gate.so.1 =>  (0xb7780000)
    libltdl.so.7 => /usr/lib/i386-linux-gnu/libltdl.so.7 (0xb7756000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb75a8000)
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb75a2000)
    /lib/ld-linux.so.2 (0xb7781000)
mint17-32bits>

mint17-32bits> global -v --result=grep --nearness --path-style=shorter DomainId_t
foo.cc:3:typedef int DomainId_t;
1 object located (using '/home/gthaker/t2/GTAGS'). #   OK, OK, OK

Naturally code snippet I am using is for demonstration only, the actual code where I see this is a large piece of (open source) software, and not being able to natigate around has given me a lot of trouble.

Appreciate any pointers.

Gautam



_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global

Reply via email to