Comment faire en sorte que cscope affiche des chemins de fichiers complets pendant la recherche

Lorsque je recherche un symbole C ou une définition globale à l’aide de cscope , il affiche les noms de fichiers et les numéros de ligne. Je voudrais voir les chemins de fichiers complets pour que je puisse accéder directement à mon fichier spécifique. Par exemple, lors de la recherche d’une définition globale de __switch_to sur cscope construit sur base de code Linux, j’obtiens:

 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) 

Maintenant, le fichier process.c est différent pour chaque arch . Comment faire en cscope que cscope affiche les chemins de fichiers complets?

Exécuter cscope avec args -pn

-pn Affiche les n derniers composants du chemin d’access au fichier au lieu de la valeur par défaut (1). Utilisez 0 pour ne pas afficher le nom du fichier.

Exécution avec cscope -p4 et recherche d’une définition globale de __switch_to résultats dans

 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)