1"""Test that inline functions from modules are imported correctly""" 2 3 4 5 6import unittest2 7 8import lldb 9from lldbsuite.test.decorators import * 10from lldbsuite.test.lldbtest import * 11from lldbsuite.test import lldbutil 12 13 14class ModulesInlineFunctionsTestCase(TestBase): 15 16 mydir = TestBase.compute_mydir(__file__) 17 18 @skipIf(macos_version=["<", "10.12"], debug_info=no_match(["gmodules"])) 19 def test_expr(self): 20 self.build() 21 exe = self.getBuildArtifact("a.out") 22 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) 23 24 # Break inside the foo function which takes a bar_ptr argument. 25 lldbutil.run_to_source_breakpoint( 26 self, '// Set breakpoint here.', lldb.SBFileSpec('main.m')) 27 28 self.runCmd( 29 "settings set target.clang-module-search-paths \"" + 30 self.getSourceDir() + 31 "\"") 32 33 self.expect("expr @import myModule; 3", VARIABLES_DISPLAYED_CORRECTLY, 34 substrs=["int", "3"]) 35 36 self.expect("expr isInline(2)", VARIABLES_DISPLAYED_CORRECTLY, 37 substrs=["4"]) 38