[Lldb-commits] [lldb] r151539 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp source/Plugins/Platform/Linux/PlatformLinux.cpp source/Plugins/Platform/Linux/PlatformLinux.h source/lldb.cpp

Greg Clayton gclayton at apple.com
Mon Feb 27 11:12:12 PST 2012


Author: gclayton
Date: Mon Feb 27 13:12:12 2012
New Revision: 151539

URL: http://llvm.org/viewvc/llvm-project?rev=151539&view=rev
Log:
Enabled the PlatformLinux and PlatforFreeBSD on MacOSX so they can be used
and also so we don't break them with our code changes.

The _only_ plug-ins that should be #ifdef'ed out and not compiled in LLDB
are those that only work when running natively on the host system.

This fixed bot the PlatformLinux and PlatformFreeBSD build breakages that
were due to ModuleSpec changes.


Modified:
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
    lldb/trunk/source/lldb.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=151539&r1=151538&r2=151539&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Feb 27 13:12:12 2012
@@ -329,6 +329,10 @@
 		268F9D55123AA16600B91E9B /* SBSymbolContextList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268F9D54123AA16600B91E9B /* SBSymbolContextList.cpp */; };
 		2690B3711381D5C300ECFBAE /* Memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2690B3701381D5C300ECFBAE /* Memory.cpp */; };
 		2692BA15136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2692BA13136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp */; };
+		2694E99D14FC0BB30076DE67 /* PlatformFreeBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694E99A14FC0BB30076DE67 /* PlatformFreeBSD.cpp */; };
+		2694E99E14FC0BB30076DE67 /* PlatformFreeBSD.h in Headers */ = {isa = PBXBuildFile; fileRef = 2694E99B14FC0BB30076DE67 /* PlatformFreeBSD.h */; };
+		2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694E9A114FC0BBD0076DE67 /* PlatformLinux.cpp */; };
+		2694E9A514FC0BBD0076DE67 /* PlatformLinux.h in Headers */ = {isa = PBXBuildFile; fileRef = 2694E9A214FC0BBD0076DE67 /* PlatformLinux.h */; };
 		26954EBE1401EE8B00294D09 /* DynamicRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26954EBC1401EE8B00294D09 /* DynamicRegisterInfo.cpp */; };
 		26957D9813D381C900670048 /* RegisterContextDarwin_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */; };
 		26957D9A13D381C900670048 /* RegisterContextDarwin_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9413D381C900670048 /* RegisterContextDarwin_i386.cpp */; };
