From 1db0f0ca988f95916dc553afa48387b698811ec8 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 2 May 2019 23:07:23 +0000 Subject: Hide runtime support values such as clang's __vla_expr from frame variable by respecting the "artificial" attribute on variables. Function arguments that are artificial and useful to end-users are being whitelisted by the language runtime. Differential Revision: https://reviews.llvm.org/D61451 llvm-svn: 359841 --- lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/lang/c') diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py b/lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py index f6341ec24fa..30a190b27de 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py @@ -14,12 +14,23 @@ class TestVLA(TestBase): _, process, _, _ = lldbutil.run_to_source_breakpoint( self, "break here", lldb.SBFileSpec('main.c')) + # Make sure no helper expressions show up in frame variable. + var_opts = lldb.SBVariablesOptions() + var_opts.SetIncludeArguments(False) + var_opts.SetIncludeLocals(True) + var_opts.SetInScopeOnly(True) + var_opts.SetIncludeStatics(False) + var_opts.SetIncludeRuntimeSupportValues(False) + var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget) + all_locals = self.frame().GetVariables(var_opts) + self.assertEqual(len(all_locals), 1) + def test(a, array): for i in range(a): self.expect("fr v vla[%d]"%i, substrs=["int", "%d"%(a-i)]) self.expect("expr vla[%d]"%i, substrs=["int", "%d"%(a-i)]) - self.expect("frame var vla", substrs=array) - self.expect("expr vla", error=True, substrs=["incomplete"]) + self.expect("fr v vla", substrs=array) + self.expect("expr vla", error=True, substrs=["incomplete"]) test(2, ["int []", "[0] = 2, [1] = 1"]) process.Continue() -- cgit v1.2.3