1
Grep-ing for a function name to see where it's being used returns a list of rows and row numbers. Is there a smart way of using grep and awk to get the name of the calling procedure instead?
Thanks
1
Grep-ing for a function name to see where it's being used returns a list of rows and row numbers. Is there a smart way of using grep and awk to get the name of the calling procedure instead?
Thanks
2
For jumping to the definition of an identifier: Exuberant Ctags
For finding uses of an identifier: GNU ID-Utils (mkid indexer, lid query command)
ctags also has hotkey support in vim at least (and I'm sure other editors) to quickly jump to function definitions while coding. – mikebabcock – 2012-05-30T16:06:15.497
What do you mean by name of the calling procedure? – soandos – 2012-03-22T10:55:17.020
When you find the file with the name you are looking for and you open it, you have to scroll up to find the procedure that calls it. I am using vi so the option of an IDE isn't a choice. – Andreas – 2012-03-22T10:56:25.293
I mean, for example, you are looking for instances of a function called "foo()" in all files in a tree. The calling procedure/function would be the function that uses foo(), or that has foo() as part of its definition. – Andreas – 2012-03-22T10:57:57.990
The aim of this is after finding the line that the function call appears in, to find the context in which it's being used. – Andreas – 2012-03-22T11:05:25.610
See http://stackoverflow.com/questions/563616/vim-and-ctags-tips-and-tricks, http://stackoverflow.com/questions/8900450/vim-command-to-find-all-function-names-that-contain-a-string-in-their-bodies-in.
– Daniel Andersson – 2012-03-22T11:10:06.650