[Lldb-commits] [lldb] r126537 - /lldb/trunk/tools/debugserver/source/debugserver.cpp

Johnny Chen johnny.chen at apple.com
Fri Feb 25 17:36:13 PST 2011


Author: johnny
Date: Fri Feb 25 19:36:13 2011
New Revision: 126537

URL: http://llvm.org/viewvc/llvm-project?rev=126537&view=rev
Log:
If the user sets a working directory path using "process launch -w <path>", honor that dir path;
otherwise, use the thing the debugserver is started with.

Fixed rdar://problem/9056462
The process launch flag '-w' for setting the current working directory not working?

Modified:
    lldb/trunk/tools/debugserver/source/debugserver.cpp

Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver.cpp?rev=126537&r1=126536&r2=126537&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/debugserver.cpp (original)
+++ lldb/trunk/tools/debugserver/source/debugserver.cpp Fri Feb 25 19:36:13 2011
@@ -204,10 +204,12 @@
 
     char launch_err_str[PATH_MAX];
     launch_err_str[0] = '\0';
+    const char * cwd = (ctx.GetWorkingDirPath() != NULL ? ctx.GetWorkingDirPath()
+                                                        : ctx.GetWorkingDirectory());
     nub_process_t pid = DNBProcessLaunch (resolved_path,
                                           &inferior_argv[0],
                                           &inferior_envp[0],
-                                          ctx.GetWorkingDirectory(),
+                                          cwd,
                                           stdin_path,
                                           stdout_path,
                                           stderr_path,





More information about the lldb-commits mailing list