diff options
-rw-r--r-- | lldb/source/Target/TargetList.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp index af596f79f4b..ee2e5799491 100644 --- a/lldb/source/Target/TargetList.cpp +++ b/lldb/source/Target/TargetList.cpp @@ -250,12 +250,14 @@ TargetList::CreateTargetInternal (Debugger &debugger, } Platform *platform_ptr = NULL; + bool more_than_one_platforms = false; for (const auto &the_platform_sp : platforms) { if (platform_ptr) { if (platform_ptr->GetName() != the_platform_sp->GetName()) { + more_than_one_platforms = true; platform_ptr = NULL; break; } @@ -271,6 +273,12 @@ TargetList::CreateTargetInternal (Debugger &debugger, // All platforms for all modules in the exectuable match, so we can select this platform platform_sp = platforms.front(); } + else if (more_than_one_platforms == false) + { + // No platforms claim to support this file + error.SetErrorString ("No matching platforms found for this file, specify one with the --platform option"); + return error; + } else { // More than one platform claims to support this file, so the --platform option must be specified |