[Lldb-commits] [lldb] r237221 - Don't change the selected platform when creating the dummy target.
Robert Flack
flackr at gmail.com
Tue May 12 17:39:24 PDT 2015
Author: flackr
Date: Tue May 12 19:39:24 2015
New Revision: 237221
URL: http://llvm.org/viewvc/llvm-project?rev=237221&view=rev
Log:
Don't change the selected platform when creating the dummy target.
A dummy target is used by TargetList::CreateTargetInternal to prime newly
created targets. the first time this is done it creates the dummy target. The
dummy target is created with the host platform (See
TargetList::CreateDummyTarget) which results in switching the selected platform
back to the host platform even when creating a target for a different platform.
This change avoids changing the selected platform while creating the dummy
target to prevent this side effect.
Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCreateAfterAttach.py
Tests using process attach (e.g. TestCreateAfterAttach.py, TestHelloWorld.py)
now run successfully mac -> linux.
Differential Revision: http://reviews.llvm.org/D9712
Modified:
lldb/trunk/source/Target/TargetList.cpp
Modified: lldb/trunk/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/TargetList.cpp?rev=237221&r1=237220&r2=237221&view=diff
==============================================================================
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Tue May 12 19:39:24 2015
@@ -300,7 +300,7 @@ TargetList::CreateTargetInternal (Debugg
if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch))
{
platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch);
- if (platform_sp)
+ if (!is_dummy_target && platform_sp)
debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
}
}
@@ -312,7 +312,7 @@ TargetList::CreateTargetInternal (Debugg
if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch))
{
platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch);
- if (platform_sp)
+ if (!is_dummy_target && platform_sp)
debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
}
}
More information about the lldb-commits
mailing list