summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-04-05 02:59:09 +0000
committerJason Molenda <jmolenda@apple.com>2013-04-05 02:59:09 +0000
commit8c1157ccc4ad740169f9092e187f88cdc76bd27f (patch)
treed3a10c543d0fb6e7d26dc07168178e5dbeb2fb1d
parent87a029094182ac303b8fedb9a839b10dff12249e (diff)
downloadbcm5719-llvm-8c1157ccc4ad740169f9092e187f88cdc76bd27f.tar.gz
bcm5719-llvm-8c1157ccc4ad740169f9092e187f88cdc76bd27f.zip
Change CommandObjectPlatform commands to get the current platform
from the current Target, if there is one, else back off to getting the currently selected platform from the Debugger (as it ws doing previously.) Remove code from DynamicLoaderDarwinKernel that was setting the platform in both the Target and in the Debugger. llvm-svn: 178836
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.cpp47
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp1
2 files changed, 42 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 6bf9c60d145..a762db4921b 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -207,7 +207,16 @@ protected:
{
Stream &ostrm = result.GetOutputStream();
- PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
+ Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ PlatformSP platform_sp;
+ if (target)
+ {
+ platform_sp = target->GetPlatform();
+ }
+ if (!platform_sp)
+ {
+ platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+ }
if (platform_sp)
{
platform_sp->GetStatus (ostrm);
@@ -381,8 +390,17 @@ protected:
virtual bool
DoExecute (Args& args, CommandReturnObject &result)
{
- PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
-
+ Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ PlatformSP platform_sp;
+ if (target)
+ {
+ platform_sp = target->GetPlatform();
+ }
+ if (!platform_sp)
+ {
+ platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+ }
+
if (platform_sp)
{
Error error;
@@ -490,7 +508,16 @@ protected:
virtual bool
DoExecute (Args& args, CommandReturnObject &result)
{
- PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
+ Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ PlatformSP platform_sp;
+ if (target)
+ {
+ platform_sp = target->GetPlatform();
+ }
+ if (!platform_sp)
+ {
+ platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+ }
if (platform_sp)
{
@@ -770,7 +797,17 @@ protected:
virtual bool
DoExecute (Args& args, CommandReturnObject &result)
{
- PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
+ Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ PlatformSP platform_sp;
+ if (target)
+ {
+ platform_sp = target->GetPlatform();
+ }
+ if (!platform_sp)
+ {
+ platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+ }
+
if (platform_sp)
{
const size_t argc = args.GetArgumentCount();
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index cef06b52694..1160686e8ee 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -464,7 +464,6 @@ DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel (Process* process, lldb::ad
if (platform_sp.get() && GetGlobalProperties()->GetLoadKexts())
{
process->GetTarget().SetPlatform (platform_sp);
- process->GetTarget().GetDebugger().GetPlatformList().SetSelectedPlatform (platform_sp);
}
}
OpenPOWER on IntegriCloud