2 from lldbsuite
.test
.lldbtest
import *
3 from lldbsuite
.test
.decorators
import *
4 import lldbsuite
.test
.lldbutil
as lldbutil
7 class TestVLA(TestBase
):
8 @skipIf(compiler
="clang", compiler_version
=["<", "8.0"])
9 def test_variable_list(self
):
11 _
, process
, _
, _
= lldbutil
.run_to_source_breakpoint(
12 self
, "break here", lldb
.SBFileSpec("main.c")
15 # Make sure no helper expressions show up in frame variable.
16 var_opts
= lldb
.SBVariablesOptions()
17 var_opts
.SetIncludeArguments(False)
18 var_opts
.SetIncludeLocals(True)
19 var_opts
.SetInScopeOnly(True)
20 var_opts
.SetIncludeStatics(False)
21 var_opts
.SetIncludeRuntimeSupportValues(False)
22 var_opts
.SetUseDynamic(lldb
.eDynamicCanRunTarget
)
23 all_locals
= self
.frame().GetVariables(var_opts
)
24 for value
in all_locals
:
25 self
.assertNotIn("vla_expr", value
.name
)
27 @decorators.skipIf(compiler
="clang", compiler_version
=["<", "8.0"])
30 _
, process
, _
, _
= lldbutil
.run_to_source_breakpoint(
31 self
, "break here", lldb
.SBFileSpec("main.c")
39 self
.expect_var_path("vla" + name
, type="int", value
=value
)
40 self
.expect_expr("vla" + name
, result_type
="int", result_value
=value
)
41 children
.append(ValueCheck(name
=name
, value
=value
))
42 self
.expect_var_path("vla", type="int[]", children
=children
)
43 self
.expect("expr vla", error
=True, substrs
=["incomplete"])