def run_with(self, arch, os, vers, env, expected_load_command):
        env_list = [env] if env else []
        triple = '-'.join([arch, 'apple', os + vers] + env_list)
        sdk = lldbutil.get_xcode_sdk(os, env)

        version_min = ''
        if not vers:
            vers = lldbutil.get_xcode_sdk_version(sdk)
        if env == 'simulator':
            version_min = '-m{}-simulator-version-min={}'.format(os, vers)
        elif os == 'macosx':
            version_min = '-m{}-version-min={}'.format(os, vers)

        sdk_root = lldbutil.get_xcode_sdk_root(sdk)

        self.build(
            dictionary={
                'ARCH': arch,
                'ARCH_CFLAGS': '-target {} {}'.format(triple, version_min),
                'SDKROOT': sdk_root
            })

        self.check_load_commands(expected_load_command)
        log = self.getBuildArtifact('packets.log')
        self.expect("log enable gdb-remote packets -f " + log)
        lldbutil.run_to_source_breakpoint(self, "break here",
                                          lldb.SBFileSpec("hello.c"))
        triple_re = '-'.join([arch, 'apple', os + vers + '.*'] + env_list)
        self.expect('image list -b -t', patterns=['a\.out ' + triple_re])
        self.check_debugserver(log, os + env, vers)
Пример #2
0
def get_triple():
    # Construct the vendor component.
    vendor = "apple"

    # Construct the os component.
    os, env = get_os_and_env()
    if os is None or env is None:
        return None, None, None, None

    # Get the SDK from the os and env.
    sdk = lldbutil.get_xcode_sdk(os, env)
    if not sdk:
        return None, None, None, None

    # Get the version from the SDK.
    version = lldbutil.get_xcode_sdk_version(sdk)
    if not version:
        return None, None, None, None

    return vendor, os, version, env
Пример #3
0
    def getArchCFlags(self, architecture):
        """Returns the ARCH_CFLAGS for the make system."""

        # Construct the arch component.
        arch = architecture if architecture else configuration.arch
        if not arch:
            arch = subprocess.check_output(['machine'
                                            ]).rstrip().decode('utf-8')
        if not arch:
            return ""

        # Construct the vendor component.
        vendor = "apple"

        # Construct the os component.
        os, env = self.getOsAndEnv()
        if os is None or env is None:
            return ""

        # Get the SDK from the os and env.
        sdk = lldbutil.get_xcode_sdk(os, env)
        if not sdk:
            return ""

        version = lldbutil.get_xcode_sdk_version(sdk)
        if not version:
            return ""

        # Construct the triple from its components.
        triple = "{}-{}-{}-{}".format(vendor, os, version, env)

        # Construct min version argument
        version_min = ""
        if env == "simulator":
            version_min = "-m{}-simulator-version-min={}".format(os, version)
        elif os == "macosx":
            version_min = "-m{}-version-min={}".format(os, version)

        return "ARCH_CFLAGS=\"-target {} {}\"".format(triple, version_min)