Fork me on GitHub

C/C++ Code Inspection

Call Hierarchy

When viewing a c or c++ source file you can view the call hierarchy of a function or method by issuing the command :CCallHierarchy. This will open a temporary buffer with an inversed tree view of the hierarchy of callers of the requested function or method.

fun2(int)
   fun1(int)
     main()
     fun3(int)
   fun3(int)

While you are in the hierarchy tree buffer, you can jump to the call under the cursor using one of the following key bindings:

  • <cr> - open the type using the (default action).
  • E - open the type via :edit
  • S - open the type via :split
  • T - open the type via :tabnew
  • ? - view help buffer

:CCallHierarchy can also be used to view the callees for a function or method by invoking the command with a !:

:CCallHierarchy!

Configuration

Vim Settings

  • g:EclimCCallHierarchyDefaultAction (defaults to 'split') - Determines the command used to open the file when hitting <enter> on an entry in the hierarchy buffer.