diff options
Diffstat (limited to 'lldb/test')
| -rw-r--r-- | lldb/test/class_static/TestStaticVariables.py | 19 | ||||
| -rw-r--r-- | lldb/test/class_static/main.cpp | 2 |
2 files changed, 19 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__': diff --git a/lldb/test/class_static/main.cpp b/lldb/test/class_static/main.cpp index dfce224e00e..2068eadcac5 100644 --- a/lldb/test/class_static/main.cpp +++ b/lldb/test/class_static/main.cpp @@ -45,7 +45,9 @@ static PointType g_points[] = int main (int argc, char const *argv[]) { + const char *hello_world = "Hello, world!"; printf ("A::g_points[1].x = %i\n", A::g_points[1].x); // Set break point at this line. printf ("::g_points[1].x = %i\n", g_points[1].x); + printf ("%s\n", hello_world); return 0; } |

