<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I’ve investigated, and it looks to me like this commit breaks Mac OS X LLDB’s ability to write registers.<div>–</div><div>[r189575]</div><div><font face="Menlo">(lldb) reg write rdx 0x03<br>(lldb) reg read rdx<br>     rdx = 0x0000000000000003</font><br></div><div><br></div><div>[r189576]</div><div><font face="Menlo">(lldb) reg write rdx 0x03<br>error: Failed to write register 'rdx' with value '0x03'</font><br><div>–</div><div>We should figure out what’s going on or roll this back as soon as possible, because that breaks the expression command on OS X among other things.</div><div><br><div>
<div>Sean</div>

</div>
<br><div><div>On Aug 29, 2013, at 2:09 AM, Hafiz Abid Qadeer <<a href="mailto:hafiz_abid@mentor.com">hafiz_abid@mentor.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: abidh<br>Date: Thu Aug 29 04:09:45 2013<br>New Revision: 189576<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=189576&view=rev">http://llvm.org/viewvc/llvm-project?rev=189576&view=rev</a><br>Log:<br>Discover support of 'p' packet.<br><br>Some stubs only support g/G packets for registers.<br>This change makes sure that we check if remote stub supports 'p' packet before using it.<br><br>Modified:<br>    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h<br>    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp<br><br>Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=189576&r1=189575&r2=189576&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=189576&r1=189575&r2=189576&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)<br>+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Aug 29 04:09:45 2013<br>@@ -55,6 +55,7 @@ GDBRemoteCommunicationClient::GDBRemoteC<br>     m_supports_vCont_C (eLazyBoolCalculate),<br>     m_supports_vCont_s (eLazyBoolCalculate),<br>     m_supports_vCont_S (eLazyBoolCalculate),<br>+    m_supports_p (eLazyBoolCalculate),<br>     m_qHostInfo_is_valid (eLazyBoolCalculate),<br>     m_qProcessInfo_is_valid (eLazyBoolCalculate),<br>     m_supports_alloc_dealloc_memory (eLazyBoolCalculate),<br>@@ -200,6 +201,7 @@ GDBRemoteCommunicationClient::ResetDisco<br>     m_supports_vCont_C = eLazyBoolCalculate;<br>     m_supports_vCont_s = eLazyBoolCalculate;<br>     m_supports_vCont_S = eLazyBoolCalculate;<br>+    m_supports_p = eLazyBoolCalculate;<br>     m_qHostInfo_is_valid = eLazyBoolCalculate;<br>     m_qProcessInfo_is_valid = eLazyBoolCalculate;<br>     m_supports_alloc_dealloc_memory = eLazyBoolCalculate;<br>@@ -295,6 +297,24 @@ GDBRemoteCommunicationClient::GetVContSu<br>     return false;<br> }<br><br>+// Check if the target supports 'p' packet. It sends out a 'p'<br>+// packet and checks the response. A normal packet will tell us<br>+// that support is available.<br>+bool<br>+GDBRemoteCommunicationClient::GetpPacketSupported ()<br>+{<br>+    if (m_supports_p == eLazyBoolCalculate)<br>+    {<br>+        StringExtractorGDBRemote response;<br>+        m_supports_p = eLazyBoolNo;<br>+        if (SendPacketAndWaitForResponse("p0", response, false))<br>+        {<br>+            if (response.IsNormalResponse())<br>+                m_supports_p = eLazyBoolYes;<br>+        }<br>+    }<br>+    return m_supports_p;<br>+}<br><br> size_t<br> GDBRemoteCommunicationClient::SendPacketAndWaitForResponse<br><br>Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=189576&r1=189575&r2=189576&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=189576&r1=189575&r2=189576&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)<br>+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Thu Aug 29 04:09:45 2013<br>@@ -228,6 +228,9 @@ public:<br>     GetVContSupported (char flavor);<br><br>     bool<br>+    GetpPacketSupported ();<br>+<br>+    bool<br>     GetVAttachOrWaitSupported ();<br><br>     bool<br>@@ -431,6 +434,7 @@ protected:<br>     lldb_private::LazyBool m_watchpoints_trigger_after_instruction;<br>     lldb_private::LazyBool m_attach_or_wait_reply;<br>     lldb_private::LazyBool m_prepare_for_reg_writing_reply;<br>+    lldb_private::LazyBool m_supports_p;<br><br>     bool<br>         m_supports_qProcessInfoPID:1,<br><br>Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=189576&r1=189575&r2=189576&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=189576&r1=189575&r2=189576&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp (original)<br>+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp Thu Aug 29 04:09:45 2013<br>@@ -164,7 +164,6 @@ lldb::RegisterContextSP<br> ThreadGDBRemote::CreateRegisterContextForFrame (StackFrame *frame)<br> {<br>     lldb::RegisterContextSP reg_ctx_sp;<br>-    const bool read_all_registers_at_once = false;<br>     uint32_t concrete_frame_idx = 0;<br><br>     if (frame)<br>@@ -177,6 +176,8 @@ ThreadGDBRemote::CreateRegisterContextFo<br>         if (process_sp)<br>         {<br>             ProcessGDBRemote *gdb_process = static_cast<ProcessGDBRemote *>(process_sp.get());<br>+            // read_all_registers_at_once will be true if 'p' packet is not supported.<br>+            bool read_all_registers_at_once = !gdb_process->GetGDBRemote().GetpPacketSupported ();<br>             reg_ctx_sp.reset (new GDBRemoteRegisterContext (*this, concrete_frame_idx, gdb_process->m_register_info, read_all_registers_at_once));<br>         }<br>     }<br><br><br>_______________________________________________<br>lldb-commits mailing list<br><a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits<br></blockquote></div><br></div></div></body></html>