如何在vi/vim的C代码中找到函数的调用者和被调用者? [英] How to find the callers and callee of a function in C code in vi/vim?

查看:43
本文介绍了如何在vi/vim的C代码中找到函数的调用者和被调用者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何轻松单击(或使用一些简单的快捷方式)函数名称并找到它的所有被调用者或打开它的定义位置.网络中的大多数网络手册都很难遵循或无法解决.假设我想点击 allocuvm 并查看它在哪里定义?

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); 

推荐答案

为此,Vim 与 cscope 工具集成;请参阅 :help cscope 了解更多信息.

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

这篇关于如何在vi/vim的C代码中找到函数的调用者和被调用者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