summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp4
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp5
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp12
3 files changed, 10 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 555ae461b1c..40279fe8584 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -3240,7 +3240,7 @@ GDBRemoteCommunicationClient::ReadFile (lldb::user_id_t fd,
uint32_t retcode = response.GetHexMaxU32(false, UINT32_MAX);
if (retcode == UINT32_MAX)
return retcode;
- const char next = (response.Peek() ? *response.Peek() : 0);
+ const char next = (response.GetBytesLeft() ? response.PeekChar() : 0);
if (next == ',')
return 0;
if (next == ';')
@@ -3428,7 +3428,7 @@ GDBRemoteCommunicationClient::CalculateMD5 (const lldb_private::FileSpec& file_s
return false;
if (response.GetChar() != ',')
return false;
- if (response.Peek() && *response.Peek() == 'x')
+ if (response.GetBytesLeft() && response.PeekChar() == 'x')
return false;
low = response.GetHexMaxU64(false, UINT64_MAX);
high = response.GetHexMaxU64(false, UINT64_MAX);
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();
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 81c54edd388..89d5f38ca81 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -1186,7 +1186,7 @@ GDBRemoteCommunicationServerLLGS::Handle_C (StringExtractorGDBRemote &packet)
if (packet.GetBytesLeft () > 0)
{
// FIXME add continue at address support for $C{signo}[;{continue-address}].
- if (*packet.Peek () == ';')
+ if (packet.PeekChar() == ';')
return SendUnimplementedResponse (packet.GetStringRef().c_str());
else
return SendIllFormedResponse (packet, "unexpected content after $C{signal-number}");
@@ -1318,13 +1318,13 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont (StringExtractorGDBRemote &packet
}
// Check if this is all continue (no options or ";c").
- if (::strcmp (packet.Peek (), ";c") == 0)
+ if (packet.Peek() == ";c")
{
// Move past the ';', then do a simple 'c'.
packet.SetFilePos (packet.GetFilePos () + 1);
return Handle_c (packet);
}
- else if (::strcmp (packet.Peek (), ";s") == 0)
+ else if (packet.Peek() == ";s")
{
// Move past the ';', then do a simple 's'.
packet.SetFilePos (packet.GetFilePos () + 1);
@@ -1341,7 +1341,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont (StringExtractorGDBRemote &packet
ResumeActionList thread_actions;
- while (packet.GetBytesLeft () && *packet.Peek () == ';')
+ while (packet.GetBytesLeft() && packet.PeekChar() == ';')
{
// Skip the semi-colon.
packet.GetChar ();
@@ -1383,7 +1383,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont (StringExtractorGDBRemote &packet
}
// Parse out optional :{thread-id} value.
- if (packet.GetBytesLeft () && (*packet.Peek () == ':'))
+ if (packet.GetBytesLeft() && packet.PeekChar() == ':')
{
// Consume the separator.
packet.GetChar ();
@@ -2926,7 +2926,7 @@ GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix (StringExtractorGDBRemote
return thread_sp;
// Parse out thread: portion.
- if (strncmp (packet.Peek (), "thread:", strlen("thread:")) != 0)
+ if (packet.Peek().startswith("thread:"))
{
if (log)
log->Printf ("GDBRemoteCommunicationServerLLGS::%s gdb-remote parse error: expected 'thread:' but not found, packet contents = '%s'", __FUNCTION__, packet.GetStringRef ().c_str ());
OpenPOWER on IntegriCloud