Add new option to lldb-server to display its version

llvm-svn: 260366
This commit is contained in:
Tamas Berghammer 2016-02-10 10:35:48 +00:00
parent eae66c019b
commit 2e912ec705

View File

@ -9,6 +9,7 @@
#include "lldb/Initialization/SystemLifetimeManager.h" #include "lldb/Initialization/SystemLifetimeManager.h"
#include "lldb/Initialization/SystemInitializerCommon.h" #include "lldb/Initialization/SystemInitializerCommon.h"
#include "lldb/lldb-private.h"
#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/STLExtras.h"
#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/ManagedStatic.h"
@ -22,9 +23,10 @@ static void
display_usage (const char *progname) display_usage (const char *progname)
{ {
fprintf(stderr, "Usage:\n" fprintf(stderr, "Usage:\n"
" %s v[ersion]\n"
" %s g[dbserver] [options]\n" " %s g[dbserver] [options]\n"
" %s p[latform] [options]\n" " %s p[latform] [options]\n"
"Invoke subcommand for additional help\n", progname, progname); "Invoke subcommand for additional help\n", progname, progname, progname);
exit(0); exit(0);
} }
@ -57,20 +59,24 @@ main (int argc, char *argv[])
display_usage(progname); display_usage(progname);
exit(option_error); exit(option_error);
} }
else if (argv[1][0] == 'g')
switch (argv[1][0])
{ {
initialize(); case 'g':
main_gdbserver(argc, argv); initialize();
terminate(); main_gdbserver(argc, argv);
} terminate();
else if (argv[1][0] == 'p') break;
{ case 'p':
initialize(); initialize();
main_platform(argc, argv); main_platform(argc, argv);
terminate(); terminate();
} break;
else { case 'v':
display_usage(progname); fprintf(stderr, "%s\n", lldb_private::GetVersion());
exit(option_error); break;
default:
display_usage(progname);
exit(option_error);
} }
} }