[Lldb-commits] [lldb] update lldb-server platform help parsing (PR #162730)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 9 14:59:34 PDT 2025


================
@@ -56,22 +59,69 @@ using namespace llvm;
 // of target CPUs. For now, let's just use 100.
 static const int backlog = 100;
 static const int socket_error = -1;
-static int g_debug = 0;
-static int g_verbose = 0;
-static int g_server = 0;
-
-// option descriptors for getopt_long_only()
-static struct option g_long_options[] = {
-    {"debug", no_argument, &g_debug, 1},
-    {"verbose", no_argument, &g_verbose, 1},
-    {"log-file", required_argument, nullptr, 'l'},
-    {"log-channels", required_argument, nullptr, 'c'},
-    {"listen", required_argument, nullptr, 'L'},
-    {"gdbserver-port", required_argument, nullptr, 'P'},
-    {"socket-file", required_argument, nullptr, 'f'},
-    {"server", no_argument, &g_server, 1},
-    {"child-platform-fd", required_argument, nullptr, 2},
-    {nullptr, 0, nullptr, 0}};
+
+namespace {
+using namespace llvm::opt;
+
+enum ID {
+  OPT_INVALID = 0, // This is not an option ID.
+#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__),
+#include "LLPlatformOptions.inc"
----------------
JDevlieghere wrote:

I know this is inspired by `LLGS` but given that there's no such ambiguity for platform, and I've never seen `LLPlatform` I'd go with `LLDBPlatformOptions.inc` or even just `PlatformOptions.inc`. 

https://github.com/llvm/llvm-project/pull/162730


More information about the lldb-commits mailing list