1GTAGS(1) General Commands Manual GTAGS(1)
2
3
4
6 gtags - create tag files for global.
7
9 gtags [-iIqvw][-f file][-n number][dbpath]
10
12 Gtags recursively collect the source files under the current directory,
13 pickup symbols and write the cross-reference data into tag files
14 (´GTAGS´, ´GRTAGS´, ´GSYMS´ and ´GPATH´). You should execute this com‐
15 mand at the root of the source tree.
16
17 C, C++, yacc, java, PHP and Assembly source files are supported. Files
18 whose names end in ´.c´ or ´.h´ are assumed to be C source files and
19 are searched for C style routine and macro definitions. Files whose
20 names end in ´.c++´ ´.cc´ ´.cpp´ ´.cxx´ ´.hxx´ ´.hpp´ ´.C´ ´.H´ are
21 assumed to be C++ source files. Files whose names end in ´.y´ are
22 assumed to be YACC source files. Files whose names end in ´.java´ are
23 assumed to be Java source files. Files whose names end in ´.php´
24 ´.php3´ ´.phtml´ are assumed to be PHP source files. Files whose names
25 end in ´.s´ or ´.S´ are assumed to be Assembler source files. Other
26 files are searched for C style definitions.
27
29 The following options are available:
30
31 --config[=name]
32 Show the value of config variable name. If name is not speci‐
33 fied then show whole of config entry.
34
35 -f, --file file
36 Read from file a list of file names which should be considered
37 as the candidate of source files. By default, all files under
38 the current directory are considered as the candidate. If file
39 is ´-´, read from standard input. File names must be separated
40 by newline.
41
42 --gtagsconf file
43 Load user's configuration from file.
44
45 --gtagslabel label
46 label is used as the label of configuration file. The default
47 is default.
48
49 -i, --incremental
50 Update tag files incrementally. You had better use global(1)
51 with the -u option.
52
53 -I, --idutils
54 Make index files for idutils(1).
55
56 -n, --max-args number
57 Maximum number of arguments for gtags-parser(1). By default,
58 gtags invokes the parser with arguments as a lot as possible to
59 decrease the frequency of invoking.
60
61 -q, --quiet
62 Quiet mode.
63
64 -v, --verbose
65 Verbose mode.
66
67 -w, --warning
68 Print warning messages.
69
70 dbpath The directory in which tag files are generated. The default is
71 the current directory. It is useful when your source directory
72 is on a read only device like CDROM.
73
75 $ ls -F
76 Makefile src/ lib/
77 $ gtags -v
78 $ global -x main
79 main 10 src/main.c main (argc, argv) {
80
82 ´GTAGS´
83 Tag file for function definitions.
84
85 ´GRTAGS´
86 Tag file for function references.
87
88 ´GSYMS´
89 Tag file for other symbols.
90
91 ´GPATH´
92 Tag file for path of source files.
93
94 ´/etc/gtags.conf´, ´$HOME/.globalrc´
95 Configuration file.
96
98 The following environment variables affect the execution of gtags:
99
100 GTAGSCONF
101 If this variable is set, its value is used as the configuration
102 file. The default is ´$HOME/.globalrc´.
103
104 GTAGSLABEL
105 If this variable is set, its value is used as the label of con‐
106 figuration file. The default is default.
107
108 GTAGSCACHE
109 If this variable is set, its value is used as the size of btree
110 cache. The default is 500000 (bytes).
111
113 The following configuration variables affect the execution of gtags.
114 You can see the default value for each variable with the --config
115 option.
116
117 GTAGS(string)
118 If this variable is set, its value is used as the command line
119 of parser for GTAGS. The default is ´gtags-parser -dt %s´.
120
121 GRTAGS(string)
122 If this variable is set, its value is used as the command line
123 of parser for GRTAGS. The default is ´gtags-parser -dtr %s´.
124
125 GSYMS(string)
126 If this variable is set, its value is used as the command line
127 of parser for GSYMS. The default is ´gtags-parser -dts %s´.
128
129 skip(comma separated list)
130 Gtags skips files which listed in this list. As a special
131 exception, gtags collect values from multiple skip variables.
132 If the value ends with '/', it assumed as a directory and gtags
133 skips all files under it. If the value start with '/', it
134 assumed relative path from the root of source directory.
135
136 suffixes(comma separated list)
137 Suffixes of target source file. As a special exception, gtags
138 collect values from multiple suffixes variables. This variable
139 is obsoleted. If the langmap variable is defined gtags no longer
140 refers this.
141
142 icase_path(boolean)
143 Ignore case distinctions in the path. Suffixes check are
144 affected by this capability.
145
146 langmap(comma separated list)
147 Language mapping. Each comma-separated map consists of the lan‐
148 guage name, a colon, and a list of file extensions. Default
149 mapping is
150 'c:.c.h,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H,php:.php.php3.phtml'.
151
153 Gtags exits with a non 0 value if an error occurred, 0 otherwise.
154
156 Verbose message has important level. The most important level is 0, the
157 second is 1 and so on. All the message has level numbers leading
158 blanks.
159
161 gtags-parser(1), global(1), htags(1).
162
163 GNU GLOBAL source code tag system
164 (http://www.gnu.org/software/global/).
165
167 ´GTAGS´, ´GRTAGS´ and ´GSYMS´ are very large. In advance of using this
168 command, check the space of your disk.
169
170 Assembler support is far from complete. It extracts only ENTRY() and
171 ALTENTRY() from source file. Probably valid only for FreeBSD and Linux
172 kernel source.
173
174 There is no concurrency control about tag files.
175
176 Symbols in Assembly source files are not extracted for ´GSYMS´.
177
179 Tama Communications Corporation.
180
182 The gtags command appeared in FreeBSD 2.2.2.
183
184
185
186GNU Project January 2007 GTAGS(1)