Skip to content
Advertisement

How to find the callers and callee of a function in C code in vi/vim?

I want to know how can I easily click (or maybe use some easy shortcuts) on a function name and find all its callee or open where it has been defined. Most of the web manuals in web are really hard to follow or don’t happen to work out. Say I want to click on allocuvm and see where it has been defined?

uint newstk=allocuvm(pgdir, USERTOP-PGSIZE, USERTOP); 

Advertisement

Answer

For that, Vim integrates with the cscope tool; see :help cscope for more information.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement