[Lldb-commits] [lldb] r154293 - /lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp
Johnny Chen
johnny.chen at apple.com
Sun Apr 8 10:47:46 PDT 2012
Author: johnny
Date: Sun Apr 8 12:47:45 2012
New Revision: 154293
URL: http://llvm.org/viewvc/llvm-project?rev=154293&view=rev
Log:
Add simple print usage and exit as a start.
Modified:
lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp
Modified: lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp?rev=154293&r1=154292&r2=154293&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/lldb-platform/lldb-platform.cpp Sun Apr 8 12:47:45 2012
@@ -61,12 +61,20 @@
}
}
+static void
+display_usage (const char *progname)
+{
+ fprintf(stderr, "Usage:\n %s [--log-file log-file-path] [--log-flags flags] --listen port\n", progname);
+ exit(0);
+}
+
//----------------------------------------------------------------------
// main
//----------------------------------------------------------------------
int
main (int argc, char *argv[])
{
+ const char *progname = argv[0];
signal (SIGPIPE, signal_handler);
int long_option_index = 0;
StreamSP log_stream_sp;
@@ -165,8 +173,16 @@
case 'L':
listen_host_port.append (optarg);
break;
+
+ case 'h': /* fall-through is intentional */
+ case '?':
+ display_usage(progname);
+ break;
}
}
+ // Print usage and exit if no listening port is specified.
+ if (listen_host_port.empty())
+ display_usage(progname);
if (log_stream_sp)
{
@@ -204,7 +220,6 @@
}
}
-
if (gdb_server.IsConnected())
{
// After we connected, we need to get an initial ack from...
More information about the lldb-commits
mailing list