summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-17 21:15:14 +0000
committerZachary Turner <zturner@google.com>2016-11-17 21:15:14 +0000
commit3165945a419e4882b94f73f005f9ea4d3d10a985 (patch)
treef8ecba9330545a9f0fa01053d2d237c46d85319f /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parentca9d83475e94b3b1649f6f76b4cd6c345ea0404b (diff)
downloadbcm5719-llvm-3165945a419e4882b94f73f005f9ea4d3d10a985.tar.gz
bcm5719-llvm-3165945a419e4882b94f73f005f9ea4d3d10a985.zip
Convert Platform, Process, and Connection functions to StringRef.
All tests pass on Linux and Windows. llvm-svn: 287259
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 3761f06628a..876af4ffdce 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -651,7 +651,8 @@ Error ProcessGDBRemote::WillAttachToProcessWithName(const char *process_name,
return WillLaunchOrAttach();
}
-Error ProcessGDBRemote::DoConnectRemote(Stream *strm, const char *remote_url) {
+Error ProcessGDBRemote::DoConnectRemote(Stream *strm,
+ llvm::StringRef remote_url) {
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
Error error(WillLaunchOrAttach());
@@ -695,15 +696,15 @@ Error ProcessGDBRemote::DoConnectRemote(Stream *strm, const char *remote_url) {
if (state != eStateInvalid) {
SetPrivateState(state);
} else
- error.SetErrorStringWithFormat("Process %" PRIu64
- " was reported after connecting to "
- "'%s', but state was not stopped: %s",
- pid, remote_url, StateAsCString(state));
+ error.SetErrorStringWithFormat(
+ "Process %" PRIu64 " was reported after connecting to "
+ "'%s', but state was not stopped: %s",
+ pid, remote_url.str().c_str(), StateAsCString(state));
} else
error.SetErrorStringWithFormat("Process %" PRIu64
" was reported after connecting to '%s', "
"but no stop reply packet was received",
- pid, remote_url);
+ pid, remote_url.str().c_str());
}
if (log)
@@ -963,15 +964,15 @@ Error ProcessGDBRemote::DoLaunch(Module *exe_module,
return error;
}
-Error ProcessGDBRemote::ConnectToDebugserver(const char *connect_url) {
+Error ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) {
Error error;
// Only connect if we have a valid connect URL
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
- if (connect_url && connect_url[0]) {
+ if (!connect_url.empty()) {
if (log)
log->Printf("ProcessGDBRemote::%s Connecting to %s", __FUNCTION__,
- connect_url);
+ connect_url.str().c_str());
std::unique_ptr<ConnectionFileDescriptor> conn_ap(
new ConnectionFileDescriptor());
if (conn_ap.get()) {
@@ -3353,7 +3354,7 @@ Error ProcessGDBRemote::LaunchAndConnectToDebugserver(
if (m_gdb_comm.IsConnected()) {
// Finish the connection process by doing the handshake without connecting
// (send NULL URL)
- ConnectToDebugserver(NULL);
+ ConnectToDebugserver("");
} else {
error.SetErrorString("connection failed");
}
OpenPOWER on IntegriCloud