📄 cscope.1
字号:
``file''.).TP.B ^rRebuild the cross-reference..TP.B !Start an interactive shell (type ^d to return to cscope)..TP.B ^lRedraw the screen..TP.B ?Give help information about cscope commands..TP.B ^dExit cscope..PP.PP .B NOTE: If the first character of the text to be searched for matches.B one of the above commands, escape it by typing a (backslash) first..PP.B Substituting new text for old text.PPAfter the text to be changed has been typed, cscope will prompt forthe new text, and then it will display the lines containing the oldtext. Select the lines to be changed with these single-charactercommands:.PP.TP.B 0-9a-zA-ZMark or unmark the line to be changed..TP.B * Mark or unmark all displayed lines to be changed..TP.B <Space>Display next set of lines..TP.B +Display next set of lines..TP.B - Display previous set of lines..TP.B aMark or unmark all lines to be changed..TP.B ^dChange the marked lines and exit..TP.B <Esc>Exit without changing the marked lines..TP.B !Start an interactive shell (type ^d to return to cscope)..TP.B ^lRedraw the screen..TP.B ?Give help information about cscope commands..TP.B Special keys.PPIf your terminal has arrow keys that work in vi, you can use themto move around the input fields. The up-arrow key is useful to move tothe previousinput field instead of using the <Tab> key repeatedly. If you have<CLEAR>, <NEXT>, or <PREV> keys they will act as the ^l, +, and -commands, respectively..PP .B Line-Oriented interface.PP The -l option lets you use cscope where a screen-oriented interfacewould not be useful, for example, from another screen-orientedprogram..PP cscope will prompt with >> when it is ready for an input line startingwith the field number (counting from 0) immediately followed by thesearch pattern, for example, ``lmain'' finds the definition of themain function..PP If you just want a single search, instead of the -l option use the -Land -num pattern options, and you won't get the >> prompt..PP For -l, cscope outputs the number of reference linescscope: 2 lines.PP For each reference found, cscope outputs a line consisting of the filename, function name, line number, and line text, separated by spaces,for example,main.c main 161 main(argc, argv).PPNote that the editor is not called to display a single reference,unlike the screen-oriented interface..PPYou can use the c command to toggle ignore/use letter case whensearching. (When ignoring letter case, search for ``FILE'' will match``File'' and ``file''.).PPYou can use the r command to rebuild the database..PPcscope will quit when it detects end-of-file, or when the firstcharacter of an input line is ``^d'' or ``q''..PP .SH "ENVIRONMENT VARIABLES".TP.B CSCOPE_EDITOROverrides the EDITOR and VIEWER variables. Use this if you wish to usea different editor with cscope than that specified by yourEDITOR/VIEWER variables..TP.B CSCOPE_LINEFLAGFormat of the line number flag for your editor. By default, cscopeinvokes your editor via the equivalent of ``editor +N file'', where``N'' is the line number that the editor should jump to. This formatis used by both emacs and vi. If your editor needs somethingdifferent, specify it in this variable, with ``%s'' as a placeholderfor the line number. Ex: if your editor needs to be invoked as``editor -#103 file'' to go to line 103, set this variable to``-#%s''..TP.B CSCOPE_LINEFLAG_AFTER_FILESet this variable to ``yes'' if your editor needs to be invoked withthe line number option after the filename to be edited. To continuethe example from CSCOPE_LINEFLAG, above: if your editor needs to see``editor file -#number'', set this environment variable. Users of moststandard editors (vi, emacs) do not need to set this variable..TP.B EDITORPreferred editor, which defaults to vi..TP.B HOMEHome directory, which is automatically set at login..TP.B INCLUDEDIRSColon-separated list of directories to search for #includefiles..TP.B SHELLPreferred shell, which defaults to sh..TP.B SOURCEDIRSColon-separated list of directories to search for additionalsource files..TP.B TERMTerminal type, which must be a screen terminal..TP.B TERMINFOTerminal information directory full path name. If your terminalis not in the standard terminfo directory, see cursesand terminfo for how to make your own terminal description..TP.B TMPDIRTemporary file directory, which defaults to /var/tmp..TP.B VIEWERPreferred file display program (such as less), which overridesEDITOR (see above)..TP.B VPATHA colon-separated list of directories, each of which has thesame directory structure below it. If VPATH is set, cscopesearches for source files in the directories specified; if itis not set, cscope searches only in the current directory..PP.SH FILES.TP.B cscope.filesDefault files containing -I, -p, -q, and -T options and thelist of source files (overridden by the -i option)..TP.B cscope.outSymbol cross-reference file (overridden by the -f option),which is put in the home directory if it cannot be created inthe current directory..TP.PD 0.B cscope.in.out.TP.B cscope.po.out.PD 1Default files containing the inverted index used for quicksymbol searching (-q option). If you use the -f option torename the cross-reference file (so it's not cscope.out), thenames for these inverted index files will be created by adding .in and .po to the name you supply with -f. For example, if youindicated -f xyz, then these files would be named xyz.in andxyz.po..TP.B INCDIRStandard directory for #include files (usually /usr/include)..SH Notices.I cscoperecognizes function definitions of the form:.PD 0.TPfname blank ( args ) white arg_decs white {.PD 1 .TPwhere:.I fnameis the function name.TP.I blankis zero or more spaces or tabs, not including newlines.TP.I argsis any string that does not contain a ``"'' or a newline.TP.I whiteis zero or more spaces, tabs, or newlines.TP.I arg_decsare zero or more argument declarations (arg_decs may includecomments and white space).PPIt is not necessary for a function declaration to start at thebeginning of a line. The return type may precede the function name;cscope will still recognize the declaration. Function definitions thatdeviate from this form will not be recognized by cscope..PPThe ``Function'' column of the search output for the menu option Findfunctions called by this function: input field will only display thefirst function called in the line, that is, for this function.PP e() { return (f() + g()); }.PPthe display would be.PP Functions called by this function: e File Function Line a.c f 3 return(f() + g());.PP Occasionally, a function definition or call may not be recognizedbecause of braces inside #if statements. Similarly, the use of avariable may be incorrectly recognized as a definition..PPA .B typedefname preceding a preprocessor statement will be incorrectlyrecognized as a global definition, for example,.PP LDFILE * #if AR16WR.PPPreprocessor statements can also prevent the recognition of a globaldefinition, for example,.PP char flag #ifdef ALLOCATE_STORAGE = -1 #endif ;.PPA function declaration inside a function is incorrectly recognized asa function call, for example,.PP f() { void g(); }.PPis incorrectly recognized as a call to g..PP .I cscoperecognizes C++ classes by looking for the class keyword, butdoesn't recognize that a struct is also a class, so it doesn'trecognize inline member function definitions in a structure. It alsodoesn't expect the class keyword in a.I typedef, so it incorrectlyrecognizes X as a definition in.PP typedef class X * Y;.PPIt also doesn't recognize operator function definitions.PP Bool Feature::operator==(const Feature & other) { ... }.PPNor does it recognize function definitions with a function pointerargument.PP ParseTable::Recognize(int startState, char *pattern, int finishState, void (*FinalAction)(char *)) { ... }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -