2012-12-18 2 views
7

cscope을 사용하여 C 기호 또는 전역 정의를 검색하면 파일 이름과 줄 번호가 표시됩니다. 전체 파일 경로를보고 싶으면 내 아치 특정 파일로 이동할 수 있습니다. 리눅스 코드베이스에 cscope 빌드 __switch_to의 글로벌 정의를 검색 할 때 예를 들어, 내가 얻을 :검색 중에 cscope 전체 파일 경로를 표시하는 방법

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) 

이제 파일 process.carch 다릅니다. cscope 전체 파일 경로를 표시하는 방법? 인수와

답변

6

실행 cscope의는

대신 기본의 마지막 n 파일 경로 구성 요소를 표시 -PN -PN (1). 파일 이름을 표시하지 않으려면 0을 사용하십시오.

cscope의의 -P4으로 실행하고

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) 
에 __switch_to 결과의 글로벌 정의 검색
관련 문제