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