开发者

How to find the definition of a function or a class name using grep or find?

开发者 https://www.devze.com 2023-03-30 01:10 出处:网络
I am new to Linux development and I have to work with Mono project on Linux. I have the following function declaration:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消