xref: /freebsd/contrib/llvm-project/lldb/tools/driver/Options.td (revision 994297b01b98816bea1abf45ae4bac1bc69ee7a0)
1include "llvm/Option/OptParser.td"
2
3class F<string name>: Flag<["--", "-"], name>;
4class S<string name>: Separate<["--", "-"], name>;
5class R<list<string> prefixes, string name>
6  : Option<prefixes, name, KIND_REMAINING_ARGS>;
7
8// Please keep this in sync with the man page in docs/man/lldb.rst
9
10// Attaching options.
11def grp_attach : OptionGroup<"attaching">, HelpText<"ATTACHING">;
12
13def attach_name: Separate<["--", "-"], "attach-name">,
14  MetaVarName<"<name>">,
15  HelpText<"Tells the debugger to attach to a process with the given name.">,
16  Group<grp_attach>;
17def: Separate<["-"], "n">,
18  Alias<attach_name>,
19  HelpText<"Alias for --attach-name">,
20  Group<grp_attach>;
21
22def wait_for: F<"wait-for">,
23  HelpText<"Tells the debugger to wait for a process with the given pid or name to launch before attaching.">,
24  Group<grp_attach>;
25def: Flag<["-"], "w">,
26  Alias<wait_for>,
27  HelpText<"Alias for --wait-for">,
28  Group<grp_attach>;
29
30def attach_pid: Separate<["--", "-"], "attach-pid">,
31  MetaVarName<"<pid>">,
32  HelpText<"Tells the debugger to attach to a process with the given pid.">,
33  Group<grp_attach>;
34def: Separate<["-"], "p">,
35  Alias<attach_pid>,
36  HelpText<"Alias for --attach-pid">,
37  Group<grp_attach>;
38
39
40// Scripting options.
41def grp_scripting : OptionGroup<"scripting">, HelpText<"SCRIPTING">;
42
43def python_path: F<"python-path">,
44  HelpText<"Prints out the path to the lldb.py file for this version of lldb.">,
45  Group<grp_scripting>;
46def: Flag<["-"], "P">,
47  Alias<python_path>,
48  HelpText<"Alias for --python-path">,
49  Group<grp_scripting>;
50
51def script_language: Separate<["--", "-"], "script-language">,
52  MetaVarName<"<language>">,
53  HelpText<"Tells the debugger to use the specified scripting language for user-defined scripts.">,
54  Group<grp_scripting>;
55def: Separate<["-"], "l">,
56  Alias<script_language>,
57  HelpText<"Alias for --script-language">,
58  Group<grp_scripting>;
59
60// Repl options.
61def grp_repl : OptionGroup<"repl">, HelpText<"REPL">;
62
63def repl: Flag<["--", "-"], "repl">,
64  HelpText<"Runs lldb in REPL mode with a stub process.">,
65  Group<grp_repl>;
66def: Flag<["-"], "r">,
67  Alias<repl>,
68  HelpText<"Alias for --repl">,
69  Group<grp_repl>;
70def repl_: Joined<["--", "-"], "repl=">,
71  MetaVarName<"<flags>">,
72  HelpText<"Runs lldb in REPL mode with a stub process with the given flags.">,
73  Group<grp_repl>;
74def: Joined<["-"], "r=">,
75  MetaVarName<"<flags>">,
76  Alias<repl_>,
77  HelpText<"Alias for --repl=<flags>">,
78  Group<grp_repl>;
79
80def repl_language: Separate<["--", "-"], "repl-language">,
81  MetaVarName<"<language>">,
82  HelpText<"Chooses the language for the REPL.">,
83  Group<grp_repl>;
84def: Separate<["-"], "R">,
85  Alias<repl_language>,
86  HelpText<"Alias for --repl-language">,
87  Group<grp_repl>;
88
89
90// Command options.
91def grp_command : OptionGroup<"command">, HelpText<"COMMANDS">;
92
93def no_lldbinit: F<"no-lldbinit">,
94  HelpText<"Do not automatically parse any '.lldbinit' files.">,
95  Group<grp_command>;
96def: Flag<["-"], "x">,
97  Alias<no_lldbinit>,
98  HelpText<"Alias for --no-lldbinit">,
99  Group<grp_command>;
100def local_lldbinit: F<"local-lldbinit">,
101  HelpText<"Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed.">,
102  Group<grp_command>;
103
104def batch: F<"batch">,
105  HelpText<"Tells the debugger to run the commands from -s, -S, -o & -O, and then quit.">,
106  Group<grp_command>;
107def: Flag<["-"], "b">,
108  Alias<batch>,
109  HelpText<"Alias for --batch">,
110  Group<grp_command>;
111
112def source_quietly: F<"source-quietly">,
113  HelpText<"Tells the debugger to execute this one-line lldb command before any file has been loaded.">,
114  Group<grp_command>;
115def: Flag<["-"], "Q">,
116  Alias<source_quietly>,
117  HelpText<"Alias for --source-quietly">,
118  Group<grp_command>;
119
120def one_line_on_crash: Separate<["--", "-"], "one-line-on-crash">,
121  MetaVarName<"<command>">,
122  HelpText<"When in batch mode, tells the debugger to run this one-line lldb command if the target crashes.">,
123  Group<grp_command>;
124def: Separate<["-"], "k">,
125  Alias<one_line_on_crash>,
126  HelpText<"Alias for --one-line-on-crash">,
127  Group<grp_command>;
128
129def source_on_crash: Separate<["--", "-"], "source-on-crash">,
130  MetaVarName<"<file>">,
131  HelpText<"When in batch mode, tells the debugger to source this file of lldb commands if the target crashes.">,
132  Group<grp_command>;
133def: Separate<["-"], "K">,
134  Alias<source_on_crash>,
135  HelpText<"Alias for --source-on-crash">,
136  Group<grp_command>;
137
138def source: Separate<["--", "-"], "source">,
139  MetaVarName<"<file>">,
140  HelpText<"Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded.">,
141  Group<grp_command>;
142def: Separate<["-"], "s">,
143  Alias<source>,
144  HelpText<"Alias for --source">,
145  Group<grp_command>;
146
147def source_before_file: Separate<["--", "-"], "source-before-file">,
148  MetaVarName<"<file>">,
149  HelpText<"Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded.">,
150  Group<grp_command>;
151def: Separate<["-"], "S">,
152  Alias<source_before_file>,
153  HelpText<"Alias for --source-before-file">,
154  Group<grp_command>;
155
156def one_line: Separate<["--", "-"], "one-line">,
157  MetaVarName<"<command>">,
158  HelpText<"Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded.">,
159  Group<grp_command>;
160def: Separate<["-"], "o">,
161  Alias<one_line>,
162  HelpText<"Alias for --one-line">,
163  Group<grp_command>;
164
165def one_line_before_file: Separate<["--", "-"], "one-line-before-file">,
166  MetaVarName<"<command>">,
167  HelpText<"Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded.">,
168  Group<grp_command>;
169def: Separate<["-"], "O">,
170  Alias<one_line_before_file>,
171  HelpText<"Alias for --one-line-before-file">,
172  Group<grp_command>;
173
174
175// General options.
176def version: F<"version">,
177  HelpText<"Prints out the current version number of the LLDB debugger.">;
178def: Flag<["-"], "v">,
179  Alias<version>,
180  HelpText<"Alias for --version">;
181
182def help: F<"help">,
183  HelpText<"Prints out the usage information for the LLDB debugger.">;
184def: Flag<["-"], "h">,
185  Alias<help>,
186  HelpText<"Alias for --help">;
187
188def core: Separate<["--", "-"], "core">,
189  MetaVarName<"<filename>">,
190  HelpText<"Tells the debugger to use the full path to <filename> as the core file.">;
191def: Separate<["-"], "c">,
192  Alias<core>,
193  HelpText<"Alias for --core">;
194
195def editor: F<"editor">,
196  HelpText<"Tells the debugger to open source files using the host's \"external editor\" mechanism.">;
197def: Flag<["-"], "e">,
198  Alias<editor>,
199  HelpText<"Alias for --editor">;
200
201def no_use_colors: F<"no-use-colors">,
202  HelpText<"Do not use colors.">;
203def: Flag<["-"], "X">,
204  Alias<no_use_colors>,
205  HelpText<"Alias for --no-use-color">;
206
207def file: Separate<["--", "-"], "file">,
208  MetaVarName<"<filename>">,
209  HelpText<"Tells the debugger to use the file <filename> as the program to be debugged.">;
210def: Separate<["-"], "f">,
211  Alias<file>,
212  HelpText<"Alias for --file">;
213
214def arch: Separate<["--", "-"], "arch">,
215  MetaVarName<"<architecture>">,
216  HelpText<"Tells the debugger to use the specified architecture when starting and running the program.">;
217def: Separate<["-"], "a">,
218  Alias<arch>,
219  HelpText<"Alias for --arch">;
220
221def debug: F<"debug">,
222  HelpText<"Tells the debugger to print out extra information for debugging itself.">;
223def: Flag<["-"], "d">,
224  Alias<debug>,
225  HelpText<"Alias for --debug">;
226
227def capture: F<"capture">,
228  HelpText<"Tells the debugger to capture a reproducer.">;
229def capture_path: Separate<["--", "-"], "capture-path">,
230  MetaVarName<"<filename>">,
231  HelpText<"Tells the debugger to use the given filename for the reproducer.">;
232def replay: Separate<["--", "-"], "replay">,
233  MetaVarName<"<filename>">,
234  HelpText<"Tells the debugger to replay a reproducer from <filename>.">;
235def reproducer_finalize: Separate<["--", "-"], "reproducer-finalize">,
236  MetaVarName<"<filename>">;
237def no_version_check: F<"reproducer-no-version-check">,
238  HelpText<"Disable the reproducer version check.">;
239def no_verification: F<"reproducer-no-verify">,
240  HelpText<"Disable the reproducer verification.">;
241def no_generate_on_signal: F<"reproducer-no-generate-on-signal">,
242  HelpText<"Don't generate reproducer when a signal is received.">;
243def generate_on_exit: F<"reproducer-generate-on-exit">,
244  HelpText<"Generate reproducer on exit.">;
245
246def REM : R<["--"], "">;
247