News for hackers. Stuff that matters.
Re:GNU GLOBAL source code tagging system by jboy on Monday November 17, 2014 @12:06AM (#8616929)
For me, the most useful information was the "Comparison with Similar Tools" table (in the OpenGrok project wiki), which was linked-to from the GNU GLOBAL page: https://github.com/OpenGrok/OpenGrok/wiki/Comparison-with-Si...

As a Vim user, the comparisons to Ctags and cscope were informative.

And the list of supported languages is impressive! Awk, Dos batch, COBOL, C, C++, C#, Erlang, Fortran, Java, JavaScript, Lisp, Lua, Pascal, Perl, PHP, Python, Ruby, Matlab, OCaml, Scheme, Tcl, TeX, Verilog, Vhdl and Vim.

Re:GNU GLOBAL source code tagging system by dima55 on Monday November 17, 2014 @12:51AM (#8617027)
The fancy language support is provided by exuberant ctags, so look into that if that excites you. As for cscope, GNU global is very similar; it's a bit slower for some things and a bit faster for others. Global can only find references, not callers/callees like cscope can. And the Debian maintainer of GNU Global thinks that the GNU Global maintainer is an idiot, and a consequence of this is that on Debian and derived distros the GNU Global package is ancient. But cscope is so similar, it doesn't really matter. Oh, and the gtags-cscope frontend global gives you is pretty much compatible with cscope, so any frontend that uses cscope will just work with gtags-cscope.
Re:GNU GLOBAL source code tagging system by jboy on Monday November 17, 2014 @01:12AM (#8617064)
Can you elaborate on the difference between finding references (in GLOBAL) and finding callers/callees (in cscope)?

The cscope caller/callee search is apparently still just text search in the code (rather than unambiguous call-graph resolution by compilation).

Re:GNU GLOBAL source code tagging system by dima55 on Monday November 17, 2014 @01:46AM (#8617145)
Both cscope and GNU global are "just text search", but cscope's C parsing is fancier. Among other things, you can ask cscope

1. Where is symbol "foo" mentioned? 2. Where is function "foo" called? 3. What other functions does function "foo" call?

GNU global can do #1, but not #2 or #3.

Re:GNU GLOBAL source code tagging system by tuhdo on Monday November 17, 2014 @03:14AM (#8617313)
Well, it seems like GNU Global while can only do #1, but does it better: http://www.farseer.cn/config/2013/11/26/ctags-cscope-gtags/
Re:GNU GLOBAL source code tagging system by dima55 on Monday November 17, 2014 @11:39AM (#8618944)
Heh? That post says its show-me-where-foo-is-defined functionality is broken sometimes, but it doesn't show it (and presumably they never filed a bug upstream either). I compared the two at some point last year, and they did produce slightly different results, with cscope being slightly more correct about something, but I don't recall exactly; they were VERY similar.
Re:GNU GLOBAL source code tagging system by tuhdo on Monday November 17, 2014 @01:34PM (#8619647)
But GNU Global is being maintained, while cscope was abandoned. With GNU Global, you can actually update your database without recreating your tag database again. This is very useful for editor integration when you finish editing a file and save it.
Re:GNU GLOBAL source code tagging system by softEngg on Tuesday November 18, 2014 @11:19PM (#8628241)
Try helm-gtags it supports callers/callees better than scope.
Re:GNU GLOBAL source code tagging system by dima55 on Thursday November 20, 2014 @05:18PM (#8638523)
Why would I do that? cscope works great.
Re:GNU GLOBAL source code tagging system by johncoltrane on Monday November 17, 2014 @03:42AM (#8617372)
Hmmm… JavaScript wasn't supported last time I tried GNU GLOBAL, two years ago. I'll have to check it out.
Re:GNU GLOBAL source code tagging system by surki on Monday November 17, 2014 @01:20AM (#8617077)
I have been using Global for about 6 years now. Mostly I use it in emacs (though at times I use the CLI version).

I use it in Linux and Windows. I mostly work on C/C++ (Linux kernel, Windows drivers etc) and also have used it for few C# projects (via exuberant ctags backend).

One real advantage I get: I switch platforms between Linux and Windows (the place I work for has both). So I use emacs in both platforms and same gtags customization works out of box in both platforms. This relieves me in learning/using new editor/tagging system for each platform.

FWIW: my dot emacs https://github.com/surki/dotemacs/blob/master/init.org

Re:GNU GLOBAL source code tagging system by temp2 on Monday November 17, 2014 @04:28AM (#8617468)
For C/C++ code that you can compile I highly recommend rtags.

It uses clang (llvm) to figure out all the cross-refs so doesn't have false positives from fuzzy matching.

rtags - https://github.com/Andersbakken/rtags vim plugin - https://github.com/lyuts/vim-rtags

Re:GNU GLOBAL source code tagging system by swah on Monday November 17, 2014 @05:24AM (#8617596)
Doesn't seem to run on Windows, though.
Re:GNU GLOBAL source code tagging system by jsond on Monday November 17, 2014 @03:59AM (#8617415)
I'm all for FOSS tools, and have (and still) use ctags / cscope (mainly in vim), however the best source code referencing tool I've ever used is Understand - https://scitools.com Yes, it's commercial, however it beats anything free that I've found so far.
Re:GNU GLOBAL source code tagging system by comex on Monday November 17, 2014 @12:41AM (#8617008)
But can it resolve method calls (in C++, or really any language) to the correct methods, rather than just listing all methods with the same name implemented for any class?

I doubt it, since this basically requires a C++ compiler and GLOBAL does not seem to have that. Yet that is what, after years now, I'm still looking for for Vim...

Incidentally I remember there was a work in progress code navigation system posted to HN semi-recently (written in Go?), but its name eludes me. Anyone want to point me to it? I'm curious how it's progressed since it was posted.

Re:GNU GLOBAL source code tagging system by X-Istence on Monday November 17, 2014 @02:00AM (#8617174)
Have you taken a look at clang complete?
Re:GNU GLOBAL source code tagging system by pranith on Monday November 17, 2014 @08:57AM (#8618185)
And the latest available version on the most recent ubuntu and debian releases is... 5.7.1 from 6 years ago!!

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=574947

https://bugs.launchpad.net/ubuntu/+source/global/+bug/127502...

Re:GNU GLOBAL source code tagging system by SloopJon on Monday November 17, 2014 @01:45PM (#8619703)
Wow. That explains dima55's comment above:

https://news.ycombinator.com/item?id=8617027

Re:GNU GLOBAL source code tagging system by SloopJon on Monday November 17, 2014 @02:05AM (#8617183)
I use etags in Emacs to navigate our C source code, which is so much more effective than the brute force search I often see people use. I don't have as good a handle on our C++, C#, and Java, so I'll give this a try.
Re:GNU GLOBAL source code tagging system by tuhdo on Monday November 17, 2014 @03:16AM (#8617317)
I listed several methods for navigating C/C++ source code here in my guide: http://tuhdo.github.io/c-ide.html

Hope it help.