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.

llvm-svn: 151539
This commit is contained in:
Greg Clayton 2012-02-27 19:12:12 +00:00
parent 3c5cab4730
commit ea5e0cc320
5 changed files with 49 additions and 29 deletions

View File

@ -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;
};

View File

@ -155,7 +155,8 @@ PlatformFreeBSD::ResolveExecutable (const FileSpec &exe_file,
}
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);
}
}
}

View File

@ -93,7 +93,8 @@ PlatformLinux::Terminate ()
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 @@ PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
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 @@ PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
// 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 @@ PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
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)

View File

@ -72,7 +72,8 @@ namespace lldb_private {
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 ()

View File

@ -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 @@ lldb_private::Initialize ()
EmulateInstructionARM::Initialize ();
ObjectFilePECOFF::Initialize ();
DynamicLoaderPOSIXDYLD::Initialize ();
PlatformFreeBSD::Initialize();
PlatformLinux::Initialize();
#if defined (__APPLE__)
//----------------------------------------------------------------------
// Apple/Darwin hosted plugins
@ -134,14 +134,10 @@ lldb_private::Initialize ()
//----------------------------------------------------------------------
// 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 @@ lldb_private::Terminate ()
EmulateInstructionARM::Terminate ();
ObjectFilePECOFF::Terminate ();
DynamicLoaderPOSIXDYLD::Terminate ();
PlatformFreeBSD::Terminate();
PlatformLinux::Terminate();
#if defined (__APPLE__)
DynamicLoaderMacOSXDYLD::Terminate();
DynamicLoaderDarwinKernel::Terminate();
@ -213,15 +210,11 @@ lldb_private::Terminate ()
Debugger::SettingsTerminate ();
#if defined (__linux__)
PlatformLinux::Terminate();
ProcessLinux::Terminate();
DynamicLoaderPOSIXDYLD::Terminate();
#endif
#if defined (__FreeBSD__)
PlatformFreeBSD::Terminate();
ProcessFreeBSD::Terminate();
DynamicLoaderPOSIXDYLD::Terminate();
#endif
DynamicLoaderStatic::Terminate();