From 2d240d00dabf49c7688a4f564adc410dae187500 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 30 Aug 2016 19:47:05 +0000 Subject: A few minor stylistic cleanups in StringExtractor. Makes Peek() return a StringRef instead of a const char*. This leads to a few callers of Peek() being able to be made a little nicer (for example using StringRef member functions instead of c-style strncmp and related functions) and generally safer usage. llvm-svn: 280139 --- .../Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 3361ffaeea7..5641b22b707 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -966,7 +966,7 @@ GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded (StringExtract { std::string str; packet.GetHexByteString(str); - m_process_launch_info.GetEnvironmentEntries().AppendArgument(str.c_str()); + m_process_launch_info.GetEnvironmentEntries().AppendArgument(str); return SendOKResponse(); } return SendErrorResponse(12); @@ -979,8 +979,7 @@ GDBRemoteCommunicationServerCommon::Handle_QLaunchArch (StringExtractorGDBRemote const uint32_t bytes_left = packet.GetBytesLeft(); if (bytes_left > 0) { - const char* arch_triple = packet.Peek(); - ArchSpec arch_spec(arch_triple,NULL); + ArchSpec arch_spec(packet.Peek(), nullptr); m_process_launch_info.SetArchitecture(arch_spec); return SendOKResponse(); } -- cgit v1.2.3