xref: /freebsd-src/contrib/llvm-project/lldb/tools/lldb-server/LLGSOptions.td (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
1*e8d8bef9SDimitry Andricinclude "llvm/Option/OptParser.td"
2*e8d8bef9SDimitry Andric
3*e8d8bef9SDimitry Andricclass F<string name>: Flag<["--", "-"], name>;
4*e8d8bef9SDimitry Andricclass R<list<string> prefixes, string name>
5*e8d8bef9SDimitry Andric  : Option<prefixes, name, KIND_REMAINING_ARGS>;
6*e8d8bef9SDimitry Andric
7*e8d8bef9SDimitry Andricmulticlass SJ<string name, string help> {
8*e8d8bef9SDimitry Andric  def NAME: Separate<["--", "-"], name>,
9*e8d8bef9SDimitry Andric    HelpText<help>;
10*e8d8bef9SDimitry Andric  def NAME # _eq: Joined<["--", "-"], name # "=">,
11*e8d8bef9SDimitry Andric    Alias<!cast<Separate>(NAME)>;
12*e8d8bef9SDimitry Andric}
13*e8d8bef9SDimitry Andric
14*e8d8bef9SDimitry Andricdef grp_connect : OptionGroup<"connection">, HelpText<"CONNECTION">;
15*e8d8bef9SDimitry Andric
16*e8d8bef9SDimitry Andricdefm fd: SJ<"fd", "Communicate over the given file descriptor.">,
17*e8d8bef9SDimitry Andric  MetaVarName<"<fd>">,
18*e8d8bef9SDimitry Andric  Group<grp_connect>;
19*e8d8bef9SDimitry Andric
20*e8d8bef9SDimitry Andricdefm named_pipe: SJ<"named-pipe", "Write port lldb-server will listen on to the given named pipe.">,
21*e8d8bef9SDimitry Andric  MetaVarName<"<name>">,
22*e8d8bef9SDimitry Andric  Group<grp_connect>;
23*e8d8bef9SDimitry Andric
24*e8d8bef9SDimitry Andricdefm pipe: SJ<"pipe", "Write port lldb-server will listen on to the given file descriptor.">,
25*e8d8bef9SDimitry Andric  MetaVarName<"<fd>">,
26*e8d8bef9SDimitry Andric  Group<grp_connect>;
27*e8d8bef9SDimitry Andric
28*e8d8bef9SDimitry Andricdef reverse_connect: F<"reverse-connect">,
29*e8d8bef9SDimitry Andric  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*e8d8bef9SDimitry Andric  Group<grp_connect>;
31*e8d8bef9SDimitry Andric
32*e8d8bef9SDimitry Andricdef grp_general : OptionGroup<"general options">, HelpText<"GENERAL OPTIONS">;
33*e8d8bef9SDimitry Andric
34*e8d8bef9SDimitry Andricdefm 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*e8d8bef9SDimitry Andric  MetaVarName<"<channel1 categories...:channel2 categories...>">,
36*e8d8bef9SDimitry Andric  Group<grp_general>;
37*e8d8bef9SDimitry Andric
38*e8d8bef9SDimitry Andricdefm log_file: SJ<"log-file", "Destination file to log to. If empty, log to stderr.">,
39*e8d8bef9SDimitry Andric  MetaVarName<"<file>">,
40*e8d8bef9SDimitry Andric  Group<grp_general>;
41*e8d8bef9SDimitry Andric
42*e8d8bef9SDimitry Andricdef setsid: F<"setsid">, HelpText<"Run lldb-server in a new session.">,
43*e8d8bef9SDimitry Andric  Group<grp_general>;
44*e8d8bef9SDimitry Andricdef: Flag<["-"], "S">, Alias<setsid>,
45*e8d8bef9SDimitry Andric  Group<grp_general>;
46*e8d8bef9SDimitry Andric
47*e8d8bef9SDimitry Andricdef help: F<"help">, HelpText<"Prints out the usage information for lldb-server.">,
48*e8d8bef9SDimitry Andric  Group<grp_general>;
49*e8d8bef9SDimitry Andricdef: Flag<["-"], "h">, Alias<help>,
50*e8d8bef9SDimitry Andric  Group<grp_general>;
51*e8d8bef9SDimitry Andric
52*e8d8bef9SDimitry Andricdef grp_target : OptionGroup<"target selection">, HelpText<"TARGET SELECTION">;
53*e8d8bef9SDimitry Andric
54*e8d8bef9SDimitry Andricdefm attach: SJ<"attach", "Attach to the process given by a (numeric) process id or a name.">,
55*e8d8bef9SDimitry Andric  MetaVarName<"<pid-or-name>">,
56*e8d8bef9SDimitry Andric  Group<grp_target>;
57*e8d8bef9SDimitry Andric
58*e8d8bef9SDimitry Andricdef REM : R<["--"], "">, HelpText<"Launch program for debugging.">,
59*e8d8bef9SDimitry Andric  MetaVarName<"program args">,
60*e8d8bef9SDimitry Andric  Group<grp_target>;
61*e8d8bef9SDimitry Andric
62*e8d8bef9SDimitry Andricdef: F<"native-regs">; // Noop. Present for backwards compatibility only.
63