summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-03-02 19:49:27 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-03-02 19:49:27 +0000
commit4e90a7e503d3e904dafaecc9de2ec70043d0a27d (patch)
tree04d74e49c01514df0ce19ab3c6e428007a28c645 /lldb/test/python_api
parent1cd4459b21fb0d00d73adbe820ac354334c9e227 (diff)
downloadbcm5719-llvm-4e90a7e503d3e904dafaecc9de2ec70043d0a27d.tar.gz
bcm5719-llvm-4e90a7e503d3e904dafaecc9de2ec70043d0a27d.zip
Add some comments.
llvm-svn: 126867
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/process/TestProcessAPI.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index 615668b115e..fd8b229553e 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -174,7 +174,9 @@ class ProcessAPITestCase(TestBase):
# OK, let's get the hex location of the variable.
location = int(val.GetLocation(frame), 16)
+ # Note that the canonical from of the bytearray is little endian.
from lldbutil import int_to_bytearray, bytearray_to_int
+
byteSize = val.GetByteSize()
bytes = int_to_bytearray(256, byteSize)
@@ -208,6 +210,8 @@ class ProcessAPITestCase(TestBase):
content = self.process.ReadMemory(location, byteSize, error)
if not error.Success():
self.fail("SBProcess.ReadMemory() failed")
+
+ # Use "ascii" as the encoding because each element of 'content' is in the range [0..255].
new_bytes = bytearray(content, "ascii")
# The bytearray_to_int utility function expects a little endian bytearray.
OpenPOWER on IntegriCloud