Expose new read memory fucntion through python in SBProcess:

    size_t
    SBProcess::ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);

    uint64_t
    SBProcess::ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error);

    lldb::addr_t
    SBProcess::ReadPointerFromMemory (addr_t addr, lldb::SBError &error);

These ReadCStringFromMemory() has some SWIG type magic that makes it return the
python string directly and the "buf" is not needed:

error = SBError()
max_cstr_len = 256
cstr = lldb.process.ReadCStringFromMemory (0x1000, max_cstr_len, error)
if error.Success():
    ....

The other two functions behave as expteced. This will make it easier to get integer values
from the inferior process that are correctly byte swapped. Also for pointers, the correct
pointer byte size will be used.

Also cleaned up a few printf style warnings for the 32 bit lldb build on darwin.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146636 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index a138f59..fdd6b17 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -1856,11 +1856,12 @@
 
 
 size_t
-Process::ReadCStringFromMemory (addr_t addr, char *dst, size_t dst_max_len)
+Process::ReadCStringFromMemory (addr_t addr, char *dst, size_t dst_max_len, Error &result_error)
 {
     size_t total_cstr_len = 0;
     if (dst && dst_max_len)
     {
+        result_error.Clear();
         // NULL out everything just to be safe
         memset (dst, 0, dst_max_len);
         Error error;
@@ -1877,6 +1878,7 @@
             
             if (bytes_read == 0)
             {
+                result_error = error;
                 dst[total_cstr_len] = '\0';
                 break;
             }
@@ -1892,6 +1894,13 @@
             bytes_left -= bytes_read;
         }
     }
+    else
+    {
+        if (dst == NULL)
+            result_error.SetErrorString("invalid arguments");
+        else
+            result_error.Clear();
+    }
     return total_cstr_len;
 }