diff options
author | Greg Clayton <gclayton@apple.com> | 2014-02-28 20:47:08 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-02-28 20:47:08 +0000 |
commit | 3121fde41a22993fd9ad369088827564e734f77d (patch) | |
tree | 9ee75a70eb1844f2cbf8b6d1dca4585ade9a8cc7 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | ec67ab1e0c6835cc904c16c3b40d0ff161580bcf (diff) | |
download | bcm5719-llvm-3121fde41a22993fd9ad369088827564e734f77d.tar.gz bcm5719-llvm-3121fde41a22993fd9ad369088827564e734f77d.zip |
Be sure to propagate the error back out SBTarget::Attach() when we fail to launch debugserver as root.
<rdar://problem/15669788>
llvm-svn: 202536
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index e3bc9f145ea..a33f27e16e3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -768,31 +768,34 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, error = Host::LaunchProcess(launch_info); - if (named_pipe_path[0]) + if (error.Success() && launch_info.GetProcessID() != LLDB_INVALID_PROCESS_ID) { - File name_pipe_file; - error = name_pipe_file.Open(named_pipe_path, File::eOpenOptionRead); - if (error.Success()) + if (named_pipe_path[0]) { - char port_cstr[256]; - port_cstr[0] = '\0'; - size_t num_bytes = sizeof(port_cstr); - error = name_pipe_file.Read(port_cstr, num_bytes); - assert (error.Success()); - assert (num_bytes > 0 && port_cstr[num_bytes-1] == '\0'); - out_port = Args::StringToUInt32(port_cstr, 0); - name_pipe_file.Close(); + File name_pipe_file; + error = name_pipe_file.Open(named_pipe_path, File::eOpenOptionRead); + if (error.Success()) + { + char port_cstr[256]; + port_cstr[0] = '\0'; + size_t num_bytes = sizeof(port_cstr); + error = name_pipe_file.Read(port_cstr, num_bytes); + assert (error.Success()); + assert (num_bytes > 0 && port_cstr[num_bytes-1] == '\0'); + out_port = Args::StringToUInt32(port_cstr, 0); + name_pipe_file.Close(); + } + Host::Unlink(named_pipe_path); + } + else if (listen) + { + + } + else + { + // Make sure we actually connect with the debugserver... + JoinListenThread(); } - Host::Unlink(named_pipe_path); - } - else if (listen) - { - - } - else - { - // Make sure we actually connect with the debugserver... - JoinListenThread(); } } else |