1 //===-- lldb-server.cpp -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include <stdio.h>
11 #include <stdlib.h>
12 
13 static void
14 display_usage (const char *progname)
15 {
16     fprintf(stderr, "Usage:\n"
17             "  %s g[dbserver] [options]\n"
18             "  %s p[latform] [options]\n"
19             "Invoke subcommand for additional help\n", progname, progname);
20     exit(0);
21 }
22 
23 // Forward declarations of subcommand main methods.
24 int main_gdbserver (int argc, char *argv[]);
25 int main_platform (int argc, char *argv[]);
26 
27 //----------------------------------------------------------------------
28 // main
29 //----------------------------------------------------------------------
30 int
31 main (int argc, char *argv[])
32 {
33     int option_error = 0;
34     const char *progname = argv[0];
35     if (argc < 2)
36     {
37         display_usage(progname);
38         exit(option_error);
39     }
40     else if (argv[1][0] == 'g')
41     {
42         main_gdbserver(argc, argv);
43     }
44     else if (argv[1][0] == 'p')
45     {
46         main_platform(argc, argv);
47     }
48     else {
49         display_usage(progname);
50         exit(option_error);
51     }
52 }
53