ggtags icon indicating copy to clipboard operation
ggtags copied to clipboard

Support Caller/Callee Search?

Open skyan opened this issue 10 years ago • 5 comments

I switched to ggtags from xcscope recently. And it is really a faster, easier, more human friendly tool comparing to xcscope. Great job!

But I found caller/callee searching feature was not supported and xcscope did. This feature is frequently used in xcscope by myself. So I wonder if it is possible that this feature be supported in ggtags? I think it will be very useful while navigating C/C++ source code.

In fact, I don't know where to put this request so I create a issue and hope you can see it.

skyan avatar Aug 27 '14 08:08 skyan

There's a tool that uses GNU Global to query callers/callees: glcall. It would be nice if Leo supports for this tool.

tuhdo avatar Aug 27 '14 09:08 tuhdo

Thanks to both for suggesting and helping.

Those features aren't implemented because of the limit of the backend i.e. global itself. If you use gtags-cscope for xcscope you will find the features missing too. Let me see if upstream is willing to add these features given they just added the pygments plugin ;)

Cheers, Leo

leoliu avatar Aug 27 '14 10:08 leoliu

Requested upstream http://thread.gmane.org/gmane.comp.gnu.global.bugs/1809

leoliu avatar Aug 27 '14 10:08 leoliu

@tuhdo or @skyan, Could any of you reply on gnu global's bug mailing list to describe what you would like the feature to look like? Thanks.

leoliu avatar Aug 28 '14 01:08 leoliu

@leoliu , Because gtags does not generate cross-reference database like as cscope does, it is impossible to show the "caller information" about a symbol.

However, I have a proposal to workaround temporarily: 0) emacs have cc-mode with syntax parser support, that 'c-defun-name' can find out "caller" of a given position.

  1. If ggtags searches a symbol or references using cscope format, it's output format is [file search_symbol line others... ].
  2. the real output of cscope is [file caller line other.... ].
  3. thus, ggtags can do the replacement in ggtags-global-filter, by using c-defun-name with position composited with 1st and 3rd tokens of gtags's cscope output.

I am also hungry for this feature, and studying to intend to come out a solution. But, I am weak at elisp programming, and expect you expert to easily settle it down. Orz

BR, AST

astonelin avatar Jul 12 '16 07:07 astonelin