@@ -805,6 +809,10 @@
 		2692BA14136610C100F9E14D /* UnwindAssemblyInstEmulation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnwindAssemblyInstEmulation.h; sourceTree = "<group>"; };
 		269416AD119A024800FF2715 /* CommandObjectTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectTarget.cpp; path = source/Commands/CommandObjectTarget.cpp; sourceTree = "<group>"; };
 		269416AE119A024800FF2715 /* CommandObjectTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectTarget.h; path = source/Commands/CommandObjectTarget.h; sourceTree = "<group>"; };
+		2694E99A14FC0BB30076DE67 /* PlatformFreeBSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformFreeBSD.cpp; sourceTree = "<group>"; };
+		2694E99B14FC0BB30076DE67 /* PlatformFreeBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformFreeBSD.h; sourceTree = "<group>"; };
+		2694E9A114FC0BBD0076DE67 /* PlatformLinux.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformLinux.cpp; sourceTree = "<group>"; };
+		2694E9A214FC0BBD0076DE67 /* PlatformLinux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLinux.h; sourceTree = "<group>"; };
 		26954EBC1401EE8B00294D09 /* DynamicRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicRegisterInfo.cpp; path = Utility/DynamicRegisterInfo.cpp; sourceTree = "<group>"; };
 		26954EBD1401EE8B00294D09 /* DynamicRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicRegisterInfo.h; path = Utility/DynamicRegisterInfo.h; sourceTree = "<group>"; };
 		26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_arm.cpp; path = Utility/RegisterContextDarwin_arm.cpp; sourceTree = "<group>"; };
@@ -2096,6 +2104,24 @@
 			path = x86;
 			sourceTree = "<group>";
 		};
+		2694E99814FC0BB30076DE67 /* FreeBSD */ = {
+			isa = PBXGroup;
+			children = (
+				2694E99A14FC0BB30076DE67 /* PlatformFreeBSD.cpp */,
+				2694E99B14FC0BB30076DE67 /* PlatformFreeBSD.h */,
+			);
+			path = FreeBSD;
+			sourceTree = "<group>";
+		};
+		2694E99F14FC0BBD0076DE67 /* Linux */ = {
+			isa = PBXGroup;
+			children = (
+				2694E9A114FC0BBD0076DE67 /* PlatformLinux.cpp */,
+				2694E9A214FC0BBD0076DE67 /* PlatformLinux.h */,
+			);
+			path = Linux;
+			sourceTree = "<group>";
+		};
 		26A3B4AB1181454800381BC2 /* BSD-Archive */ = {
 			isa = PBXGroup;
 			children = (
@@ -2729,7 +2755,9 @@
 		26C5577E132575B6008FD8FE /* Platform */ = {
 			isa = PBXGroup;
 			children = (
+				2694E99814FC0BB30076DE67 /* FreeBSD */,
 				264A97BC133918A30017F0BE /* GDB Server */,
+				2694E99F14FC0BBD0076DE67 /* Linux */,
 				26C5577F132575C8008FD8FE /* MacOSX */,
 			);
 			path = Platform;
@@ -3056,6 +3084,8 @@
 				26FFC19A14FC072100087D58 /* AuxVector.h in Headers */,
 				26FFC19C14FC072100087D58 /* DYLDRendezvous.h in Headers */,
 				26FFC19E14FC072100087D58 /* DynamicLoaderPOSIXDYLD.h in Headers */,
+				2694E99E14FC0BB30076DE67 /* PlatformFreeBSD.h in Headers */,
+				2694E9A514FC0BBD0076DE67 /* PlatformLinux.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3781,6 +3811,8 @@
 				26FFC19914FC072100087D58 /* AuxVector.cpp in Sources */,
 				26FFC19B14FC072100087D58 /* DYLDRendezvous.cpp in Sources */,
 				26FFC19D14FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp in Sources */,
+				2694E99D14FC0BB30076DE67 /* PlatformFreeBSD.cpp in Sources */,
+				2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

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=151539&r1=151538&r2=151539&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Mon Feb 27 13:12:12 2012
@@ -155,7 +155,8 @@
             }
             else
             {
-                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.");
+                exe_file.GetPath(exe_path, sizeof(exe_path));
+                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", exe_path);
             }
         }
     }

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=151539&r1=151538&r2=151539&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Mon Feb 27 13:12:12 2012
@@ -93,7 +93,8 @@
 Error
 PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
                                   const ArchSpec &exe_arch,
