summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/process/TestProcessAPI.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/python_api/process/TestProcessAPI.py')
-rw-r--r--lldb/test/python_api/process/TestProcessAPI.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index c720d73b616..2c273e5b1ff 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -105,6 +105,19 @@ class ProcessAPITestCase(TestBase):
exe=False,
startstr = 'x')
+ # Read (char *)my_char_ptr.
+ val = frame.FindValue("my_char_ptr", lldb.eValueTypeVariableGlobal)
+ self.DebugSBValue(val)
+ cstring = process.ReadCStringFromMemory(val.GetValueAsUnsigned(), 256, error)
+ if not error.Success():
+ self.fail("SBProcess.ReadCStringFromMemory() failed")
+ if self.TraceOn():
+ print "cstring read is:", cstring
+
+ self.expect(cstring, "Result from SBProcess.ReadCStringFromMemory() matches our expected output",
+ exe=False,
+ startstr = 'Does it work?')
+
# Get the SBValue for the global variable 'my_cstring'.
val = frame.FindValue("my_cstring", lldb.eValueTypeVariableGlobal)
self.DebugSBValue(val)
OpenPOWER on IntegriCloud