1 import lldbsuite
.test
.lldbutil
as lldbutil
2 from lldbsuite
.test
.lldbtest
import *
3 from lldbsuite
.test
.decorators
import *
8 class TestCTF(TestBase
):
9 NO_DEBUG_INFO_TESTCASE
= True
11 def no_ctf_convert(self
):
12 if not shutil
.which("ctfconvert"):
13 return "ctfconvert not found in path"
17 if not "OBJCOPY" in os
.environ
:
18 return "llvm-objcopy not found in environment"
21 @skipTestIfFn(no_ctf_convert
)
22 @skipTestIfFn(no_objcopy
)
28 @skipTestIfFn(no_ctf_convert
)
29 @skipTestIfFn(no_objcopy
)
31 def test_compressed(self
):
32 self
.build(dictionary
={"COMPRESS_CTF": "YES"})
36 lldbutil
.run_to_name_breakpoint(self
, "printf")
38 symbol_file
= self
.getBuildArtifact("a.ctf")
41 self
.runCmd("log enable -v lldb symbol")
43 self
.runCmd("target symbols add {}".format(symbol_file
))
45 "target variable foo",
55 'u = (i = 1, s = "")',
56 "f = 0x0000000000000000",
59 self
.expect("target variable foo.n.i", substrs
=["(MyInt) foo.n.i = 1"])
61 "target variable foo.n.s", substrs
=["(const char *) foo.n.s", '"foo"']
64 "target variable foo.n.c", substrs
=["(volatile char) foo.n.c = 'c'"]
67 "target variable foo.n.a",
69 "(char[4]:8) foo.n.a",
77 "target variable foo.n.u", substrs
=['(MyUnionT) foo.n.u = (i = 1, s = "")']
80 "target variable foo.f",
81 substrs
=["(void (*)(int)) foo.f = 0x0000000000000000"],
95 self
.expect("type lookup RecursiveStruct", substrs
=["RecursiveStruct *n;"])