[Lldb-commits] [lldb] r131468 - /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Greg Clayton gclayton at apple.com
Tue May 17 09:50:15 PDT 2011

Author: gclayton
Date: Tue May 17 11:50:15 2011
New Revision: 131468

URL: http://llvm.org/viewvc/llvm-project?rev=131468&view=rev
Fixed an issue that broke expression parsing related to backing up
all register values. There is some junk that was appearing at the end
of the result the 'g' packet (read all register values). This function
was being called in:

GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)

Then the packet data for the 'G' packet (write all registers) was being 
placed into "data_sp" so the:

GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp)

could restore it. In attempting to clean up the extra junk at the end of this
packet data, the packet was getting truncated.


Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=131468&r1=131467&r2=131468&view=diff
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue May 17 11:50:15 2011
@@ -364,7 +364,7 @@
                     response.GetStringRef().append (thread_id_cstr);
                 const char *g_data = response.GetStringRef().c_str();
-                size_t g_data_len = strspn(g_data, "0123456789abcdefABCDEF");
+                size_t g_data_len = strspn(g_data + 1, "0123456789abcdefABCDEF");
                 if (g_data_len > 0)
                     data_sp.reset (new DataBufferHeap (g_data, g_data_len));

More information about the lldb-commits mailing list