HomePhabricator

Fix selecting the Platform in TargetList::CreateTargetInternal()
AuditedrL237053

Description

Fix selecting the Platform in TargetList::CreateTargetInternal()

Summary:
TargetList::CreateTargetInternal() will only select the current Platform. A previous patch always sets platform_sp to the current Platform, so a check later to see if platform_sp was not defined always failed, and the current Platform was used. This patch removes that check, so if the current Platform is not compatible with the target architecture, CreateTargetInternal() will call Platform::GetPlatformForArchitecture() to select a compatible Platform.

Vince, remote linux tests (Ubuntu -> remote Ubuntu) pass the same with and without this patch.

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: jingham, lldb-commits

Differential Revision: http://reviews.llvm.org/D8749

Details

Auditors
dawn
Committed
tedMay 11 2015, 2:23 PM
Reviewer
clayborg
Differential Revision
D8749: Fix selecting the Platform in TargetList::CreateTargetInternal()
Parents
rL237052: Remove Triple Vendor check when creating Linux Platform
Branches
Unknown
Tags
Unknown

Event Timeline

dawn raised a concern with this commit.Aug 24 2015, 11:03 AM
dawn added a subscriber: dawn.

This broke dotest.py on OSX. When running tests via:

./dotest.py -v --executable $INSTALLDIR/bin/lldb

Before this commit, all tests run:

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 1324 tests

   1: test_sb_api_directory (TestPublicAPIHeaders.SBDirCheckerCase)
[...]
850: test_disassemble_invalid_vst_1_64_raw_data (TestDisassemble_VST1_64.Disassemble_VST1_64)
      Test disassembling invalid vst1.64 raw bytes with the API. ... ok
 851: test_disassemble_raw_data (TestDisassembleRawData.DisassembleRawDataTestCase)
      Test disassembling raw bytes with the API. ... ok
[...]
----------------------------------------------------------------------
Ran 1324 tests in 4017.285s

FAILED (failures=2, errors=3, skipped=118, expected failures=61, unexpected successes=28)

After this commit, all tests folloing test_disassemble_invalid_vst_1_64_raw_data get ERRORs:

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 1324 tests

   1: test_sb_api_directory (TestPublicAPIHeaders.SBDirCheckerCase)
      Test the SB API directory and make sure there's no unwanted stuff. ... skipped 'skip because LLDB.h header not found'
[...]
850: test_disassemble_invalid_vst_1_64_raw_data (TestDisassemble_VST1_64.Disassemble_VST1_64)
      Test disassembling invalid vst1.64 raw bytes with the API. ... ok
ERROR
ERROR
ERROR
[...]
---------------------------------------------------------------------
Ran 850 tests in 3052.121s

FAILED (failures=2, errors=86, skipped=40, expected failures=57, unexpected successes=25)
dawn accepted this commit.Aug 26 2015, 11:23 AM

While it is still unknown why this change triggered the dotest ERRORs as reported in llvm.org/pr24575, we're assuming the problem lies in the python API and not this change. The offending test was skipped in r246043 as a workaround.