aboutsummaryrefslogtreecommitdiff
path: root/source/Target/TargetList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Target/TargetList.cpp')
-rw-r--r--source/Target/TargetList.cpp43
1 files changed, 18 insertions, 25 deletions
diff --git a/source/Target/TargetList.cpp b/source/Target/TargetList.cpp
index bbed0fb0bc12..552e951496f2 100644
--- a/source/Target/TargetList.cpp
+++ b/source/Target/TargetList.cpp
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/lldb-python.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
@@ -293,32 +291,27 @@ TargetList::CreateTargetInternal (Debugger &debugger,
}
}
- if (!platform_sp)
+ // If we have a valid architecture, make sure the current platform is
+ // compatible with that architecture
+ if (!prefer_platform_arch && arch.IsValid())
{
- // Get the current platform and make sure it is compatible with the
- // current architecture if we have a valid architecture.
- platform_sp = debugger.GetPlatformList().GetSelectedPlatform ();
-
- if (!prefer_platform_arch && arch.IsValid())
+ if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch))
{
- if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch))
- {
- platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch);
- if (platform_sp)
- debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
- }
+ platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch);
+ if (!is_dummy_target && platform_sp)
+ debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
}
- else if (platform_arch.IsValid())
+ }
+ 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))
{
- // 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 (platform_sp)
- debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
- }
+ platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch);
+ if (!is_dummy_target && platform_sp)
+ debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
}
}
@@ -419,7 +412,7 @@ TargetList::CreateTargetInternal (Debugger &debugger,
if (file.GetFileType() == FileSpec::eFileTypeDirectory)
user_exe_path_is_bundle = true;
- if (file.IsRelativeToCurrentWorkingDirectory() && user_exe_path)
+ if (file.IsRelative() && user_exe_path)
{
// Ignore paths that start with "./" and "../"
if (!((user_exe_path[0] == '.' && user_exe_path[1] == '/') ||