diff options
| author | Pavel Labath <labath@google.com> | 2017-02-05 00:44:54 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-02-05 00:44:54 +0000 |
| commit | 3b7e1981b2f66e0677f964a3e9cf30ce2d7d3f84 (patch) | |
| tree | 235951d23167dfb1ee2385c906175011780ba1e7 /lldb/source/Plugins/LanguageRuntime | |
| parent | 978fdb75a4a21d8209b51c08d4bcd16a43e0779d (diff) | |
| download | bcm5719-llvm-3b7e1981b2f66e0677f964a3e9cf30ce2d7d3f84.tar.gz bcm5719-llvm-3b7e1981b2f66e0677f964a3e9cf30ce2d7d3f84.zip | |
Remove LIBLLDB_LOG_VERBOSE category
Summary:
Per discussion in D28616, having two ways two request logging (log
enable lldb XXX verbose && log enable -v lldb XXX) is confusing. This
removes the first option and standardizes all code to use the second
one.
I've added a LLDB_LOGV macro as a shorthand for if(log &&
log->GetVerbose()) and switched most of the affected log statements to
use that (I've only left a couple of cases that were doing complex
computations in an if(log) block).
Reviewers: jingham, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D29510
llvm-svn: 294113
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime')
| -rw-r--r-- | lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp index 131f31f69a9..c9b7d60f6ca 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp @@ -501,10 +501,8 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime, if (m_filled) return; std::lock_guard<std::recursive_mutex> guard(m_mutex); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES | LIBLLDB_LOG_VERBOSE)); - if (log) - log->Printf("[ClassDescriptorV2::iVarsStorage::fill] class_name = %s", - descriptor.GetClassName().AsCString("<unknown")); + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES)); + LLDB_LOGV(log, "class_name = {0}", descriptor.GetClassName()); m_filled = true; ObjCLanguageRuntime::EncodingToTypeSP encoding_to_type_sp( runtime.GetEncodingToType()); @@ -519,19 +517,15 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime, uint64_t size) -> bool { const bool for_expression = false; const bool stop_loop = false; - if (log) - log->Printf("[ClassDescriptorV2::iVarsStorage::fill] name = %s, encoding " - "= %s, offset_ptr = %" PRIx64 ", size = %" PRIu64, - name, type, offset_ptr, size); + LLDB_LOGV(log, "name = {0}, encoding = {1}, offset_ptr = {2:x}, size = {3}", + name, type, offset_ptr, size); CompilerType ivar_type = encoding_to_type_sp->RealizeType(type, for_expression); if (ivar_type) { - if (log) - log->Printf("[ClassDescriptorV2::iVarsStorage::fill] name = %s, " - "encoding = %s, offset_ptr = %" PRIx64 ", size = %" PRIu64 - " , type_size = %" PRIu64, - name, type, offset_ptr, size, - ivar_type.GetByteSize(nullptr)); + LLDB_LOGV(log, + "name = {0}, encoding = {1}, offset_ptr = {2:x}, size = " + "{3}, type_size = {4}", + name, type, offset_ptr, size, ivar_type.GetByteSize(nullptr)); Scalar offset_scalar; Error error; const int offset_ptr_size = 4; @@ -539,18 +533,13 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime, size_t read = process->ReadScalarIntegerFromMemory( offset_ptr, offset_ptr_size, is_signed, offset_scalar, error); if (error.Success() && 4 == read) { - if (log) - log->Printf( - "[ClassDescriptorV2::iVarsStorage::fill] offset_ptr = %" PRIx64 - " --> %" PRIu32, - offset_ptr, offset_scalar.SInt()); + LLDB_LOGV(log, "offset_ptr = {0:x} --> {1}", offset_ptr, + offset_scalar.SInt()); m_ivars.push_back( {ConstString(name), ivar_type, size, offset_scalar.SInt()}); - } else if (log) - log->Printf( - "[ClassDescriptorV2::iVarsStorage::fill] offset_ptr = %" PRIx64 - " --> read fail, read = %zu", - offset_ptr, read); + } else + LLDB_LOGV(log, "offset_ptr = {0:x} --> read fail, read = %{1}", + offset_ptr, read); } return stop_loop; }); |

