Skip to content

Commit 17d6190

Browse files
committed
update lldb-server platform help text
1 parent e07914b commit 17d6190

File tree

3 files changed

+231
-108
lines changed

3 files changed

+231
-108
lines changed

lldb/tools/lldb-server/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ set(LLVM_TARGET_DEFINITIONS LLGSOptions.td)
22
tablegen(LLVM LLGSOptions.inc -gen-opt-parser-defs)
33
add_public_tablegen_target(LLGSOptionsTableGen)
44

5+
set(LLVM_TARGET_DEFINITIONS LLPlatformOptions.td)
6+
tablegen(LLVM LLPlatformOptions.inc -gen-opt-parser-defs)
7+
add_public_tablegen_target(LLPlatformOptionsTableGen)
8+
59
set(LLDB_PLUGINS)
610

711
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
@@ -67,6 +71,7 @@ add_lldb_tool(lldb-server
6771

6872
add_dependencies(lldb-server
6973
LLGSOptionsTableGen
74+
LLPlatformOptionsTableGen
7075
${tablegen_deps}
7176
)
7277
target_include_directories(lldb-server PRIVATE "${LLDB_SOURCE_DIR}/source")
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
include "llvm/Option/OptParser.td"
2+
3+
class F<string name>: Flag<["--", "-"], name>;
4+
class R<list<string> prefixes, string name>
5+
: Option<prefixes, name, KIND_REMAINING_ARGS>;
6+
7+
multiclass 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+
14+
def grp_connect : OptionGroup<"connection">, HelpText<"CONNECTION OPTIONS">;
15+
16+
defm listen: SJ<"listen", "Host and port to listen on. Format: [host]:port or protocol://[host]:port (e.g., tcp://localhost:1234, unix:///path/to/socket).">,
17+
MetaVarName<"<[host]:port>">,
18+
Group<grp_connect>;
19+
20+
defm socket_file: SJ<"socket-file", "Write listening socket information (port number for TCP or path for Unix domain sockets) to the specified file.">,
21+
MetaVarName<"<path>">,
22+
Group<grp_connect>;
23+
24+
defm gdbserver_port: SJ<"gdbserver-port", "Port to use for spawned gdbserver instances. If 0 or unspecified, a port will be chosen automatically.">,
25+
MetaVarName<"<port>">,
26+
Group<grp_connect>;
27+
28+
defm child_platform_fd: SJ<"child-platform-fd", "File descriptor for communication with parent platform process (internal use only).">,
29+
MetaVarName<"<fd>">,
30+
Group<grp_connect>,
31+
Flags<[HelpHidden]>;
32+
33+
def grp_general : OptionGroup<"general options">, HelpText<"GENERAL OPTIONS">;
34+
35+
def server: F<"server">,
36+
HelpText<"Run in server mode, accepting multiple client connections sequentially. Without this flag, the server exits after handling the first connection.">,
37+
Group<grp_general>;
38+
39+
defm 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. Common channels: lldb, gdb-remote, platform, process.">,
40+
MetaVarName<"<channel1 categories...:channel2 categories...>">,
41+
Group<grp_general>;
42+
43+
defm log_file: SJ<"log-file", "Destination file to log to. If empty, log to stderr.">,
44+
MetaVarName<"<file>">,
45+
Group<grp_general>;
46+
47+
def debug: F<"debug">,
48+
HelpText<"(Unused, kept for backward compatibility)">,
49+
Group<grp_general>,
50+
Flags<[HelpHidden]>;
51+
52+
def verbose: F<"verbose">,
53+
HelpText<"(Unused, kept for backward compatibility)">,
54+
Group<grp_general>,
55+
Flags<[HelpHidden]>;
56+
57+
def help: F<"help">,
58+
HelpText<"Display this help message and exit.">,
59+
Group<grp_general>;
60+
def: Flag<["-"], "h">, Alias<help>,
61+
Group<grp_general>;
62+
63+
def REM : R<["--"], "">,
64+
HelpText<"Arguments to pass to launched gdbserver instances.">,
65+
MetaVarName<"program args">;

0 commit comments

Comments
 (0)