summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2015-11-05 23:03:44 +0000
committerJason Molenda <jmolenda@apple.com>2015-11-05 23:03:44 +0000
commita814f704d33a7137cff0345ed81aaa59408d2d19 (patch)
tree292c8e923050063bd001cceddcb4796a40db15f7 /lldb/source/Plugins
parent12ec50553f2444bc04ce9978cdb33eae9585a122 (diff)
downloadbcm5719-llvm-a814f704d33a7137cff0345ed81aaa59408d2d19.tar.gz
bcm5719-llvm-a814f704d33a7137cff0345ed81aaa59408d2d19.zip
Add support for the new (added last week) llvm::Triple::WatchOS and ::TvOS
in places where we check for Triple::IOS. They're mostly the same as far as lldb is conerned. . Also add a base cass implementation for Process::IsAlive - Greg added this last year but it didn't get upstreamed. llvm-svn: 252227
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp2
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp2
-rw-r--r--lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp3
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp53
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h8
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp4
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp2
7 files changed, 71 insertions, 3 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 086d641b8d2..dc7ec72dad2 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -162,6 +162,8 @@ DynamicLoaderDarwinKernel::CreateInstance (Process* process, bool force)
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
case llvm::Triple::IOS:
+ case llvm::Triple::TvOS:
+ case llvm::Triple::WatchOS:
if (triple_ref.getVendor() != llvm::Triple::Apple)
{
return NULL;
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index d5cc2a6fe8a..f1f0e1333c2 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -118,6 +118,8 @@ DynamicLoaderMacOSXDYLD::CreateInstance (Process* process, bool force)
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
case llvm::Triple::IOS:
+ case llvm::Triple::TvOS:
+ case llvm::Triple::WatchOS:
create = triple_ref.getVendor() == llvm::Triple::Apple;
break;
default:
diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
index ef9e197a170..7593b98e698 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -292,7 +292,6 @@ EmulateInstructionARM::GetFramePointerRegisterNumber () const
{
if (m_arch.GetTriple().isAndroid())
return LLDB_INVALID_REGNUM; // Don't use frame pointer on android
-
bool is_apple = false;
if (m_arch.GetTriple().getVendor() == llvm::Triple::Apple)
is_apple = true;
@@ -301,6 +300,8 @@ EmulateInstructionARM::GetFramePointerRegisterNumber () const
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
case llvm::Triple::IOS:
+ case llvm::Triple::TvOS:
+ case llvm::Triple::WatchOS:
is_apple = true;
break;
default:
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
index 1849d3b2a59..65bbda35872 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -111,8 +111,11 @@ PlatformDarwinKernel::CreateInstance (bool force, const ArchSpec *arch)
{
switch (triple.getOS())
{
- case llvm::Triple::Darwin: // Deprecated, but still support Darwin for historical reasons
+ case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
+ case llvm::Triple::IOS:
+ case llvm::Triple::WatchOS:
+ case llvm::Triple::TvOS:
break;
// Only accept "vendor" for vendor if the host is Apple and
// it "unknown" wasn't specified (it was just returned because it
@@ -312,7 +315,11 @@ PlatformDarwinKernel::CollectKextAndKernelDirectories ()
// e.g. /Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.Internal.sdk
std::vector<FileSpec> sdk_dirs;
if (m_ios_debug_session != eLazyBoolNo)
+ {
GetiOSSDKDirectoriesToSearch (sdk_dirs);
+ GetAppleTVOSSDKDirectoriesToSearch (sdk_dirs);
+ GetWatchOSSDKDirectoriesToSearch (sdk_dirs);
+ }
if (m_ios_debug_session != eLazyBoolYes)
GetMacSDKDirectoriesToSearch (sdk_dirs);
@@ -364,6 +371,50 @@ PlatformDarwinKernel::GetiOSSDKDirectoriesToSearch (std::vector<lldb_private::Fi
}
void
+PlatformDarwinKernel::GetAppleTVOSSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories)
+{
+ // DeveloperDirectory is something like "/Applications/Xcode.app/Contents/Developer"
+ const char *developer_dir = GetDeveloperDirectory();
+ if (developer_dir == NULL)
+ developer_dir = "/Applications/Xcode.app/Contents/Developer";
+
+ char pathbuf[PATH_MAX];
+ ::snprintf (pathbuf, sizeof (pathbuf), "%s/Platforms/AppleTVOS.platform/Developer/SDKs", developer_dir);
+ FileSpec ios_sdk(pathbuf, true);
+ if (ios_sdk.Exists() && ios_sdk.IsDirectory())
+ {
+ directories.push_back (ios_sdk);
+ }
+}
+
+void
+PlatformDarwinKernel::GetWatchOSSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories)
+{
+ // DeveloperDirectory is something like "/Applications/Xcode.app/Contents/Developer"
+ const char *developer_dir = GetDeveloperDirectory();
+ if (developer_dir == NULL)
+ developer_dir = "/Applications/Xcode.app/Contents/Developer";
+
+ char pathbuf[PATH_MAX];
+ ::snprintf (pathbuf, sizeof (pathbuf), "%s/Platforms/watchOS.platform/Developer/SDKs", developer_dir);
+ FileSpec ios_sdk(pathbuf, true);
+ if (ios_sdk.Exists() && ios_sdk.IsDirectory())
+ {
+ directories.push_back (ios_sdk);
+ }
+ else
+ {
+ ::snprintf (pathbuf, sizeof (pathbuf), "%s/Platforms/WatchOS.platform/Developer/SDKs", developer_dir);
+ FileSpec alt_watch_sdk(pathbuf, true);
+ if (ios_sdk.Exists() && ios_sdk.IsDirectory())
+ {
+ directories.push_back (ios_sdk);
+ }
+ }
+}
+
+
+void
PlatformDarwinKernel::GetMacSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories)
{
// DeveloperDirectory is something like "/Applications/Xcode.app/Contents/Developer"
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
index 25344e6918c..c1fe23178bf 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
@@ -133,6 +133,14 @@ protected:
void
GetiOSSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories);
+ // Directories where we may find AppleTVOS SDKs with kext bundles in them
+ void
+ GetAppleTVOSSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories);
+
+ // Directories where we may find WatchOS SDKs with kext bundles in them
+ void
+ GetWatchOSSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories);
+
// Directories where we may find Mac OS X SDKs with kext bundles in them
void
GetMacSDKDirectoriesToSearch (std::vector<lldb_private::FileSpec> &directories);
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index b6684370f85..69d8ec19a11 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -157,6 +157,8 @@ ProcessKDP::CanDebug(TargetSP target_sp, bool plugin_specified_by_name)
case llvm::Triple::Darwin: // Should use "macosx" for desktop and "ios" for iOS, but accept darwin just in case
case llvm::Triple::MacOSX: // For desktop targets
case llvm::Triple::IOS: // For arm targets
+ case llvm::Triple::TvOS:
+ case llvm::Triple::WatchOS:
if (triple_ref.getVendor() == llvm::Triple::Apple)
{
ObjectFile *exe_objfile = exe_module->GetObjectFile();
@@ -698,7 +700,7 @@ ProcessKDP::DoDestroy ()
bool
ProcessKDP::IsAlive ()
{
- return m_comm.IsConnected() && m_private_state.GetValue() != eStateExited;
+ return m_comm.IsConnected() && Process::IsAlive();
}
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 2e0466cc1bc..b11a0676032 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -64,6 +64,8 @@ SystemRuntimeMacOSX::CreateInstance (Process* process)
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
case llvm::Triple::IOS:
+ case llvm::Triple::TvOS:
+ case llvm::Triple::WatchOS:
create = triple_ref.getVendor() == llvm::Triple::Apple;
break;
default:
OpenPOWER on IntegriCloud