繁体   English   中英

如何在搜索过程中使cscope显示完整的文件路径

[英]How to make cscope display full file paths during search

当我使用cscope搜索C符号或全局定义时,它将显示文件名和行号。 我想查看完整的文件路径,以便可以跳转到我的arch专用文件。 例如,在基于Linux代码库的cscope上搜索__switch_to全局定义时,我得到:

Global definition: __switch_to

  File         Line
0 process.c    297 struct task_struct *__switch_to(struct task_struct *prev,
1 switch_to.h   44 #define __switch_to(prev,next,last) do { \
2 process.c    202 struct task_struct *__switch_to(struct task_struct *old,
3 process.c    400 struct task_struct *__switch_to(struct task_struct *prev,
4 process_32.c 211 __switch_to(struct task_struct *prev, struct task_struct *next)
5 process.c     80 void *__switch_to(struct task_struct *from, struct task_struct *to)
6 process_32.c 248 __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
7 process_64.c 272 __switch_to(struct task_struct *prev_p, struct task_struct *next_p)

现在,每个arch的文件process.c都不同。 如何使cscope显示完整的文件路径?

使用args -pn运行cscope

-pn显示最后n个文件路径组件,而不是默认的(1)。 使用0根本不显示文件名。

使用cscope -p4运行并搜索__switch_to的全局定义,结果为

Global definition: __switch_to

  File                           Line
0 arch/arm64/kernel/process.c    297 struct task_struct *__switch_to(struct task_struct *prev,
1 ia64/include/asm/switch_to.h    44 #define __switch_to(prev,next,last) do { \
2 arch/openrisc/kernel/process.c 202 struct task_struct *__switch_to(struct task_struct *old,
3 arch/powerpc/kernel/process.c  400 struct task_struct *__switch_to(struct task_struct *prev,
4 arch/sh/kernel/process_32.c    211 __switch_to(struct task_struct *prev, struct task_struct *next)
5 arch/um/kernel/process.c        80 void *__switch_to(struct task_struct *from, struct task_struct *to)
6 arch/x86/kernel/process_32.c   248 __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
7 arch/x86/kernel/process_64.c   272 __switch_to(struct task_struct *prev_p, struct task_struct *next_p)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM