brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · d3db99d Raw
39 lines · python
1import lldb2from lldbsuite.test.lldbtest import *3from lldbsuite.test.decorators import *4import lldbsuite.test.lldbutil as lldbutil5import os6 7 8class TestMacCatalyst(TestBase):9    @skipIf(macos_version=["<", "10.15"])10    @skipUnlessDarwin11    @skipIfDarwinEmbedded12    def test_macabi(self):13        """Test the x86_64-apple-ios-macabi target linked against a macos dylib"""14        self.build()15        log = self.getBuildArtifact("packets.log")16        self.expect("log enable gdb-remote packets -f " + log)17        lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.c"))18        self.expect(19            "image list -t -b",20            patterns=[self.getArchitecture() + r".*-apple-ios.*-macabi a\.out"],21        )22        self.expect("fr v s", substrs=["Hello macCatalyst"])23        self.expect("expression s", substrs=["Hello macCatalyst"])24        self.check_debugserver(log)25 26    def check_debugserver(self, log):27        """scan the debugserver packet log"""28        process_info = lldbutil.packetlog_get_process_info(log)29        self.assertIn("ostype", process_info)30        self.assertEqual(process_info["ostype"], "maccatalyst")31 32        aout_info = None33        dylib_info = lldbutil.packetlog_get_dylib_info(log)34        for image in dylib_info["images"]:35            if image["pathname"].endswith("a.out"):36                aout_info = image37        self.assertTrue(aout_info)38        self.assertEqual(aout_info["min_version_os_name"], "maccatalyst")39