[Lldb-commits] [PATCH] D68156: [debugserver] Add --version/-V command line option to debugserver.
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 27 14:19:50 PDT 2019
JDevlieghere updated this revision to Diff 222246.
JDevlieghere retitled this revision from "[debugserver] Don't use RNBLog for printing the version" to "[debugserver] Add --version/-V command line option to debugserver.".
JDevlieghere edited the summary of this revision.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68156/new/
https://reviews.llvm.org/D68156
Files:
lldb/tools/debugserver/source/debugserver.cpp
Index: lldb/tools/debugserver/source/debugserver.cpp
===================================================================
--- lldb/tools/debugserver/source/debugserver.cpp
+++ lldb/tools/debugserver/source/debugserver.cpp
@@ -789,6 +789,12 @@
::fflush((FILE *)baton);
}
+void show_version_and_exit(int exit_code) {
+ printf("%s-%s for %s.\n", DEBUGSERVER_PROGRAM_NAME, DEBUGSERVER_VERSION_STR,
+ RNB_ARCH);
+ exit(exit_code);
+}
+
void show_usage_and_exit(int exit_code) {
RNBLogSTDERR(
"Usage:\n %s host:port [program-name program-arg1 program-arg2 ...]\n",
@@ -811,6 +817,7 @@
{"debug", no_argument, NULL, 'g'},
{"kill-on-error", no_argument, NULL, 'K'},
{"verbose", no_argument, NULL, 'v'},
+ {"version", no_argument, NULL, 'V'},
{"lockdown", no_argument, &g_lockdown_opt, 1}, // short option "-k"
{"applist", no_argument, &g_applist_opt, 1}, // short option "-t"
{"log-file", required_argument, NULL, 'l'},
@@ -1173,6 +1180,10 @@
DNBLogSetVerbose(1);
break;
+ case 'V':
+ show_version_and_exit(0);
+ break;
+
case 's':
ctx.GetSTDIN().assign(optarg);
ctx.GetSTDOUT().assign(optarg);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68156.222246.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190927/dab3e5e0/attachment-0001.bin>
More information about the lldb-commits
mailing list