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