How to find the definition of a function or a class name using grep or find?
I am new to Linux development and I have to work with Mono project on Linux. I have the following function declaration:
static MonoString *ves_icall_System_MonoType_getFullName (MonoReflectionType *object, gboole开发者_Go百科an full_name,
gboolean assembly_qualified)
{
MonoDomain *domain = mono_object_domain (object);
...
I would like to find the definition of MonoReflectionType
and the implementation of function mono_object_domain
. How do I use grep and find to do this with two separate bash commands? Thank you in advance.
Grep and find can do it but I think they're no the best tool for it. You'd be better off using ctags: http://ctags.sourceforge.net/.
Do this from the top level directory of your project:
$ ctags -R *
$ vi -t MonoReflectionType
I hope you're familiar with vi though ;)
You should probably be using CTags because that is more easier.
I hope your purpose is to find the definition while examining code and analyzing, with CTags you will find it very easy.
精彩评论