summaryrefslogtreecommitdiffstats
path: root/lldb/test/class_static/TestStaticVariables.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-11-19 18:07:14 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-11-19 18:07:14 +0000
commitbeae523a204e69f658c6939ae0fc5d109e9f636e (patch)
tree61021f182bc930dcebf0ee0c02ef579d76d1cea1 /lldb/test/class_static/TestStaticVariables.py
parentd7a3550a5e72571d36a0661208d0e209471a127f (diff)
downloadbcm5719-llvm-beae523a204e69f658c6939ae0fc5d109e9f636e.tar.gz
bcm5719-llvm-beae523a204e69f658c6939ae0fc5d109e9f636e.zip
Fill in more test sequences for Python API SBFrame.LookupVarInScope(name, scope).
Change SBFrame::LookupVarInScope() to also work with "global" scope in addition to "local" and "parameter" scope. llvm-svn: 119811
Diffstat (limited to 'lldb/test/class_static/TestStaticVariables.py')
-rw-r--r--lldb/test/class_static/TestStaticVariables.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/lldb/test/class_static/TestStaticVariables.py b/lldb/test/class_static/TestStaticVariables.py
index cfcfaa96f7e..c9a5f6685d4 100644
--- a/lldb/test/class_static/TestStaticVariables.py
+++ b/lldb/test/class_static/TestStaticVariables.py
@@ -116,8 +116,23 @@ class StaticVariableTestCase(TestBase):
self.assertTrue(child1_x.GetTypeName() == 'int' and
child1_x.GetValue(frame) == '11')
- #variable = frame.LookupVarInScope("A::g_points", "global")
- #print "variable:", repr(variable)
+ # SBFrame.LookupVarInScope() should also work.
+ val = frame.LookupVarInScope("A::g_points", "global")
+ self.DebugSBValue(frame, val)
+ self.assertTrue(val.GetName() == 'A::g_points')
+
+ # Also exercise the "parameter" and "local" scopes while we are at it.
+ val = frame.LookupVarInScope("argc", "parameter")
+ self.DebugSBValue(frame, val)
+ self.assertTrue(val.GetName() == 'argc')
+
+ val = frame.LookupVarInScope("argv", "parameter")
+ self.DebugSBValue(frame, val)
+ self.assertTrue(val.GetName() == 'argv')
+
+ val = frame.LookupVarInScope("hello_world", "local")
+ self.DebugSBValue(frame, val)
+ self.assertTrue(val.GetName() == 'hello_world')
if __name__ == '__main__':
OpenPOWER on IntegriCloud