xref: /freebsd/contrib/llvm-project/lldb/tools/lldb-server/LLGSOptions.td (revision ae7e8a02e6e93455e026036132c4d053b2c12ad9)
1include "llvm/Option/OptParser.td"
2
3class F<string name>: Flag<["--", "-"], name>;
4class R<list<string> prefixes, string name>
5  : Option<prefixes, name, KIND_REMAINING_ARGS>;
6
7multiclass SJ<string name, string help> {
8  def NAME: Separate<["--", "-"], name>,
9    HelpText<help>;
10  def NAME # _eq: Joined<["--", "-"], name # "=">,
11    Alias<!cast<Separate>(NAME)>;
12}
13
14def grp_connect : OptionGroup<"connection">, HelpText<"CONNECTION">;
15
16defm fd: SJ<"fd", "Communicate over the given file descriptor.">,
17  MetaVarName<"<fd>">,
18  Group<grp_connect>;
19
20defm named_pipe: SJ<"named-pipe", "Write port lldb-server will listen on to the given named pipe.">,
21  MetaVarName<"<name>">,
22  Group<grp_connect>;
23
24defm pipe: SJ<"pipe", "Write port lldb-server will listen on to the given file descriptor.">,
25  MetaVarName<"<fd>">,
26  Group<grp_connect>;
27
28def reverse_connect: F<"reverse-connect">,
29  HelpText<"Connect to the client instead of passively waiting for a connection. In this case [host]:port denotes the remote address to connect to.">,
30  Group<grp_connect>;
31
32def grp_general : OptionGroup<"general options">, HelpText<"GENERAL OPTIONS">;
33
34defm log_channels: SJ<"log-channels", "Channels to log. A colon-separated list of entries. Each entry starts with a channel followed by a space-separated list of categories.">,
35  MetaVarName<"<channel1 categories...:channel2 categories...>">,
36  Group<grp_general>;
37
38defm log_file: SJ<"log-file", "Destination file to log to. If empty, log to stderr.">,
39  MetaVarName<"<file>">,
40  Group<grp_general>;
41
42def setsid: F<"setsid">, HelpText<"Run lldb-server in a new session.">,
43  Group<grp_general>;
44def: Flag<["-"], "S">, Alias<setsid>,
45  Group<grp_general>;
46
47def help: F<"help">, HelpText<"Prints out the usage information for lldb-server.">,
48  Group<grp_general>;
49def: Flag<["-"], "h">, Alias<help>,
50  Group<grp_general>;
51
52def grp_target : OptionGroup<"target selection">, HelpText<"TARGET SELECTION">;
53
54defm attach: SJ<"attach", "Attach to the process given by a (numeric) process id or a name.">,
55  MetaVarName<"<pid-or-name>">,
56  Group<grp_target>;
57
58def REM : R<["--"], "">, HelpText<"Launch program for debugging.">,
59  MetaVarName<"program args">,
60  Group<grp_target>;
61
62def: F<"native-regs">; // Noop. Present for backwards compatibility only.
63