summaryrefslogtreecommitdiffstats
path: root/lldb/tools/darwin-debug/darwin-debug.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-11-22 18:55:04 +0000
committerGreg Clayton <gclayton@apple.com>2013-11-22 18:55:04 +0000
commitd4724cfdb15b1929889e452c73876d4b3415a700 (patch)
treeb4cdf63cf8047e9b70ea0854068647b19461c80b /lldb/tools/darwin-debug/darwin-debug.cpp
parent2b98c569966e29bb3335773bc620a175b1d620c8 (diff)
downloadbcm5719-llvm-d4724cfdb15b1929889e452c73876d4b3415a700.tar.gz
bcm5719-llvm-d4724cfdb15b1929889e452c73876d4b3415a700.zip
Make sure the getopt variables are correctly initialized for any option parsing.
Added a new "--port-offset PORT" option to lldb-platform so it can be used with USB mux type scenarios. llvm-svn: 195486
Diffstat (limited to 'lldb/tools/darwin-debug/darwin-debug.cpp')
-rw-r--r--lldb/tools/darwin-debug/darwin-debug.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/tools/darwin-debug/darwin-debug.cpp b/lldb/tools/darwin-debug/darwin-debug.cpp
index d81c5974020..62e1b884a97 100644
--- a/lldb/tools/darwin-debug/darwin-debug.cpp
+++ b/lldb/tools/darwin-debug/darwin-debug.cpp
@@ -186,6 +186,14 @@ int main (int argc, char *const *argv, char *const *envp, const char **apple)
bool pass_env = true;
std::string unix_socket_name;
std::string working_dir;
+
+#if __GLIBC__
+ optind = 0;
+#else
+ optreset = 1;
+ optind = 1;
+#endif
+
while ((ch = getopt_long_only(argc, argv, "a:deE:hsu:?", g_long_options, NULL)) != -1)
{
switch (ch)
OpenPOWER on IntegriCloud