Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a feature in Emacs for function call hierarchy

Tags:

emacs

I am maintaining someone else's code. The code is written in C using GCC 4.4.3 on Linux platform. However, the code jumps around a lot and its difficult to find out where all the functions are called from.

In Visual Studio, there is a feature called 'Call Hierarchy' which will display where functions are called from and called to. Does Emacs (23.1.1) have any such feature?

like image 759
ant2009 Avatar asked Sep 06 '10 04:09

ant2009


2 Answers

The classic Emacs way to jump to calls is to use TAGS file and use the M-. command. I recommend using Exuberant C Tags with the following command in the root directory of your project :

ctags -e --c-kinds=+pxd -R .

Then using visit-tags-table you can open the TAGS file. With M-. you can jump to each definition or call to your keyword. Use C-u M-. to jump to another occurrence. Use C-x z z z... to repeat the search.

If you have many projects, you can create a TAGS file for each one of them and then call visit-tags-file to add the TAGS file to your list of TAGS files to search from.

Another classic way (the un*x way), is to use the command M-x find-grep to search for occurrences of your keyword.

like image 115
Jérôme Radix Avatar answered Sep 24 '22 02:09

Jérôme Radix


http://cedet.sourceforge.net/symref.shtml

like image 31
Anycorn Avatar answered Sep 23 '22 02:09

Anycorn