summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-12 04:51:55 +0000
committerZachary Turner <zturner@google.com>2017-05-12 04:51:55 +0000
commit97206d572797bddc1bba71bb1c18c97f19d69053 (patch)
treefdf21d24485672cf97c800264d135b9d5d2ecdce /lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
parent3086b45a2fae833e8419885e78c598d936cc6429 (diff)
downloadbcm5719-llvm-97206d572797bddc1bba71bb1c18c97f19d69053.tar.gz
bcm5719-llvm-97206d572797bddc1bba71bb1c18c97f19d69053.zip
Rename Error -> Status.
This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
Diffstat (limited to 'lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp')
-rw-r--r--lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
index 034518c1d2e..dbc74833e28 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -10,8 +10,8 @@
// Other libraries and framework includes
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/common/TCPSocket.h"
-#include "lldb/Utility/Error.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Status.h"
#include "lldb/Utility/UriParser.h"
#include "PlatformAndroidRemoteGDBServer.h"
@@ -25,7 +25,7 @@ using namespace platform_android;
static const lldb::pid_t g_remote_platform_pid =
0; // Alias for the process id of lldb-platform
-static Error ForwardPortWithAdb(
+static Status ForwardPortWithAdb(
const uint16_t local_port, const uint16_t remote_port,
llvm::StringRef remote_socket_name,
const llvm::Optional<AdbClient::UnixSocketNamespace> &socket_namespace,
@@ -53,20 +53,20 @@ static Error ForwardPortWithAdb(
remote_socket_name.str().c_str(), local_port);
if (!socket_namespace)
- return Error("Invalid socket namespace");
+ return Status("Invalid socket namespace");
return adb.SetPortForwarding(local_port, remote_socket_name,
*socket_namespace);
}
-static Error DeleteForwardPortWithAdb(uint16_t local_port,
- const std::string &device_id) {
+static Status DeleteForwardPortWithAdb(uint16_t local_port,
+ const std::string &device_id) {
AdbClient adb(device_id);
return adb.DeletePortForwarding(local_port);
}
-static Error FindUnusedPort(uint16_t &port) {
- Error error;
+static Status FindUnusedPort(uint16_t &port) {
+ Status error;
std::unique_ptr<TCPSocket> tcp_socket(new TCPSocket(true, false));
if (error.Fail())
return error;
@@ -107,19 +107,20 @@ bool PlatformAndroidRemoteGDBServer::KillSpawnedProcess(lldb::pid_t pid) {
return m_gdb_client.KillSpawnedProcess(pid);
}
-Error PlatformAndroidRemoteGDBServer::ConnectRemote(Args &args) {
+Status PlatformAndroidRemoteGDBServer::ConnectRemote(Args &args) {
m_device_id.clear();
if (args.GetArgumentCount() != 1)
- return Error("\"platform connect\" takes a single argument: <connect-url>");
+ return Status(
+ "\"platform connect\" takes a single argument: <connect-url>");
int remote_port;
llvm::StringRef scheme, host, path;
const char *url = args.GetArgumentAtIndex(0);
if (!url)
- return Error("URL is null.");
+ return Status("URL is null.");
if (!UriParser::Parse(url, scheme, host, remote_port, path))
- return Error("Invalid URL: %s", url);
+ return Status("Invalid URL: %s", url);
if (host != "localhost")
m_device_id = host;
@@ -150,7 +151,7 @@ Error PlatformAndroidRemoteGDBServer::ConnectRemote(Args &args) {
return error;
}
-Error PlatformAndroidRemoteGDBServer::DisconnectRemote() {
+Status PlatformAndroidRemoteGDBServer::DisconnectRemote() {
DeleteForwardPort(g_remote_platform_pid);
return PlatformRemoteGDBServer::DisconnectRemote();
}
@@ -173,12 +174,12 @@ void PlatformAndroidRemoteGDBServer::DeleteForwardPort(lldb::pid_t pid) {
m_port_forwards.erase(it);
}
-Error PlatformAndroidRemoteGDBServer::MakeConnectURL(
+Status PlatformAndroidRemoteGDBServer::MakeConnectURL(
const lldb::pid_t pid, const uint16_t remote_port,
llvm::StringRef remote_socket_name, std::string &connect_url) {
static const int kAttempsNum = 5;
- Error error;
+ Status error;
// There is a race possibility that somebody will occupy
// a port while we're in between FindUnusedPort and ForwardPortWithAdb -
// adding the loop to mitigate such problem.
@@ -205,7 +206,7 @@ Error PlatformAndroidRemoteGDBServer::MakeConnectURL(
lldb::ProcessSP PlatformAndroidRemoteGDBServer::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) {
// We don't have the pid of the remote gdbserver when it isn't started by us
// but we still want
// to store the list of port forwards we set up in our port forward map.
OpenPOWER on IntegriCloud