<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>This patch moves the creation functions into SBData and adds corresponding Set functions like Greg suggested.</div><div>The SBData test case is also updated to reflect the new code layout.</div><div><br><div apple-content-edited="true">
<div>-<span class="Apple-converted-space"> </span><i>Enrico Granata</i></div>
</div>
<br><div><div>On Jan 6, 2012, at 2:16 AM, Greg Clayton wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>The functions that were added to the SBProcess seem like they should be been moved to the SBData class. The only thing the process is used for is the byte order and address byte size, which no one is using. <br><br>It seems like these should be moved to SBData as static "Create" and "SetData" fucntions and an extra parameter should be added for the byte order and address byte size:<br><br>class SBData<br>{<br><br>.....<br><br>    static lldb::SBData CreateFromCString (const char* data);<br>    static lldb::SBData CreateDataFromUInt64Array (lldb::ByteOrder endian, uint32_t addr_byte_size, uint64_t* array, size_t array_len);<br>    static lldb::SBData CreateDataFromUInt32Array (lldb::ByteOrder endian, uint32_t addr_byte_size, uint32_t* array, size_t array_len);<br>    static lldb::SBData CreateDataFromSInt64Array (lldb::ByteOrder endian, uint32_t addr_byte_size, int64_t* array, size_t array_len);<br>    static lldb::SBData CreateDataFromSInt32Array (lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t* array, size_t array_len);<br>    static lldb::SBData CreateDataFromDoubleArray (lldb::ByteOrder endian, uint32_t addr_byte_size, double* array, size_t array_len);<br><br>    void SetDataFromCString (const char* data);<br>    void SetDataFromUInt64Array (uint64_t* array, size_t array_len);<br>    void SetDataFromUInt32Array (uint32_t* array, size_t array_len);<br>    void SetDataFromSInt64Array (int64_t* array, size_t array_len);<br>    void SetDataFromSInt32Array (int32_t* array, size_t array_len);<br>    void SetDataFromDoubleArray (double* array, size_t array_len);<br><br><br><br>The data could add a "void SetByteOrder(lldb::ByteOrder byte_order);" accessor if needed<br><br>The use of process is not really neededed as you can also do:<br><br>data = lldb.SBData (lldb.process.GetByteOrder(), ...)<br><br>We don't want require having a process before we can make SBData objects filled with bytes.<br><br>Greg<br><br>On Jan 5, 2012, at 4:46 PM, Johnny Chen wrote:<br><br><blockquote type="cite">Author: johnny<br></blockquote><blockquote type="cite">Date: Thu Jan  5 18:46:12 2012<br></blockquote><blockquote type="cite">New Revision: 147639<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=147639&view=rev">http://llvm.org/viewvc/llvm-project?rev=147639&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite"><a href="http://llvm.org/bugs/show_bug.cgi?id=11619">http://llvm.org/bugs/show_bug.cgi?id=11619</a><br></blockquote><blockquote type="cite">Allow creating SBData values from arrays or primitives in Python<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Patch submitted by Enrico Granata.<br></blockquote></div></blockquote><br></div><div><br></div><br></div></body></html>