diff options
Diffstat (limited to 'source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp')
-rw-r--r-- | source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 218c628601149..645bfdfa770da 100644 --- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -25,9 +25,9 @@ #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/UriParser.h" @@ -93,12 +93,12 @@ const char *PlatformRemoteGDBServer::GetDescription() { return GetDescriptionStatic(); } -Error PlatformRemoteGDBServer::ResolveExecutable( +Status PlatformRemoteGDBServer::ResolveExecutable( const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr) { // copied from PlatformRemoteiOS - Error error; + Status error; // Nothing special to do here, just use the actual file and architecture ModuleSpec resolved_module_spec(module_spec); @@ -189,12 +189,12 @@ bool PlatformRemoteGDBServer::GetModuleSpec(const FileSpec &module_file_spec, return true; } -Error PlatformRemoteGDBServer::GetFileWithUUID(const FileSpec &platform_file, - const UUID *uuid_ptr, - FileSpec &local_file) { +Status PlatformRemoteGDBServer::GetFileWithUUID(const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) { // Default to the local case local_file = platform_file; - return Error(); + return Status(); } //------------------------------------------------------------------ @@ -291,8 +291,8 @@ bool PlatformRemoteGDBServer::IsConnected() const { return m_gdb_client.IsConnected(); } -Error PlatformRemoteGDBServer::ConnectRemote(Args &args) { - Error error; +Status PlatformRemoteGDBServer::ConnectRemote(Args &args) { + Status error; if (IsConnected()) { error.SetErrorStringWithFormat("the platform is already connected to '%s', " "execute 'platform disconnect' to close the " @@ -306,10 +306,10 @@ Error PlatformRemoteGDBServer::ConnectRemote(Args &args) { std::string path; const char *url = args.GetArgumentAtIndex(0); if (!url) - return Error("URL is null."); + return Status("URL is null."); llvm::StringRef scheme, hostname, pathname; if (!UriParser::Parse(url, scheme, hostname, port, pathname)) - return Error("Invalid URL: %s", url); + return Status("Invalid URL: %s", url); m_platform_scheme = scheme; m_platform_hostname = hostname; path = pathname; @@ -336,8 +336,8 @@ Error PlatformRemoteGDBServer::ConnectRemote(Args &args) { return error; } -Error PlatformRemoteGDBServer::DisconnectRemote() { - Error error; +Status PlatformRemoteGDBServer::DisconnectRemote() { + Status error; m_gdb_client.Disconnect(&error); m_remote_signals_sp.reset(); return error; @@ -386,9 +386,9 @@ bool PlatformRemoteGDBServer::GetProcessInfo( return m_gdb_client.GetProcessInfo(pid, process_info); } -Error PlatformRemoteGDBServer::LaunchProcess(ProcessLaunchInfo &launch_info) { +Status PlatformRemoteGDBServer::LaunchProcess(ProcessLaunchInfo &launch_info) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); - Error error; + Status error; if (log) log->Printf("PlatformRemoteGDBServer::%s() called", __FUNCTION__); @@ -480,17 +480,17 @@ Error PlatformRemoteGDBServer::LaunchProcess(ProcessLaunchInfo &launch_info) { return error; } -Error PlatformRemoteGDBServer::KillProcess(const lldb::pid_t pid) { +Status PlatformRemoteGDBServer::KillProcess(const lldb::pid_t pid) { if (!KillSpawnedProcess(pid)) - return Error("failed to kill remote spawned process"); - return Error(); + return Status("failed to kill remote spawned process"); + return Status(); } lldb::ProcessSP PlatformRemoteGDBServer::DebugProcess( ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, // Can be NULL, if NULL create a new target, else use // existing one - Error &error) { + Status &error) { lldb::ProcessSP process_sp; if (IsRemote()) { if (IsConnected()) { @@ -577,7 +577,7 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach( ProcessAttachInfo &attach_info, Debugger &debugger, Target *target, // Can be NULL, if NULL create a new target, else use // existing one - Error &error) { + Status &error) { lldb::ProcessSP process_sp; if (IsRemote()) { if (IsConnected()) { @@ -625,9 +625,9 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach( return process_sp; } -Error PlatformRemoteGDBServer::MakeDirectory(const FileSpec &file_spec, - uint32_t mode) { - Error error = m_gdb_client.MakeDirectory(file_spec, mode); +Status PlatformRemoteGDBServer::MakeDirectory(const FileSpec &file_spec, + uint32_t mode) { + Status error = m_gdb_client.MakeDirectory(file_spec, mode); Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM); if (log) log->Printf("PlatformRemoteGDBServer::MakeDirectory(path='%s', mode=%o) " @@ -637,9 +637,9 @@ Error PlatformRemoteGDBServer::MakeDirectory(const FileSpec &file_spec, return error; } -Error PlatformRemoteGDBServer::GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions) { - Error error = m_gdb_client.GetFilePermissions(file_spec, file_permissions); +Status PlatformRemoteGDBServer::GetFilePermissions(const FileSpec &file_spec, + uint32_t &file_permissions) { + Status error = m_gdb_client.GetFilePermissions(file_spec, file_permissions); Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM); if (log) log->Printf("PlatformRemoteGDBServer::GetFilePermissions(path='%s', " @@ -649,9 +649,9 @@ Error PlatformRemoteGDBServer::GetFilePermissions(const FileSpec &file_spec, return error; } -Error PlatformRemoteGDBServer::SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions) { - Error error = m_gdb_client.SetFilePermissions(file_spec, file_permissions); +Status PlatformRemoteGDBServer::SetFilePermissions(const FileSpec &file_spec, + uint32_t file_permissions) { + Status error = m_gdb_client.SetFilePermissions(file_spec, file_permissions); Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM); if (log) log->Printf("PlatformRemoteGDBServer::SetFilePermissions(path='%s', " @@ -663,11 +663,11 @@ Error PlatformRemoteGDBServer::SetFilePermissions(const FileSpec &file_spec, lldb::user_id_t PlatformRemoteGDBServer::OpenFile(const FileSpec &file_spec, uint32_t flags, uint32_t mode, - Error &error) { + Status &error) { return m_gdb_client.OpenFile(file_spec, flags, mode, error); } -bool PlatformRemoteGDBServer::CloseFile(lldb::user_id_t fd, Error &error) { +bool PlatformRemoteGDBServer::CloseFile(lldb::user_id_t fd, Status &error) { return m_gdb_client.CloseFile(fd, error); } @@ -678,27 +678,27 @@ PlatformRemoteGDBServer::GetFileSize(const FileSpec &file_spec) { uint64_t PlatformRemoteGDBServer::ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, uint64_t dst_len, - Error &error) { + Status &error) { return m_gdb_client.ReadFile(fd, offset, dst, dst_len, error); } uint64_t PlatformRemoteGDBServer::WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src, uint64_t src_len, - Error &error) { + Status &error) { return m_gdb_client.WriteFile(fd, offset, src, src_len, error); } -Error PlatformRemoteGDBServer::PutFile(const FileSpec &source, - const FileSpec &destination, - uint32_t uid, uint32_t gid) { +Status PlatformRemoteGDBServer::PutFile(const FileSpec &source, + const FileSpec &destination, + uint32_t uid, uint32_t gid) { return Platform::PutFile(source, destination, uid, gid); } -Error PlatformRemoteGDBServer::CreateSymlink( +Status PlatformRemoteGDBServer::CreateSymlink( const FileSpec &src, // The name of the link is in src const FileSpec &dst) // The symlink points to dst { - Error error = m_gdb_client.CreateSymlink(src, dst); + Status error = m_gdb_client.CreateSymlink(src, dst); Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM); if (log) log->Printf("PlatformRemoteGDBServer::CreateSymlink(src='%s', dst='%s') " @@ -708,8 +708,8 @@ Error PlatformRemoteGDBServer::CreateSymlink( return error; } -Error PlatformRemoteGDBServer::Unlink(const FileSpec &file_spec) { - Error error = m_gdb_client.Unlink(file_spec); +Status PlatformRemoteGDBServer::Unlink(const FileSpec &file_spec) { + Status error = m_gdb_client.Unlink(file_spec); Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM); if (log) log->Printf("PlatformRemoteGDBServer::Unlink(path='%s') error = %u (%s)", @@ -721,7 +721,7 @@ bool PlatformRemoteGDBServer::GetFileExists(const FileSpec &file_spec) { return m_gdb_client.GetFileExists(file_spec); } -Error PlatformRemoteGDBServer::RunShellCommand( +Status PlatformRemoteGDBServer::RunShellCommand( const char *command, // Shouldn't be NULL const FileSpec & working_dir, // Pass empty FileSpec to use the current working directory @@ -784,7 +784,7 @@ const UnixSignalsSP &PlatformRemoteGDBServer::GetRemoteUnixSignals() { if (!dict->GetValueForKeyAsInteger("signo", signo)) return false; - std::string name; + llvm::StringRef name; if (!dict->GetValueForKeyAsString("name", name)) return false; @@ -809,7 +809,7 @@ const UnixSignalsSP &PlatformRemoteGDBServer::GetRemoteUnixSignals() { if (object_sp && object_sp->IsValid()) description = object_sp->GetStringValue(); - remote_signals_sp->AddSignal(signo, name.c_str(), suppress, stop, + remote_signals_sp->AddSignal(signo, name.str().c_str(), suppress, stop, notify, description.c_str()); return true; }); @@ -852,7 +852,7 @@ std::string PlatformRemoteGDBServer::MakeUrl(const char *scheme, lldb::ProcessSP PlatformRemoteGDBServer::ConnectProcess( llvm::StringRef connect_url, llvm::StringRef plugin_name, lldb_private::Debugger &debugger, lldb_private::Target *target, - lldb_private::Error &error) { + lldb_private::Status &error) { if (!IsRemote() || !IsConnected()) { error.SetErrorString("Not connected to remote gdb server"); return nullptr; @@ -862,7 +862,7 @@ lldb::ProcessSP PlatformRemoteGDBServer::ConnectProcess( } size_t PlatformRemoteGDBServer::ConnectToWaitingProcesses(Debugger &debugger, - Error &error) { + Status &error) { std::vector<std::string> connection_urls; GetPendingGdbServerList(connection_urls); |