Author: jmolenda
Date: Thu Nov  5 17:59:30 2015
New Revision: 252245

URL: http://llvm.org/viewvc/llvm-project?rev=252245&view=rev
Log:
Add a warning to TargetList::CreateTargetInternal
so when it is run on a kext (which won't activate
any platform plugins), you'll get a warning message
which may be helpful to the user.

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=252245&r1=252244&r2=252245&view=diff
==============================================================================
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Thu Nov  5 17:59:30 2015
@@ -250,12 +250,14 @@ TargetList::CreateTargetInternal (Debugg
                     }
                     
                     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 (Debugg
                         // 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


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to