<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Johnny,<div>yes apparently we merged the same patch unaware of one another's effort.</div><div>Luckily, looking at the code, it looks like my double merge has not resulted in a double definition of the relevant code snippet.</div><div>I guess not a big deal this one time, but I will make sure to synchronize with you about merging from TOT into the platform branch in the future.</div><div><br></div><div>Have a nice weekend.</div><div><br><div>
<div><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><i>Enrico Granata</i></div><div style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">✉ egranata@<font class="Apple-style-span" color="#ff230e"></font>.com</div><div>✆ (four oh eight) 862-7683</div><div><br></div></div></div></span></div></span></div></span></div></span></span></div></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On Apr 7, 2012, at 2:46 PM, Johnny Chen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Enrico,<br><br>Were you importing the same patch for StringExtractor that I've merged previously?<br>Please check.<br><br>Sent from my iPad<br><br>On Apr 6, 2012, at 6:40 PM, Enrico Granata <<a href="mailto:egranata@apple.com">egranata@apple.com</a>> wrote:<br><br><blockquote type="cite">Author: enrico<br></blockquote><blockquote type="cite">Date: Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">New Revision: 154244<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=154244&view=rev">http://llvm.org/viewvc/llvm-project?rev=154244&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Fixing several issues with the first version of the file I/O commands - importing Greg's patch to mainline StringExtractor into the branch<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite"> lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp<br></blockquote><blockquote type="cite"> lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp<br></blockquote><blockquote type="cite"> lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br></blockquote><blockquote type="cite"> lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp<br></blockquote><blockquote type="cite"> lldb/branches/lldb-platform-work/source/Utility/StringExtractor.cpp<br></blockquote><blockquote type="cite"> lldb/branches/lldb-platform-work/source/Utility/StringExtractor.h<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp?rev=154244&r1=154243&r2=154244&view=diff">http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp?rev=154244&r1=154243&r2=154244&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp (original)<br></blockquote><blockquote type="cite">+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">@@ -327,6 +327,7 @@<br></blockquote><blockquote type="cite"> {<br></blockquote><blockquote type="cite"> std::string cmd_line;<br></blockquote><blockquote type="cite"> args.GetCommandString(cmd_line);<br></blockquote><blockquote type="cite">+ // TODO: make permissions safer<br></blockquote><blockquote type="cite"> uint32_t retcode = platform_sp->OpenFile(FileSpec(cmd_line.c_str(),false),0x0200 | 0x0002, 0000700 | 0000070 | 0000007);<br></blockquote><blockquote type="cite"> result.AppendMessageWithFormat("Status = %d\n",retcode);<br></blockquote><blockquote type="cite"> result.SetStatus (eReturnStatusSuccessFinishResult);<br></blockquote><blockquote type="cite">@@ -412,10 +413,10 @@<br></blockquote><blockquote type="cite"> std::string cmd_line;<br></blockquote><blockquote type="cite"> args.GetCommandString(cmd_line);<br></blockquote><blockquote type="cite"> uint32_t fd = ::atoi(cmd_line.c_str());<br></blockquote><blockquote type="cite">- std::string buffer(m_options.m_count,' ');<br></blockquote><blockquote type="cite">+ std::string buffer(m_options.m_count,0);<br></blockquote><blockquote type="cite"> uint32_t retcode = platform_sp->ReadFile(fd, m_options.m_offset, &buffer[0], m_options.m_count);<br></blockquote><blockquote type="cite"> result.AppendMessageWithFormat("Return = %d\n",retcode);<br></blockquote><blockquote type="cite">- result.AppendMessageWithFormat("Data = %s\n",buffer.c_str());<br></blockquote><blockquote type="cite">+ result.AppendMessageWithFormat("Data = \"%s\"\n",buffer.c_str());<br></blockquote><blockquote type="cite"> result.SetStatus (eReturnStatusSuccessFinishResult);<br></blockquote><blockquote type="cite"> }<br></blockquote><blockquote type="cite"> else<br></blockquote><blockquote type="cite">@@ -583,7 +584,7 @@<br></blockquote><blockquote type="cite"> if (!success)<br></blockquote><blockquote type="cite"> error.SetErrorStringWithFormat("invalid offset: '%s'", option_arg);<br></blockquote><blockquote type="cite"> break;<br></blockquote><blockquote type="cite">- case 's':<br></blockquote><blockquote type="cite">+ case 'd':<br></blockquote><blockquote type="cite"> m_data.assign(option_arg);<br></blockquote><blockquote type="cite"> break;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=154244&r1=154243&r2=154244&view=diff">http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=154244&r1=154243&r2=154244&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)<br></blockquote><blockquote type="cite">+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">@@ -38,7 +38,11 @@<br></blockquote><blockquote type="cite"> const char *listener_name, <br></blockquote><blockquote type="cite"> bool is_platform) :<br></blockquote><blockquote type="cite"> Communication(comm_name),<br></blockquote><blockquote type="cite">+#ifdef LLDB_CONFIGURATION_DEBUG<br></blockquote><blockquote type="cite">+ m_packet_timeout (1000),<br></blockquote><blockquote type="cite">+#else<br></blockquote><blockquote type="cite"> m_packet_timeout (1),<br></blockquote><blockquote type="cite">+#endif<br></blockquote><blockquote type="cite"> m_sequence_mutex (Mutex::eMutexTypeRecursive),<br></blockquote><blockquote type="cite"> m_public_is_running (false),<br></blockquote><blockquote type="cite"> m_private_is_running (false),<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=154244&r1=154243&r2=154244&view=diff">http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=154244&r1=154243&r2=154244&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)<br></blockquote><blockquote type="cite">+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">@@ -1969,7 +1969,7 @@<br></blockquote><blockquote type="cite"> void *data_ptr, size_t len)<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite"> lldb_private::StreamString stream;<br></blockquote><blockquote type="cite">- stream.PutCString("vFile:read:");<br></blockquote><blockquote type="cite">+ stream.PutCString("vFile:pread:");<br></blockquote><blockquote type="cite"> stream.PutHex32(fd);<br></blockquote><blockquote type="cite"> stream.PutChar(',');<br></blockquote><blockquote type="cite"> stream.PutHex32(len);<br></blockquote><blockquote type="cite">@@ -1985,10 +1985,12 @@<br></blockquote><blockquote type="cite"> uint32_t retcode = response.GetHexMaxU32(false, UINT32_MAX);<br></blockquote><blockquote type="cite"> if (retcode == UINT32_MAX)<br></blockquote><blockquote type="cite"> return retcode;<br></blockquote><blockquote type="cite">- if (response.GetChar() == ',')<br></blockquote><blockquote type="cite">+ const char next = (response.Peek() ? *response.Peek() : 0);<br></blockquote><blockquote type="cite">+ if (next == ',')<br></blockquote><blockquote type="cite"> return UINT32_MAX;<br></blockquote><blockquote type="cite">- if (response.GetChar() == ';')<br></blockquote><blockquote type="cite">+ if (next == ';')<br></blockquote><blockquote type="cite"> {<br></blockquote><blockquote type="cite">+ response.GetChar(); // skip the semicolon<br></blockquote><blockquote type="cite"> std::string buffer;<br></blockquote><blockquote type="cite"> response.GetEscapedBinaryData(buffer);<br></blockquote><blockquote type="cite"> size_t data_to_write = len;<br></blockquote><blockquote type="cite">@@ -2006,7 +2008,7 @@<br></blockquote><blockquote type="cite"> void* data, size_t len)<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite"> lldb_private::StreamGDBRemote stream;<br></blockquote><blockquote type="cite">- stream.PutCString("vFile:write:");<br></blockquote><blockquote type="cite">+ stream.PutCString("vFile:pwrite:");<br></blockquote><blockquote type="cite"> stream.PutHex32(fd);<br></blockquote><blockquote type="cite"> stream.PutChar(',');<br></blockquote><blockquote type="cite"> stream.PutHex32(offset);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=154244&r1=154243&r2=154244&view=diff">http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=154244&r1=154243&r2=154244&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)<br></blockquote><blockquote type="cite">+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">@@ -886,7 +886,9 @@<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite"> packet.SetFilePos(::strlen("vFile:open:"));<br></blockquote><blockquote type="cite"> std::string path;<br></blockquote><blockquote type="cite">- packet.GetHexByteString(path);<br></blockquote><blockquote type="cite">+ packet.GetHexByteStringTerminatedBy(path,',');<br></blockquote><blockquote type="cite">+ if (path.size() == 0)<br></blockquote><blockquote type="cite">+ return false;<br></blockquote><blockquote type="cite"> if (packet.GetChar() != ',')<br></blockquote><blockquote type="cite"> return false;<br></blockquote><blockquote type="cite"> uint32_t flags = packet.GetHexMaxU32(false, UINT32_MAX);<br></blockquote><blockquote type="cite">@@ -945,7 +947,7 @@<br></blockquote><blockquote type="cite"> SendPacket(response);<br></blockquote><blockquote type="cite"> return true;<br></blockquote><blockquote type="cite"> }<br></blockquote><blockquote type="cite">- std::string buffer(' ',count);<br></blockquote><blockquote type="cite">+ std::string buffer(count, 0);<br></blockquote><blockquote type="cite"> uint32_t retcode = Host::ReadFile(fd, offset, &buffer[0], count);<br></blockquote><blockquote type="cite"> response.PutChar('F');<br></blockquote><blockquote type="cite"> response.PutHex32(retcode);<br></blockquote><blockquote type="cite">@@ -971,6 +973,8 @@<br></blockquote><blockquote type="cite"> if (packet.GetChar() != ',')<br></blockquote><blockquote type="cite"> return false;<br></blockquote><blockquote type="cite"> uint32_t offset = packet.GetHexMaxU32(false, UINT32_MAX);<br></blockquote><blockquote type="cite">+ if (packet.GetChar() != ',')<br></blockquote><blockquote type="cite">+ return false;<br></blockquote><blockquote type="cite"> std::string buffer;<br></blockquote><blockquote type="cite"> packet.GetEscapedBinaryData(buffer);<br></blockquote><blockquote type="cite"> uint32_t retcode = Host::WriteFile(fd, offset, &buffer[0], buffer.size());<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: lldb/branches/lldb-platform-work/source/Utility/StringExtractor.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Utility/StringExtractor.cpp?rev=154244&r1=154243&r2=154244&view=diff">http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Utility/StringExtractor.cpp?rev=154244&r1=154243&r2=154244&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- lldb/branches/lldb-platform-work/source/Utility/StringExtractor.cpp (original)<br></blockquote><blockquote type="cite">+++ lldb/branches/lldb-platform-work/source/Utility/StringExtractor.cpp Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">@@ -361,6 +361,20 @@<br></blockquote><blockquote type="cite"> return str.size();<br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+size_t<br></blockquote><blockquote type="cite">+StringExtractor::GetHexByteStringTerminatedBy (std::string &str,<br></blockquote><blockquote type="cite">+ char terminator)<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+ str.clear();<br></blockquote><blockquote type="cite">+ char ch;<br></blockquote><blockquote type="cite">+ while ((ch = GetHexU8(0,false)) != '\0')<br></blockquote><blockquote type="cite">+ str.append(1, ch);<br></blockquote><blockquote type="cite">+ if (Peek() && *Peek() == terminator)<br></blockquote><blockquote type="cite">+ return str.size();<br></blockquote><blockquote type="cite">+ str.clear();<br></blockquote><blockquote type="cite">+ return str.size();<br></blockquote><blockquote type="cite">+}<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">bool<br></blockquote><blockquote type="cite">StringExtractor::GetNameColonValue (std::string &name, std::string &value)<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: lldb/branches/lldb-platform-work/source/Utility/StringExtractor.h<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Utility/StringExtractor.h?rev=154244&r1=154243&r2=154244&view=diff">http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Utility/StringExtractor.h?rev=154244&r1=154243&r2=154244&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- lldb/branches/lldb-platform-work/source/Utility/StringExtractor.h (original)<br></blockquote><blockquote type="cite">+++ lldb/branches/lldb-platform-work/source/Utility/StringExtractor.h Fri Apr 6 20:40:39 2012<br></blockquote><blockquote type="cite">@@ -116,6 +116,10 @@<br></blockquote><blockquote type="cite"> size_t<br></blockquote><blockquote type="cite"> GetHexByteString (std::string &str);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+ size_t<br></blockquote><blockquote type="cite">+ GetHexByteStringTerminatedBy (std::string &str,<br></blockquote><blockquote type="cite">+ char terminator);<br></blockquote><blockquote type="cite">+ <br></blockquote><blockquote type="cite"> const char *<br></blockquote><blockquote type="cite"> Peek ()<br></blockquote><blockquote type="cite"> {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">lldb-commits mailing list<br></blockquote><blockquote type="cite"><a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br></blockquote><blockquote type="cite"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br></blockquote></div></blockquote></div><br></div></body></html>