blob: 21bc663c77742e6bc64472c5aecb5b01608cd620 [file] [log] [blame]
Tamas Berghammerc2c3d712015-02-18 15:39:41 +00001//===-- 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
14display_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", progname, progname);
20 exit(0);
21}
22
23// Forward declarations of subcommand main methods.
24int main_gdbserver (int argc, char *argv[]);
25int main_platform (int argc, char *argv[]);
26
27//----------------------------------------------------------------------
28// main
29//----------------------------------------------------------------------
30int
31main (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}