1 1.1 christos Cscope Notes: 2 1.1 christos 3 1.1 christos The nvi tags structure has been reworked to handle the notion of multiple 4 1.1 christos locations per tag. This supports cscope, which returns multiple locations 5 1.1 christos per query. It will hopefully support ctags programs that create databases 6 1.1 christos with multiple locations per tag as well. 7 1.1 christos 8 1.1 christos There is now a list of "tag queues" chained from each screen. Each tag 9 1.1 christos queue has one or more "tag locations". 10 1.1 christos 11 1.1 christos +----+ +----+ +----+ +----+ 12 1.1 christos | EP | -> | Q1 | <-- | T1 | <-- | T2 | 13 1.1 christos +----+ +----+ --> +----+ --> +----+ 14 1.1 christos | 15 1.1 christos +----+ +----+ 16 1.1 christos | Q2 | <-- | T1 | 17 1.1 christos +----+ --> +----+ 18 1.1 christos | 19 1.1 christos +----+ +----+ 20 1.1 christos | Q3 | <-- | T1 | 21 1.1 christos +----+ --> +----+ 22 1.1 christos 23 1.1 christos In the above diagram, each "Q" is a "tag queue", and each "T" is a 24 1.1 christos tag location. Generally, the commands: 25 1.1 christos 26 1.1 christos :tag create a new Q 27 1.1 christos ^[ create a new Q 28 1.1 christos :cscope find create a new Q 29 1.1 christos :tagnext move to the next T 30 1.1 christos :tagprev move to the previous T 31 1.1 christos :tagpop discard one or more Q's 32 1.1 christos ^T discard the most recent Q 33 1.1 christos :tagtop discard all Q's 34 1.1 christos 35 1.1 christos More specifically: 36 1.1 christos 37 1.1 christos :cs[cope] a[dd] cscope-dir 38 1.1 christos 39 1.1 christos Attach to the cscope database in cscope-dir. 40 1.1 christos 41 1.1 christos :cs[cope] f[ind] c|d|e|f|g|i|s|t buffer|pattern 42 1.1 christos 43 1.1 christos Query all attached cscopes for the pattern. The pattern is a 44 1.1 christos regular expression. If the pattern is a double-quote character 45 1.1 christos followed by a valid buffer name (e.g., "t), then the contents 46 1.1 christos of the named buffer are used as the pattern. 47 1.1 christos 48 1.1 christos c: find callers of name 49 1.1 christos d: find all function calls made from name 50 1.1 christos e: find pattern 51 1.1 christos f: find files with name as substring 52 1.1 christos g: find definition of name 53 1.1 christos i: find files #including name 54 1.1 christos s: find all uses of name 55 1.1 christos t: find assignments to name 56 1.1 christos 57 1.1 christos The find command pushes the current location onto the tags stack, 58 1.1 christos and switches to the first location resulting from the query, if 59 1.1 christos the query returned at least one result. 60 1.1 christos 61 1.1 christos :cs[cope] h[elp] [command] 62 1.1 christos 63 1.1 christos List the cscope commands, or usage help on one command. 64 1.1 christos 65 1.1 christos :display c[onnections] 66 1.1 christos 67 1.1 christos Display the list of cscope connections 68 1.1 christos 69 1.1 christos :display t[ags] 70 1.1 christos 71 1.1 christos The tags display has been enhanced to display multiple tag 72 1.1 christos locations per tag query. 73 1.1 christos 74 1.1 christos :cs[cope] k[ill] # 75 1.1 christos 76 1.1 christos Kill cscope connection number #. 77 1.1 christos 78 1.1 christos :cs[cope] r[eset] 79 1.1 christos Kill all attached cscopes. Useful if one got hung but you don't 80 1.1 christos know which one. 81 1.1 christos 82 1.1 christos :tagn[ext][!] 83 1.1 christos 84 1.1 christos Move to the next tag resulting from a query. 85 1.1 christos 86 1.1 christos :tagpr[ev][!] 87 1.1 christos 88 1.1 christos Return to the previous tag resulting from a query. 89 1.1 christos 90 1.1 christos :tagp[op], ^T 91 1.1 christos 92 1.1 christos Return to the previous tag group (no change). 93 1.1 christos 94 1.1 christos :tagt[op] 95 1.1 christos 96 1.1 christos Discard all tag groups (no change). 97 1.1 christos 98 1.1 christos Suggested maps: 99 1.1 christos 100 1.1 christos " ^N: move to the next tag 101 1.1 christos map ^N :tagnext^M 102 1.1 christos " ^P: move to the previous tag 103 1.1 christos map ^P :tagprev^M 104 1.1 christos 105 1.1 christos " Tab+letter performs a C-Scope query on the current word. 106 1.1 christos " C-Scope 12.9 has a text-string query (type t). 107 1.1 christos " C-Scope 13.3 replaces it with an assignment query; hence a==t. 108 1.1 christos map <tab>a "tye:csc find t"t 109 1.1 christos map <tab>c "tye:csc find c"t 110 1.1 christos map <tab>d "tye:csc find d"t 111 1.1 christos map <tab>e "tye:csc find e"t 112 1.1 christos map <tab>f "tye:csc find f"t 113 1.1 christos map <tab>g "tye:csc find g"t 114 1.1 christos map <tab>i "tye:csc find i"t 115 1.1 christos map <tab>s "tye:csc find s"t 116 1.1 christos map <tab>t "tye:csc find t"t 117 1.1 christos 118 1.1 christos To start nvi with an initial set of cscope directories, use the environment 119 1.1 christos variable CSCOPE_DIRS. This variable should contain a <blank>-separated 120 1.1 christos list of directories containing cscope databases. (This MAY be changed to 121 1.1 christos be an edit option, I haven't really decided, yet.) 122 1.1 christos 123 1.1 christos Each cscope directory must contain a file named "cscope.out" which is the 124 1.1 christos main cscope database, or nvi will not attempt to connect to a cscope to 125 1.1 christos handle requests for that database. 126 1.1 christos 127 1.1 christos The file "cscope.tpath" may contain a colon-separated directory search 128 1.1 christos path which will be used to find the files reported by cscope. If this 129 1.1 christos cscope.tpath does not exist, then the paths are assumed to be relative to 130 1.1 christos the cscope directory itself. This is an extension to the standard cscope, 131 1.1 christos but seems important enough to keep. 132 1.1 christos 133 1.1 christos =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 134 1.1 christos Cscope Availability: 135 1.1 christos 136 1.1 christos UNIXWare System V Release 4.0 variants such as Sun Solaris 2.x 137 1.1 christos (/opt/SUNWspro/bin) have version 11.5, and UNIXWare System V 138 1.1 christos Release 4.1 has version 12.10 with an option for much faster 139 1.1 christos searching. 140 1.1 christos 141 1.1 christos You can buy version 13.3 source with an unrestricted license 142 1.1 christos for $400 from AT&T Software Solutions by calling +1-800-462-8146. 143