aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-08-30 19:47:05 +0000
committerZachary Turner <zturner@google.com>2016-08-30 19:47:05 +0000
commit2d240d00dabf49c7688a4f564adc410dae187500 (patch)
tree3697e3c6d2aead0de6b31a782e8c9eccdda20c52 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent0af717970c1f023e8ac327aa5ecde6c369b069db (diff)
downloadllvm-2d240d00dabf49c7688a4f564adc410dae187500.zip
llvm-2d240d00dabf49c7688a4f564adc410dae187500.tar.gz
llvm-2d240d00dabf49c7688a4f564adc410dae187500.tar.bz2
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
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 555ae46..40279fe 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);