dawn created this revision. dawn added reviewers: ted, clayborg. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM.
This fixes dotest.py on OSX after svn rev.237053. After that commit, running dotest.py on OSX would return nothing but ERRORs after running test test_disassemble_invalid_vst_1_64_raw_data (TestDisassemble_VST1_64.Disassemble_VST1_64), and the total tests dropped from 1324 to 850. See my comments in http://reviews.llvm.org/rL237053. Repository: rL LLVM http://reviews.llvm.org/D12303 Files: source/Target/TargetList.cpp Index: source/Target/TargetList.cpp =================================================================== --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -291,27 +291,34 @@ } } - // If we have a valid architecture, make sure the current platform is - // compatible with that architecture - if (!prefer_platform_arch && arch.IsValid()) + if (!platform_sp) { - if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) + // Get the current platform. + platform_sp = debugger.GetPlatformList().GetSelectedPlatform(); + assert(platform_sp); + + // If we have a valid architecture, make sure the current platform is + // compatible with that architecture + if (!prefer_platform_arch && arch.IsValid()) { - platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); - if (!is_dummy_target && platform_sp) - debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) + { + platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); + if (!is_dummy_target && platform_sp) + debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + } } - } - else if (platform_arch.IsValid()) - { - // if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with - // a single architecture which should be used - ArchSpec fixed_platform_arch; - if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) + else if (platform_arch.IsValid()) { - platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch); - if (!is_dummy_target && platform_sp) - debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + // if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with + // a single architecture which should be used + ArchSpec fixed_platform_arch; + if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) + { + platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch); + if (!is_dummy_target && platform_sp) + debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + } } }
Index: source/Target/TargetList.cpp =================================================================== --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -291,27 +291,34 @@ } } - // If we have a valid architecture, make sure the current platform is - // compatible with that architecture - if (!prefer_platform_arch && arch.IsValid()) + if (!platform_sp) { - if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) + // Get the current platform. + platform_sp = debugger.GetPlatformList().GetSelectedPlatform(); + assert(platform_sp); + + // If we have a valid architecture, make sure the current platform is + // compatible with that architecture + if (!prefer_platform_arch && arch.IsValid()) { - platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); - if (!is_dummy_target && platform_sp) - debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) + { + platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); + if (!is_dummy_target && platform_sp) + debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + } } - } - else if (platform_arch.IsValid()) - { - // if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with - // a single architecture which should be used - ArchSpec fixed_platform_arch; - if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) + else if (platform_arch.IsValid()) { - platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch); - if (!is_dummy_target && platform_sp) - debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + // if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with + // a single architecture which should be used + ArchSpec fixed_platform_arch; + if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) + { + platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch); + if (!is_dummy_target && platform_sp) + debugger.GetPlatformList().SetSelectedPlatform(platform_sp); + } } }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits