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