summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp2
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.h2
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp12
3 files changed, 8 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index 4158e3d1e14..f362477d923 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -61,7 +61,7 @@ NativeThreadLinux::NativeThreadLinux (NativeProcessLinux *process, lldb::tid_t t
{
}
-const char *
+std::string
NativeThreadLinux::GetName()
{
NativeProcessProtocolSP process_sp = m_process_wp.lock ();
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
index 8a042f22b22..2effd849006 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
@@ -27,7 +27,7 @@ namespace lldb_private
// ---------------------------------------------------------------------
// NativeThreadProtocol Interface
// ---------------------------------------------------------------------
- const char *
+ std::string
GetName() override;
lldb::StateType
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index e3aadf1bc25..11658fe0a87 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -871,21 +871,21 @@ GDBRemoteCommunicationServer::SendStopReplyPacketForThread (lldb::tid_t tid)
response.Printf ("thread:%" PRIx64 ";", tid);
// Include the thread name if there is one.
- const char *thread_name = thread_sp->GetName ();
- if (thread_name && thread_name[0])
+ const std::string thread_name = thread_sp->GetName ();
+ if (!thread_name.empty ())
{
- size_t thread_name_len = strlen(thread_name);
+ size_t thread_name_len = thread_name.length ();
- if (::strcspn (thread_name, "$#+-;:") == thread_name_len)
+ if (::strcspn (thread_name.c_str (), "$#+-;:") == thread_name_len)
{
response.PutCString ("name:");
- response.PutCString (thread_name);
+ response.PutCString (thread_name.c_str ());
}
else
{
// The thread name contains special chars, send as hex bytes.
response.PutCString ("hexname:");
- response.PutCStringAsRawHex8 (thread_name);
+ response.PutCStringAsRawHex8 (thread_name.c_str ());
}
response.PutChar (';');
}
OpenPOWER on IntegriCloud