diff options
Diffstat (limited to 'lldb/tools/lldb-server')
| -rw-r--r-- | lldb/tools/lldb-server/Acceptor.cpp | 6 | ||||
| -rw-r--r-- | lldb/tools/lldb-server/Acceptor.h | 8 | ||||
| -rw-r--r-- | lldb/tools/lldb-server/lldb-gdbserver.cpp | 20 | ||||
| -rw-r--r-- | lldb/tools/lldb-server/lldb-platform.cpp | 30 |
4 files changed, 32 insertions, 32 deletions
diff --git a/lldb/tools/lldb-server/Acceptor.cpp b/lldb/tools/lldb-server/Acceptor.cpp index 48a364886dc..16db9e9d30d 100644 --- a/lldb/tools/lldb-server/Acceptor.cpp +++ b/lldb/tools/lldb-server/Acceptor.cpp @@ -56,11 +56,11 @@ const char *FindSchemeByProtocol(const Socket::SocketProtocol protocol) { } } -Error Acceptor::Listen(int backlog) { +Status Acceptor::Listen(int backlog) { return m_listener_socket_up->Listen(StringRef(m_name), backlog); } -Error Acceptor::Accept(const bool child_processes_inherit, Connection *&conn) { +Status Acceptor::Accept(const bool child_processes_inherit, Connection *&conn) { Socket *conn_socket = nullptr; auto error = m_listener_socket_up->Accept(conn_socket); if (error.Success()) @@ -81,7 +81,7 @@ std::string Acceptor::GetLocalSocketId() const { return m_local_socket_id(); } std::unique_ptr<Acceptor> Acceptor::Create(StringRef name, const bool child_processes_inherit, - Error &error) { + Status &error) { error.Clear(); Socket::SocketProtocol socket_protocol = Socket::ProtocolUnixDomain; diff --git a/lldb/tools/lldb-server/Acceptor.h b/lldb/tools/lldb-server/Acceptor.h index 410970915f1..207bb4d973a 100644 --- a/lldb/tools/lldb-server/Acceptor.h +++ b/lldb/tools/lldb-server/Acceptor.h @@ -11,7 +11,7 @@ #include "lldb/Core/Connection.h" #include "lldb/Host/Socket.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include <functional> #include <memory> @@ -28,13 +28,13 @@ class Acceptor { public: virtual ~Acceptor() = default; - Error Listen(int backlog); + Status Listen(int backlog); - Error Accept(const bool child_processes_inherit, Connection *&conn); + Status Accept(const bool child_processes_inherit, Connection *&conn); static std::unique_ptr<Acceptor> Create(llvm::StringRef name, const bool child_processes_inherit, - Error &error); + Status &error); Socket::SocketProtocol GetSocketProtocol() const; diff --git a/lldb/tools/lldb-server/lldb-gdbserver.cpp b/lldb/tools/lldb-server/lldb-gdbserver.cpp index 59f5a44ce4e..6139bfabee3 100644 --- a/lldb/tools/lldb-server/lldb-gdbserver.cpp +++ b/lldb/tools/lldb-server/lldb-gdbserver.cpp @@ -35,7 +35,7 @@ #include "lldb/Host/Pipe.h" #include "lldb/Host/Socket.h" #include "lldb/Host/StringConvert.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #ifndef LLGS_PROGRAM_NAME #define LLGS_PROGRAM_NAME "lldb-server" @@ -112,7 +112,7 @@ static void display_usage(const char *progname, const char *subcommand) { void handle_attach_to_pid(GDBRemoteCommunicationServerLLGS &gdb_server, lldb::pid_t pid) { - Error error = gdb_server.AttachToProcess(pid); + Status error = gdb_server.AttachToProcess(pid); if (error.Fail()) { fprintf(stderr, "error: failed to attach to pid %" PRIu64 ": %s\n", pid, error.AsCString()); @@ -145,7 +145,7 @@ void handle_attach(GDBRemoteCommunicationServerLLGS &gdb_server, void handle_launch(GDBRemoteCommunicationServerLLGS &gdb_server, int argc, const char *const argv[]) { - Error error; + Status error; error = gdb_server.SetLaunchArguments(argv, argc); if (error.Fail()) { fprintf(stderr, "error: failed to set launch args for '%s': %s\n", argv[0], @@ -170,15 +170,15 @@ void handle_launch(GDBRemoteCommunicationServerLLGS &gdb_server, int argc, } } -Error writeSocketIdToPipe(Pipe &port_pipe, const std::string &socket_id) { +Status writeSocketIdToPipe(Pipe &port_pipe, const std::string &socket_id) { size_t bytes_written = 0; // Write the port number as a C string with the NULL terminator. return port_pipe.Write(socket_id.c_str(), socket_id.size() + 1, bytes_written); } -Error writeSocketIdToPipe(const char *const named_pipe_path, - const std::string &socket_id) { +Status writeSocketIdToPipe(const char *const named_pipe_path, + const std::string &socket_id) { Pipe port_name_pipe; // Wait for 10 seconds for pipe to be opened. auto error = port_name_pipe.OpenAsWriterWithTimeout(named_pipe_path, false, @@ -188,9 +188,9 @@ Error writeSocketIdToPipe(const char *const named_pipe_path, return writeSocketIdToPipe(port_name_pipe, socket_id); } -Error writeSocketIdToPipe(int unnamed_pipe_fd, const std::string &socket_id) { +Status writeSocketIdToPipe(int unnamed_pipe_fd, const std::string &socket_id) { #if defined(_WIN32) - return Error("Unnamed pipes are not supported on Windows."); + return Status("Unnamed pipes are not supported on Windows."); #else Pipe port_pipe{Pipe::kInvalidDescriptor, unnamed_pipe_fd}; return writeSocketIdToPipe(port_pipe, socket_id); @@ -202,7 +202,7 @@ void ConnectToRemote(MainLoop &mainloop, bool reverse_connect, const char *const host_and_port, const char *const progname, const char *const subcommand, const char *const named_pipe_path, int unnamed_pipe_fd) { - Error error; + Status error; if (host_and_port && host_and_port[0]) { // Parse out host and port. @@ -311,7 +311,7 @@ void ConnectToRemote(MainLoop &mainloop, // main //---------------------------------------------------------------------- int main_gdbserver(int argc, char *argv[]) { - Error error; + Status error; MainLoop mainloop; #ifndef _WIN32 // Setup signal handlers first thing. diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp index d9790cdf43a..8d45682566b 100644 --- a/lldb/tools/lldb-server/lldb-platform.cpp +++ b/lldb/tools/lldb-server/lldb-platform.cpp @@ -34,8 +34,8 @@ #include "lldb/Host/HostGetOpt.h" #include "lldb/Host/OptionParser.h" #include "lldb/Host/common/TCPSocket.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/Status.h" using namespace lldb; using namespace lldb_private; @@ -98,13 +98,13 @@ static void display_usage(const char *progname, const char *subcommand) { exit(0); } -static Error save_socket_id_to_file(const std::string &socket_id, - const FileSpec &file_spec) { +static Status save_socket_id_to_file(const std::string &socket_id, + const FileSpec &file_spec) { FileSpec temp_file_spec(file_spec.GetDirectory().AsCString(), false); - Error error(llvm::sys::fs::create_directory(temp_file_spec.GetPath())); + Status error(llvm::sys::fs::create_directory(temp_file_spec.GetPath())); if (error.Fail()) - return Error("Failed to create directory %s: %s", - temp_file_spec.GetCString(), error.AsCString()); + return Status("Failed to create directory %s: %s", + temp_file_spec.GetCString(), error.AsCString()); llvm::SmallString<64> temp_file_path; temp_file_spec.AppendPathComponent("port-file.%%%%%%"); @@ -112,7 +112,7 @@ static Error save_socket_id_to_file(const std::string &socket_id, auto err_code = llvm::sys::fs::createUniqueFile(temp_file_spec.GetPath(), FD, temp_file_path); if (err_code) - return Error("Failed to create temp file: %s", err_code.message().c_str()); + return Status("Failed to create temp file: %s", err_code.message().c_str()); llvm::FileRemover tmp_file_remover(temp_file_path); @@ -121,16 +121,16 @@ static Error save_socket_id_to_file(const std::string &socket_id, temp_file << socket_id; temp_file.close(); if (temp_file.has_error()) - return Error("Failed to write to port file."); + return Status("Failed to write to port file."); } err_code = llvm::sys::fs::rename(temp_file_path, file_spec.GetPath()); if (err_code) - return Error("Failed to rename file %s to %s: %s", temp_file_path.c_str(), - file_spec.GetPath().c_str(), err_code.message().c_str()); + return Status("Failed to rename file %s to %s: %s", temp_file_path.c_str(), + file_spec.GetPath().c_str(), err_code.message().c_str()); tmp_file_remover.releaseFile(); - return Error(); + return Status(); } //---------------------------------------------------------------------- @@ -144,7 +144,7 @@ int main_platform(int argc, char *argv[]) { signal(SIGPIPE, SIG_IGN); signal(SIGHUP, signal_handler); int long_option_index = 0; - Error error; + Status error; std::string listen_host_port; int ch; @@ -350,9 +350,9 @@ int main_platform(int argc, char *argv[]) { lldb::pid_t pid = LLDB_INVALID_PROCESS_ID; uint16_t port = 0; std::string socket_name; - Error error = platform.LaunchGDBServer(inferior_arguments, - "", // hostname - pid, port, socket_name); + Status error = platform.LaunchGDBServer(inferior_arguments, + "", // hostname + pid, port, socket_name); if (error.Success()) platform.SetPendingGdbServer(pid, port, socket_name); else |

