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