1 include "llvm/Option/OptParser.td"
3 class F<string name>: Flag<["--", "-"], name>;
4 class S<string name>: Separate<["--", "-"], name>;
5 class R<list<string> prefixes, string name>
6 : Option<prefixes, name, KIND_REMAINING_ARGS>;
8 // Please keep this in sync with the man page in docs/man/lldb.rst
11 def grp_attach : OptionGroup<"attaching">, HelpText<"ATTACHING">;
13 def attach_name: Separate<["--", "-"], "attach-name">,
14 MetaVarName<"<name>">,
15 HelpText<"Tells the debugger to attach to a process with the given name.">,
17 def: Separate<["-"], "n">,
19 HelpText<"Alias for --attach-name">,
22 def 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.">,
25 def: Flag<["-"], "w">,
27 HelpText<"Alias for --wait-for">,
30 def attach_pid: Separate<["--", "-"], "attach-pid">,
32 HelpText<"Tells the debugger to attach to a process with the given pid.">,
34 def: Separate<["-"], "p">,
36 HelpText<"Alias for --attach-pid">,
41 def grp_scripting : OptionGroup<"scripting">, HelpText<"SCRIPTING">;
43 def python_path: F<"python-path">,
44 HelpText<"Prints out the path to the lldb.py file for this version of lldb.">,
46 def: Flag<["-"], "P">,
48 HelpText<"Alias for --python-path">,
51 def print_script_interpreter_info: F<"print-script-interpreter-info">,
52 HelpText<"Prints out a json dictionary with information about the scripting language interpreter.">,
55 def script_language: Separate<["--", "-"], "script-language">,
56 MetaVarName<"<language>">,
57 HelpText<"Tells the debugger to use the specified scripting language for user-defined scripts.">,
59 def: Separate<["-"], "l">,
60 Alias<script_language>,
61 HelpText<"Alias for --script-language">,
65 def grp_repl : OptionGroup<"repl">, HelpText<"REPL">;
67 def repl: Flag<["--", "-"], "repl">,
68 HelpText<"Runs lldb in REPL mode with a stub process.">,
70 def: Flag<["-"], "r">,
72 HelpText<"Alias for --repl">,
74 def repl_: Joined<["--", "-"], "repl=">,
75 MetaVarName<"<flags>">,
76 HelpText<"Runs lldb in REPL mode with a stub process with the given flags.">,
78 def: Joined<["-"], "r=">,
79 MetaVarName<"<flags>">,
81 HelpText<"Alias for --repl=<flags>">,
84 def repl_language: Separate<["--", "-"], "repl-language">,
85 MetaVarName<"<language>">,
86 HelpText<"Chooses the language for the REPL.">,
88 def: Separate<["-"], "R">,
90 HelpText<"Alias for --repl-language">,
95 def grp_command : OptionGroup<"command">, HelpText<"COMMANDS">;
97 def no_lldbinit: F<"no-lldbinit">,
98 HelpText<"Do not automatically parse any '.lldbinit' files.">,
100 def: Flag<["-"], "x">,
102 HelpText<"Alias for --no-lldbinit">,
104 def local_lldbinit: F<"local-lldbinit">,
105 HelpText<"Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed.">,
108 def batch: F<"batch">,
109 HelpText<"Tells the debugger to run the commands from -s, -S, -o & -O, and then quit.">,
111 def: Flag<["-"], "b">,
113 HelpText<"Alias for --batch">,
116 def source_quietly: F<"source-quietly">,
117 HelpText<"Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.">,
119 def: Flag<["-"], "Q">,
120 Alias<source_quietly>,
121 HelpText<"Alias for --source-quietly">,
124 def one_line_on_crash: Separate<["--", "-"], "one-line-on-crash">,
125 MetaVarName<"<command>">,
126 HelpText<"When in batch mode, tells the debugger to run this one-line lldb command if the target crashes.">,
128 def: Separate<["-"], "k">,
129 Alias<one_line_on_crash>,
130 HelpText<"Alias for --one-line-on-crash">,
133 def source_on_crash: Separate<["--", "-"], "source-on-crash">,
134 MetaVarName<"<file>">,
135 HelpText<"When in batch mode, tells the debugger to source this file of lldb commands if the target crashes.">,
137 def: Separate<["-"], "K">,
138 Alias<source_on_crash>,
139 HelpText<"Alias for --source-on-crash">,
142 def source: Separate<["--", "-"], "source">,
143 MetaVarName<"<file>">,
144 HelpText<"Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded.">,
146 def: Separate<["-"], "s">,
148 HelpText<"Alias for --source">,
151 def source_before_file: Separate<["--", "-"], "source-before-file">,
152 MetaVarName<"<file>">,
153 HelpText<"Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded.">,
155 def: Separate<["-"], "S">,
156 Alias<source_before_file>,
157 HelpText<"Alias for --source-before-file">,
160 def one_line: Separate<["--", "-"], "one-line">,
161 MetaVarName<"<command>">,
162 HelpText<"Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded.">,
164 def: Separate<["-"], "o">,
166 HelpText<"Alias for --one-line">,
169 def one_line_before_file: Separate<["--", "-"], "one-line-before-file">,
170 MetaVarName<"<command>">,
171 HelpText<"Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded.">,
173 def: Separate<["-"], "O">,
174 Alias<one_line_before_file>,
175 HelpText<"Alias for --one-line-before-file">,
180 def version: F<"version">,
181 HelpText<"Prints out the current version number of the LLDB debugger.">;
182 def: Flag<["-"], "v">,
184 HelpText<"Alias for --version">;
187 HelpText<"Prints out the usage information for the LLDB debugger.">;
188 def: Flag<["-"], "h">,
190 HelpText<"Alias for --help">;
192 def core: Separate<["--", "-"], "core">,
193 MetaVarName<"<filename>">,
194 HelpText<"Tells the debugger to use the full path to <filename> as the core file.">;
195 def: Separate<["-"], "c">,
197 HelpText<"Alias for --core">;
199 def editor: F<"editor">,
200 HelpText<"Tells the debugger to open source files using the host's \"external editor\" mechanism.">;
201 def: Flag<["-"], "e">,
203 HelpText<"Alias for --editor">;
205 def no_use_colors: F<"no-use-colors">,
206 HelpText<"Do not use colors.">;
207 def: Flag<["-"], "X">,
208 Alias<no_use_colors>,
209 HelpText<"Alias for --no-use-color">;
211 def file: Separate<["--", "-"], "file">,
212 MetaVarName<"<filename>">,
213 HelpText<"Tells the debugger to use the file <filename> as the program to be debugged.">;
214 def: Separate<["-"], "f">,
216 HelpText<"Alias for --file">;
218 def arch: Separate<["--", "-"], "arch">,
219 MetaVarName<"<architecture>">,
220 HelpText<"Tells the debugger to use the specified architecture when starting and running the program.">;
221 def: Separate<["-"], "a">,
223 HelpText<"Alias for --arch">;
225 def debug: F<"debug">,
226 HelpText<"Tells the debugger to print out extra information for debugging itself.">;
227 def: Flag<["-"], "d">,
229 HelpText<"Alias for --debug">;
231 def REM : R<["--"], "">;