diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-12-16 00:25:30 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-12-16 00:25:30 +0000 |
| commit | e7e8af807a0a36b109ec1dea7b77224bc610b6f8 (patch) | |
| tree | d0cbe2772b59841676519d14058825cc1debe6b8 /lldb/test/python_api/process | |
| parent | caa69f057058e5d05a3175d73b8664de76f2e5a2 (diff) | |
| download | bcm5719-llvm-e7e8af807a0a36b109ec1dea7b77224bc610b6f8.tar.gz bcm5719-llvm-e7e8af807a0a36b109ec1dea7b77224bc610b6f8.zip | |
Add a test sequence of SBProcess.ReadCStringFromMemory() with (char *)my_char_ptr as the address to read from.
char *my_char_ptr = (char *)"Does it work?";
llvm-svn: 146716
Diffstat (limited to 'lldb/test/python_api/process')
| -rw-r--r-- | lldb/test/python_api/process/TestProcessAPI.py | 13 | ||||
| -rw-r--r-- | lldb/test/python_api/process/main.cpp | 1 |
2 files changed, 14 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) diff --git a/lldb/test/python_api/process/main.cpp b/lldb/test/python_api/process/main.cpp index 57da5748dda..9610936e053 100644 --- a/lldb/test/python_api/process/main.cpp +++ b/lldb/test/python_api/process/main.cpp @@ -13,6 +13,7 @@ char my_char = 'u'; char my_cstring[] = "lldb.SBProcess.ReadCStringFromMemory() works!"; +char *my_char_ptr = (char *)"Does it work?"; uint32_t my_uint32 = 12345; int my_int = 0; |

