cc6ac20b84bd6c2ca0a7430ef3504883fcdd8ec1
[openbsd] /
1 import lldb
2 from lldbsuite.test.lldbtest import *
3 from lldbsuite.test.decorators import *
4 import lldbsuite.test.lldbutil as lldbutil
5 import unittest2
6
7
8 class TestObjCXXHideRuntimeSupportValues(TestBase):
9
10     mydir = TestBase.compute_mydir(__file__)
11
12     @skipIfFreeBSD
13     @skipIfLinux
14     @skipIfWindows
15     @skipIfNetBSD
16     def test_hide_runtime_support_values(self):
17         self.build()
18         _, process, _, _ = lldbutil.run_to_source_breakpoint(
19             self, 'break here', lldb.SBFileSpec('main.mm'))
20
21         var_opts = lldb.SBVariablesOptions()
22         var_opts.SetIncludeArguments(True)
23         var_opts.SetIncludeLocals(True)
24         var_opts.SetInScopeOnly(True)
25         var_opts.SetIncludeStatics(False)
26         var_opts.SetIncludeRuntimeSupportValues(False)
27         var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
28         values = self.frame().GetVariables(var_opts)
29
30         def shows_var(name):
31             for value in values:
32                 if value.name == name:
33                     return True
34             return False
35         # ObjC method.
36         values = self.frame().GetVariables(var_opts)
37         self.assertFalse(shows_var("this"))
38         self.assertTrue(shows_var("self"))
39         self.assertTrue(shows_var("_cmd"))
40         self.assertTrue(shows_var("c"))
41
42         process.Continue()
43         # C++ method.
44         values = self.frame().GetVariables(var_opts)
45         self.assertTrue(shows_var("this"))
46         self.assertFalse(shows_var("self"))
47         self.assertFalse(shows_var("_cmd"))