<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Sean, Greg,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Sorry for the breakage. I probably need to find a way to test my patches on Mac.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Abid<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Sean Callanan [mailto:scallanan@apple.com]
<br>
<b>Sent:</b> 04 September 2013 23:43<br>
<b>To:</b> Abid, Hafiz; Greg Clayton<br>
<b>Cc:</b> lldb-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [Lldb-commits] [lldb] r189576 - Discover support of 'p' packet.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Greg and I have looked at this, and we may have a fix.  The patch sent an exploratory ‘p’ packet that didn’t include the required thread suffix.<o:p></o:p></p>
<div>
<p class="MsoNormal">I’m testing the patch and will commit if it turns out to be okay.<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Sean<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Sep 4, 2013, at 3:06 PM, Sean Callanan <<a href="mailto:scallanan@apple.com">scallanan@apple.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">I’ve investigated, and it looks to me like this commit breaks Mac OS X LLDB’s ability to write registers.<o:p></o:p></p>
<div>
<p class="MsoNormal">–<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[r189575]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Menlo","serif"">(lldb) reg write rdx 0x03<br>
(lldb) reg read rdx<br>
     rdx = 0x0000000000000003</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[r189576]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Menlo","serif"">(lldb) reg write rdx 0x03<br>
error: Failed to write register 'rdx' with value '0x03'</span><o:p></o:p></p>
<div>
<p class="MsoNormal">–<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Sean<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Aug 29, 2013, at 2:09 AM, Hafiz Abid Qadeer <<a href="mailto:hafiz_abid@mentor.com">hafiz_abid@mentor.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">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>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>