[Lldb-commits] [lldb] r228067 - Small fix for the "memory write -i filename" command -- if the user fails to specify the

Jason Molenda jmolenda at apple.com
Tue Feb 3 15:39:47 PST 2015


Author: jmolenda
Date: Tue Feb  3 17:39:47 2015
New Revision: 228067

URL: http://llvm.org/viewvc/llvm-project?rev=228067&view=rev
Log:
Small fix for the "memory write -i filename" command -- if the user fails to specify the
number of bytes to write into the inferior process, the "default byte size" will be 1.
In that case, we want to copy the entire file into memory.  The code was looking for
a default byte size of 0 to indicate that the user had not provided a specific # of
bytes to copy; adjust that to 1 to match the actual default value.
<rdar://problem/18074973>

Modified:
    lldb/trunk/source/Commands/CommandObjectMemory.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=228067&r1=228066&r2=228067&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Tue Feb  3 17:39:47 2015
@@ -1447,7 +1447,7 @@ protected:
         if (m_memory_options.m_infile)
         {
             size_t length = SIZE_MAX;
-            if (item_byte_size > 0)
+            if (item_byte_size > 1)
                 length = item_byte_size;
             lldb::DataBufferSP data_sp (m_memory_options.m_infile.ReadFileContents (m_memory_options.m_infile_offset, length));
             if (data_sp)





More information about the lldb-commits mailing list