-                                  lldb::ModuleSP &exe_module_sp)
+                                  lldb::ModuleSP &exe_module_sp,
+                                  const FileSpecList *module_search_paths_ptr)
 {
     Error error;
     // Nothing special to do here, just use the actual file and architecture
@@ -144,13 +145,10 @@
 
     if (error.Success())
     {
+        ModuleSpec module_spec (resolved_exe_file, exe_arch);
         if (exe_arch.IsValid())
         {
-            error = ModuleList::GetSharedModule (resolved_exe_file, 
-                                                 exe_arch, 
-                                                 NULL,
-                                                 NULL, 
-                                                 0, 
+            error = ModuleList::GetSharedModule (module_spec, 
                                                  exe_module_sp, 
                                                  NULL, 
                                                  NULL,
@@ -172,14 +170,9 @@
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
             StreamString arch_names;
-            ArchSpec platform_arch;
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, platform_arch); ++idx)
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
             {
-                error = ModuleList::GetSharedModule (resolved_exe_file, 
-                                                     platform_arch, 
-                                                     NULL,
-                                                     NULL, 
-                                                     0, 
+                error = ModuleList::GetSharedModule (module_spec, 
                                                      exe_module_sp, 
                                                      NULL, 
                                                      NULL,
@@ -195,7 +188,7 @@
                 
                 if (idx > 0)
                     arch_names.PutCString (", ");
-                arch_names.PutCString (platform_arch.GetArchitectureName());
+                arch_names.PutCString (module_spec.GetArchitecture().GetArchitectureName());
             }
             
             if (error.Fail() || !exe_module_sp)

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=151539&r1=151538&r2=151539&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Mon Feb 27 13:12:12 2012
@@ -72,7 +72,8 @@
         virtual Error
         ResolveExecutable (const FileSpec &exe_file,
                            const ArchSpec &arch,
-                           lldb::ModuleSP &module_sp);
+                           lldb::ModuleSP &module_sp,
+                           const FileSpecList *module_search_paths_ptr);
 
         virtual const char *
         GetDescription ()

Modified: lldb/trunk/source/lldb.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=151539&r1=151538&r2=151539&view=diff
==============================================================================
--- lldb/trunk/source/lldb.cpp (original)
+++ lldb/trunk/source/lldb.cpp Mon Feb 27 13:12:12 2012
@@ -38,6 +38,8 @@
 #include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
 #include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
 #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
+#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
+#include "Plugins/Platform/Linux/PlatformLinux.h"
 #if defined (__APPLE__)
 #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
 #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
@@ -57,14 +59,10 @@
 #include "Plugins/Process/mach-core/ProcessMachCore.h"
 
 #if defined (__linux__)
-#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
-#include "Plugins/Platform/Linux/PlatformLinux.h"
 #include "Plugins/Process/Linux/ProcessLinux.h"
 #endif
 
 #if defined (__FreeBSD__)
-#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
-#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
 #include "Plugins/Process/POSIX/ProcessPOSIX.h"
 #include "Plugins/Process/FreeBSD/ProcessFreeBSD.h"
 #endif
@@ -109,6 +107,8 @@
         EmulateInstructionARM::Initialize ();
         ObjectFilePECOFF::Initialize ();
         DynamicLoaderPOSIXDYLD::Initialize ();
+        PlatformFreeBSD::Initialize();
+        PlatformLinux::Initialize();
 #if defined (__APPLE__)
         //----------------------------------------------------------------------
         // Apple/Darwin hosted plugins
@@ -134,14 +134,10 @@
         //----------------------------------------------------------------------
         // Linux hosted plugins
         //----------------------------------------------------------------------
-        PlatformLinux::Initialize();
         ProcessLinux::Initialize();
-        DynamicLoaderPOSIXDYLD::Initialize();
 #endif
 #if defined (__FreeBSD__)
-        PlatformFreeBSD::Initialize();
         ProcessFreeBSD::Initialize();
-        DynamicLoaderPOSIXDYLD::Initialize();
 #endif
         //----------------------------------------------------------------------
         // Platform agnostic plugins
@@ -190,7 +186,8 @@
     EmulateInstructionARM::Terminate ();
     ObjectFilePECOFF::Terminate ();
     DynamicLoaderPOSIXDYLD::Terminate ();
-
+    PlatformFreeBSD::Terminate();
+    PlatformLinux::Terminate();
 #if defined (__APPLE__)
     DynamicLoaderMacOSXDYLD::Terminate();
     DynamicLoaderDarwinKernel::Terminate();
@@ -213,15 +210,11 @@
     Debugger::SettingsTerminate ();
 
 #if defined (__linux__)
-    PlatformLinux::Terminate();
     ProcessLinux::Terminate();
-    DynamicLoaderPOSIXDYLD::Terminate();
 #endif
 
 #if defined (__FreeBSD__)
-    PlatformFreeBSD::Terminate();
     ProcessFreeBSD::Terminate();
-    DynamicLoaderPOSIXDYLD::Terminate();
 #endif
     
     DynamicLoaderStatic::Terminate();





More information about the lldb-commits mailing list