diff options
author | Jason Molenda <jmolenda@apple.com> | 2015-11-19 03:15:37 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2015-11-19 03:15:37 +0000 |
commit | f638ffddba818585f4e7e5bd10354d770af5d988 (patch) | |
tree | 01e7ab09c9e44227b45c160c4cf2b8806f490d62 /lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp | |
parent | 293207dd571c7668f3bdbd96e43384b1f13fe144 (diff) | |
download | bcm5719-llvm-f638ffddba818585f4e7e5bd10354d770af5d988.tar.gz bcm5719-llvm-f638ffddba818585f4e7e5bd10354d770af5d988.zip |
I like how PlatformAndroid/PlatformLinux log when their platforms
try to CreateInstance, and log the results. I copied that for the
Mac platforms.
llvm-svn: 253538
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp index 83645b9a212..808fd96a528 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -19,6 +19,7 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Error.h" +#include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" @@ -107,6 +108,20 @@ PlatformRemoteAppleWatch::Terminate () PlatformSP PlatformRemoteAppleWatch::CreateInstance (bool force, const ArchSpec *arch) { + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); + if (log) + { + const char *arch_name; + if (arch && arch->GetArchitectureName ()) + arch_name = arch->GetArchitectureName (); + else + arch_name = "<null>"; + + const char *triple_cstr = arch ? arch->GetTriple ().getTriple ().c_str() : "<null>"; + + log->Printf ("PlatformRemoteAppleWatch::%s(force=%s, arch={%s,%s})", __FUNCTION__, force ? "true" : "false", arch_name, triple_cstr); + } + bool create = force; if (!create && arch && arch->IsValid()) { @@ -172,7 +187,16 @@ PlatformRemoteAppleWatch::CreateInstance (bool force, const ArchSpec *arch) #endif if (create) + { + if (log) + log->Printf ("PlatformRemoteAppleWatch::%s() creating platform", __FUNCTION__); + return lldb::PlatformSP(new PlatformRemoteAppleWatch ()); + } + + if (log) + log->Printf ("PlatformRemoteAppleWatch::%s() aborting creation of platform", __FUNCTION__); + return lldb::PlatformSP(); } |