aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-08-31 08:43:37 +0000
committerPavel Labath <labath@google.com>2016-08-31 08:43:37 +0000
commitb9739d4090da7812e4a3ba2fccc357a76ee80bcb (patch)
tree5bc0712bb45db3a66d76b1f1aac45ff2e13de4a8 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
parentf21aade0d8d96417b4a7e25c7ddc300b0ea6d718 (diff)
downloadllvm-b9739d4090da7812e4a3ba2fccc357a76ee80bcb.zip
llvm-b9739d4090da7812e4a3ba2fccc357a76ee80bcb.tar.gz
llvm-b9739d4090da7812e4a3ba2fccc357a76ee80bcb.tar.bz2
Revert r280137 and 280139 and subsequent build fixes
The rewrite of StringExtractor::GetHexMaxU32 changes functionality in a way which makes lldb-server crash. The crash (assert) happens when parsing the "qRegisterInfo0" packet, because the function tries to drop_front more bytes than the packet contains. It's not clear to me whether we should consider this a bug in the caller or the callee, but it any case, it worked before, so I am reverting this until we can figure out what the proper interface should be. llvm-svn: 280207
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 44566c8..81c54ed 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.PeekChar() == ';')
+ if (*packet.Peek () == ';')
return SendUnimplementedResponse (packet.GetStringRef().c_str());
else
return SendIllFormedResponse (packet, "unexpected content after $C{signal-number}");
@@ -1257,8 +1257,7 @@ GDBRemoteCommunicationServerLLGS::Handle_c (StringExtractorGDBRemote &packet)
if (has_continue_address)
{
if (log)
- log->Printf("GDBRemoteCommunicationServerLLGS::%s not implemented for c{address} variant [%s remains]",
- __FUNCTION__, packet.Peek().str().c_str());
+ log->Printf ("GDBRemoteCommunicationServerLLGS::%s not implemented for c{address} variant [%s remains]", __FUNCTION__, packet.Peek ());
return SendUnimplementedResponse (packet.GetStringRef().c_str());
}
@@ -1319,13 +1318,13 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont (StringExtractorGDBRemote &packet
}
// Check if this is all continue (no options or ";c").
- if (packet.Peek() == ";c")
+ if (::strcmp (packet.Peek (), ";c") == 0)
{
// Move past the ';', then do a simple 'c'.
packet.SetFilePos (packet.GetFilePos () + 1);
return Handle_c (packet);
}
- else if (packet.Peek() == ";s")
+ else if (::strcmp (packet.Peek (), ";s") == 0)
{
// Move past the ';', then do a simple 's'.
packet.SetFilePos (packet.GetFilePos () + 1);
@@ -1342,7 +1341,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont (StringExtractorGDBRemote &packet
ResumeActionList thread_actions;
- while (packet.GetBytesLeft() && packet.PeekChar() == ';')
+ while (packet.GetBytesLeft () && *packet.Peek () == ';')
{
// Skip the semi-colon.
packet.GetChar ();
@@ -1384,7 +1383,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont (StringExtractorGDBRemote &packet
}
// Parse out optional :{thread-id} value.
- if (packet.GetBytesLeft() && packet.PeekChar() == ':')
+ if (packet.GetBytesLeft () && (*packet.Peek () == ':'))
{
// Consume the separator.
packet.GetChar ();
@@ -2927,7 +2926,7 @@ GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix (StringExtractorGDBRemote
return thread_sp;
// Parse out thread: portion.
- if (packet.Peek().startswith("thread:"))
+ if (strncmp (packet.Peek (), "thread:", strlen("thread:")) != 0)
{
if (log)
log->Printf ("GDBRemoteCommunicationServerLLGS::%s gdb-remote parse error: expected 'thread:' but not found, packet contents = '%s'", __FUNCTION__, packet.GetStringRef ().c_str ());