diff options
author | Jason Molenda <jmolenda@apple.com> | 2017-04-20 02:02:25 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2017-04-20 02:02:25 +0000 |
commit | 36162d0ffb683e809cdfd7c0dd9316dba806b2de (patch) | |
tree | 7828ebf54029b768c400c4db0da525da654e5106 /lldb | |
parent | 536339e18eacbf67ae02e86bc3c7a509081e0581 (diff) | |
download | bcm5719-llvm-36162d0ffb683e809cdfd7c0dd9316dba806b2de.tar.gz bcm5719-llvm-36162d0ffb683e809cdfd7c0dd9316dba806b2de.zip |
Add extra logging for when lldb is looking for kernels and kexts.
<rdar://problem/26863256>
llvm-svn: 300810
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 7116dca6591..08df0565acc 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -508,9 +508,10 @@ PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper( ConstString file_spec_extension = file_spec.GetFileNameExtension(); Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); - if (log) - log->Printf("PlatformDarwinKernel examining %s", - file_spec.GetPath().c_str()); + Log *log_verbose(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM | LLDB_LOG_OPTION_VERBOSE)); + + if (log_verbose) + log_verbose->Printf ("PlatformDarwinKernel examining '%s'", file_spec.GetPath().c_str()); PlatformDarwinKernel *thisp = (PlatformDarwinKernel *)baton; if (ft == llvm::sys::fs::file_type::regular_file || @@ -520,9 +521,21 @@ PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper( strncmp(filename.GetCString(), "mach", 4) == 0) && file_spec_extension != g_dsym_suffix) { if (KernelHasdSYMSibling(file_spec)) + { + if (log) + { + log->Printf ("PlatformDarwinKernel registering kernel binary '%s' with dSYM sibling", file_spec.GetPath().c_str()); + } thisp->m_kernel_binaries_with_dsyms.push_back(file_spec); + } else + { + if (log) + { + log->Printf ("PlatformDarwinKernel registering kernel binary '%s', no dSYM", file_spec.GetPath().c_str()); + } thisp->m_kernel_binaries_without_dsyms.push_back(file_spec); + } return FileSpec::eEnumerateDirectoryResultNext; } } else if (ft == llvm::sys::fs::file_type::directory_file && @@ -556,6 +569,8 @@ PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper( if (recurse && file_spec_extension != g_dsym_suffix && file_spec_extension != g_kext_suffix && file_spec_extension != g_bundle_suffix) { + if (log_verbose) + log_verbose->Printf ("PlatformDarwinKernel descending into directory '%s'", file_spec.GetPath().c_str()); return FileSpec::eEnumerateDirectoryResultEnter; } else { return FileSpec::eEnumerateDirectoryResultNext; @@ -564,6 +579,7 @@ PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper( void PlatformDarwinKernel::AddKextToMap(PlatformDarwinKernel *thisp, const FileSpec &file_spec) { + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); CFCBundle bundle(file_spec.GetPath().c_str()); CFStringRef bundle_id(bundle.GetIdentifier()); if (bundle_id && CFGetTypeID(bundle_id) == CFStringGetTypeID()) { @@ -572,11 +588,23 @@ void PlatformDarwinKernel::AddKextToMap(PlatformDarwinKernel *thisp, kCFStringEncodingUTF8)) { ConstString bundle_conststr(bundle_id_buf); if (KextHasdSYMSibling(file_spec)) + { + if (log) + { + log->Printf ("PlatformDarwinKernel registering kext binary '%s' with dSYM sibling", file_spec.GetPath().c_str()); + } thisp->m_name_to_kext_path_map_with_dsyms.insert( std::pair<ConstString, FileSpec>(bundle_conststr, file_spec)); + } else + { + if (log) + { + log->Printf ("PlatformDarwinKernel registering kext binary '%s', no dSYM", file_spec.GetPath().c_str()); + } thisp->m_name_to_kext_path_map_without_dsyms.insert( std::pair<ConstString, FileSpec>(bundle_conststr, file_spec)); + } } } } |