[Lldb-commits] [lldb] r163248 - in /lldb/trunk/source/Plugins/Platform: FreeBSD/PlatformFreeBSD.cpp Linux/PlatformLinux.cpp MacOSX/PlatformMacOSX.cpp MacOSX/PlatformRemoteiOS.cpp MacOSX/PlatformiOSSimulator.cpp

Greg Clayton gclayton at apple.com
Wed Sep 5 14:19:23 PDT 2012


Author: gclayton
Date: Wed Sep  5 16:19:23 2012
New Revision: 163248

URL: http://llvm.org/viewvc/llvm-project?rev=163248&view=rev
Log:
<rdar://problem/12211320>

When the vendor and OS are not specified in a triple, only let unspecified vendor and OS fields matchs for the current host platform.


Modified:
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=163248&r1=163247&r2=163248&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed Sep  5 16:19:23 2012
@@ -43,10 +43,14 @@
                 create = true;
                 break;
                 
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
+            // Only accept "unknown" for the vendor if the host is BSD and
+            // it "unknown" wasn't specified (it was just returned becasue it
+            // was NOT specified)
             case llvm::Triple::UnknownArch:
                 create = !arch->TripleVendorWasSpecified();
                 break;
-                
+#endif
             default:
                 break;
         }
@@ -59,10 +63,14 @@
                 case llvm::Triple::KFreeBSD:
                     break;
                     
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
+                // Only accept "unknown" for the OS if the host is BSD and
+                // it "unknown" wasn't specified (it was just returned becasue it
+                // was NOT specified)
                 case llvm::Triple::UnknownOS:
                     create = arch->TripleOSWasSpecified();
                     break;
-                    
+#endif
                 default:
                     create = false;
                     break;

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=163248&r1=163247&r2=163248&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Wed Sep  5 16:19:23 2012
@@ -46,10 +46,14 @@
                 create = true;
                 break;
                 
+#if defined(__linux__)
+            // Only accept "unknown" for the vendor if the host is linux and
+            // it "unknown" wasn't specified (it was just returned becasue it
+            // was NOT specified_
             case llvm::Triple::UnknownArch:
                 create = !arch->TripleVendorWasSpecified();
                 break;
-                
+#endif
             default:
                 break;
         }
@@ -61,10 +65,14 @@
                 case llvm::Triple::Linux:
                     break;
                     
+#if defined(__linux__)
+                // Only accept "unknown" for the OS if the host is linux and
+                // it "unknown" wasn't specified (it was just returned becasue it
+                // was NOT specified)
                 case llvm::Triple::UnknownOS:
                     create = !arch->TripleOSWasSpecified();
                     break;
-                    
+#endif
                 default:
                     create = false;
                     break;

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=163248&r1=163247&r2=163248&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Wed Sep  5 16:19:23 2012
@@ -77,10 +77,14 @@
                 create = true;
                 break;
                 
+#if defined(__APPLE__)
+            // Only accept "unknown" for vendor if the host is Apple and
+            // it "unknown" wasn't specified (it was just returned becasue it
+            // was NOT specified)
             case llvm::Triple::UnknownArch:
                 create = !arch->TripleVendorWasSpecified();
                 break;
-                
+#endif
             default:
                 break;
         }
@@ -92,11 +96,14 @@
                 case llvm::Triple::Darwin:  // Deprecated, but still support Darwin for historical reasons
                 case llvm::Triple::MacOSX:
                     break;
-                    
+#if defined(__APPLE__)
+                // Only accept "vendor" for vendor if the host is Apple and
+                // it "unknown" wasn't specified (it was just returned becasue it
+                // was NOT specified)
                 case llvm::Triple::UnknownOS:
                     create = !arch->TripleOSWasSpecified();
                     break;
-                    
+#endif
                 default:
                     create = false;
                     break;

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=163248&r1=163247&r2=163248&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Wed Sep  5 16:19:23 2012
@@ -102,6 +102,10 @@
                         create = true;
                         break;
 
+#if defined(__APPLE__)
+                    // Only accept "unknown" for the vendor if the host is Apple and
+                    // it "unknown" wasn't specified (it was just returned becasue it
+                    // was NOT specified)
                     case llvm::Triple::UnknownArch:
                         create = !arch->TripleVendorWasSpecified();
                         break;
@@ -109,7 +113,7 @@
                     default:
                         break;
                 }
-                
+#endif
                 if (create)
                 {
                     switch (triple.getOS())
@@ -118,10 +122,14 @@
                         case llvm::Triple::IOS:     // This is the right triple value for iOS debugging
                             break;
 
+#if defined(__APPLE__)
+                        // Only accept "unknown" for the OS if the host is Apple and
+                        // it "unknown" wasn't specified (it was just returned becasue it
+                        // was NOT specified)
                         case llvm::Triple::UnknownOS:
                             create = !arch->TripleOSWasSpecified();
                             break;
-                            
+#endif
                         default:
                             create = false;
                             break;

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp?rev=163248&r1=163247&r2=163248&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp Wed Sep  5 16:19:23 2012
@@ -78,10 +78,14 @@
                         create = true;
                         break;
                         
+#if defined(__APPLE__)
+                    // Only accept "unknown" for the vendor if the host is Apple and
+                    // it "unknown" wasn't specified (it was just returned becasue it
+                    // was NOT specified)
                     case llvm::Triple::UnknownArch:
                         create = !arch->TripleVendorWasSpecified();
                         break;
-                        
+#endif
                     default:
                         break;
                 }
@@ -95,10 +99,14 @@
                         case llvm::Triple::IOS:     // IOS is not used for simulator triples, but accept it just in case
                             break;
                             
+#if defined(__APPLE__)
+                        // Only accept "unknown" for the OS if the host is Apple and
+                        // it "unknown" wasn't specified (it was just returned becasue it
+                        // was NOT specified)
                         case llvm::Triple::UnknownOS:
                             create = !arch->TripleOSWasSpecified();
                             break;
-                            
+#endif
                         default:
                             create = false;
                             break;





More information about the lldb-commits mailing list