summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-03-06 22:35:08 +0000
committerIlia K <ki.stfu@gmail.com>2015-03-06 22:35:08 +0000
commitd4ec5a70eadfb49f34530fe4de8737b4812f5edc (patch)
treea1b6364858a4504a665e6b2e821eb0530375156b /lldb/test/python_api
parent6ec9ba5a97b30c068dd27acb63a0ce53b8c3f225 (diff)
downloadbcm5719-llvm-d4ec5a70eadfb49f34530fe4de8737b4812f5edc.tar.gz
bcm5719-llvm-d4ec5a70eadfb49f34530fe4de8737b4812f5edc.zip
Improve ValueObject::GetValueDidChange test; Add a comment for it
Summary: This patch adds a few comments for GetValueDidChange and contains improvements for TestValueVarUpdate.py test which checks ValueObject::GetValueDidChange for complex types. Reviewers: zturner, granata.enrico, clayborg Reviewed By: clayborg Subscribers: jingham, lldb-commits, granata.enrico, zturner, clayborg Differential Revision: http://reviews.llvm.org/D8103 llvm-svn: 231526
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/value_var_update/TestValueVarUpdate.py9
-rw-r--r--lldb/test/python_api/value_var_update/main.c8
2 files changed, 16 insertions, 1 deletions
diff --git a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py
index 793ea4f13e0..395982374d2 100644
--- a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py
+++ b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py
@@ -52,6 +52,12 @@ class HelloWorldTestCase(TestBase):
i = self.frame().FindVariable("i")
i_val = i.GetValueAsUnsigned(0)
+ c = self.frame().FindVariable("c")
+
+ # Update any values from the SBValue objects so we can ask them if they changed after a continue
+ i.GetValueDidChange()
+ c.GetChildAtIndex(1).GetValueDidChange()
+ c.GetChildAtIndex(0).GetChildAtIndex(0).GetValueDidChange()
if self.TraceOn(): self.runCmd("frame variable")
@@ -62,6 +68,9 @@ class HelloWorldTestCase(TestBase):
self.assertTrue(i_val != i.GetValueAsUnsigned(0), "GetValue() is saying a lie")
self.assertTrue(i.GetValueDidChange(), "GetValueDidChange() is saying a lie")
+ # Check complex type
+ self.assertTrue(c.GetChildAtIndex(0).GetChildAtIndex(0).GetValueDidChange() and
+ not c.GetChildAtIndex(1).GetValueDidChange(), "GetValueDidChange() is saying a lie")
if __name__ == '__main__':
import atexit
diff --git a/lldb/test/python_api/value_var_update/main.c b/lldb/test/python_api/value_var_update/main.c
index 115bc10a372..9ffca5cbb9f 100644
--- a/lldb/test/python_api/value_var_update/main.c
+++ b/lldb/test/python_api/value_var_update/main.c
@@ -1,8 +1,14 @@
+struct complex_type {
+ struct { long l; } inner;
+ struct complex_type *complex_ptr;
+};
+
int main() {
int i = 0;
+ struct complex_type c = { { 1L }, &c };
for (int j = 3; j < 20; j++)
{
- i += j;
+ c.inner.l += (i += j);
i = i - 1; // break here
}
return i;
OpenPOWER on IntegriCloud