如何为Mac OS X 10.6安装cscope?我已经安装了XCode,但我没有在/ opt/local/bin中看到cscope.
我将 vim 与 cscope 和 ctags 一起使用。在我早期的编辑器中,我曾经使用一些映射的键来查找局部变量的引用。在vim中,使用cscope find命令,它也列出了其他函数中所有同名的变量。
有没有办法列出仅限于给定范围或函数的局部变量的用法?
//main.c
#include "stdio.h"
void f(){
printf("Welcome to emacs's world!");
return;
}
void call_f(void (*f)()){
(*f)();
return;
}
void main(){
call_f(f);
return;
}
Run Code Online (Sandbox Code Playgroud)
我使用cscope查找函数“call_f”的定义,但没有结果,cscope找不到“call_f”的定义。
我将函数“call_f”的参数类型更改为除函数指针之外的另一种类型。
#include "stdio.h"
void f(){
printf("Welcome to emacs's world!");
return;
}
void call_f(/* void (*f)() */void){
// (*f)();
f();
return;
}
void main(){
// call_f(f);
call_f(void);
return;
}
Run Code Online (Sandbox Code Playgroud)
然后cscope可以找到函数“call_f”的定义。这是一个错误吗?
我想使用启用了cscope的vim-不幸的是,工作中的二进制文件没有使用cscope支持进行编译,当我尝试从src进行构建时,由于未安装正确的开发包而导致很多错误。
那么,有没有人提供我可以在cscope支持下预编译的二进制文件的链接?顺便说一句,我正在使用linux。
Is there a way to use the word under the cursor in a cscope search in Vim?
If the cursor is over a variable Foo and I want to avoid needing to type Foo again in the command line but would like to assemble :cs f s Foo.
Is there any way I can automate it?