[Lldb-commits] [lldb] r249433 - Create a logging category that is specific to data formatters activity
Enrico Granata via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 6 10:55:14 PDT 2015
Author: enrico
Date: Tue Oct 6 12:55:14 2015
New Revision: 249433
URL: http://llvm.org/viewvc/llvm-project?rev=249433&view=rev
Log:
Create a logging category that is specific to data formatters activity
Modified:
lldb/trunk/include/lldb/Core/Logging.h
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/Core/Logging.cpp
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
Modified: lldb/trunk/include/lldb/Core/Logging.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Logging.h?rev=249433&r1=249432&r2=249433&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Logging.h (original)
+++ lldb/trunk/include/lldb/Core/Logging.h Tue Oct 6 12:55:14 2015
@@ -48,6 +48,7 @@
#define LIBLLDB_LOG_SYSTEM_RUNTIME (1u << 26)
#define LIBLLDB_LOG_JIT_LOADER (1u << 27)
#define LIBLLDB_LOG_LANGUAGE (1u << 28)
+#define LIBLLDB_LOG_DATAFORMATTERS (1u << 29)
#define LIBLLDB_LOG_ALL (UINT32_MAX)
#define LIBLLDB_LOG_DEFAULT (LIBLLDB_LOG_PROCESS |\
LIBLLDB_LOG_THREAD |\
Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=249433&r1=249432&r2=249433&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Tue Oct 6 12:55:14 2015
@@ -533,7 +533,7 @@ ScanBracketedRange (llvm::StringRef subp
int64_t& index_lower,
int64_t& index_higher)
{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
close_bracket_index = llvm::StringRef::npos;
const size_t open_bracket_index = subpath.find('[');
if (open_bracket_index == llvm::StringRef::npos)
@@ -670,7 +670,7 @@ ExpandIndexedExpression (ValueObject* va
StackFrame* frame,
bool deref_pointer)
{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
const char* ptr_deref_format = "[%d]";
std::string ptr_deref_buffer(10,0);
::sprintf(&ptr_deref_buffer[0], ptr_deref_format, index);
@@ -731,7 +731,7 @@ DumpValue (Stream &s,
if (valobj == NULL)
return false;
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
Format custom_format = eFormatInvalid;
ValueObject::ValueObjectRepresentationStyle val_obj_display = entry.string.empty() ? ValueObject::eValueObjectRepresentationStyleValue : ValueObject::eValueObjectRepresentationStyleSummary;
Modified: lldb/trunk/source/Core/Logging.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Logging.cpp?rev=249433&r1=249432&r2=249433&view=diff
==============================================================================
--- lldb/trunk/source/Core/Logging.cpp (original)
+++ lldb/trunk/source/Core/Logging.cpp Tue Oct 6 12:55:14 2015
@@ -148,6 +148,7 @@ lldb_private::DisableLog (const char **c
else if (0 == ::strcasecmp(arg, "os")) flag_bits &= ~LIBLLDB_LOG_OS;
else if (0 == ::strcasecmp(arg, "jit")) flag_bits &= ~LIBLLDB_LOG_JIT_LOADER;
else if (0 == ::strcasecmp(arg, "language")) flag_bits &= ~LIBLLDB_LOG_LANGUAGE;
+ else if (0 == ::strncasecmp(arg, "formatters", 10)) flag_bits &= ~LIBLLDB_LOG_DATAFORMATTERS;
else
{
feedback_strm->Printf ("error: unrecognized log category '%s'\n", arg);
@@ -224,6 +225,7 @@ lldb_private::EnableLog (StreamSP &log_s
else if (0 == ::strncasecmp(arg, "watch", 5)) flag_bits |= LIBLLDB_LOG_WATCHPOINTS;
else if (0 == ::strcasecmp(arg, "jit")) flag_bits |= LIBLLDB_LOG_JIT_LOADER;
else if (0 == ::strcasecmp(arg, "language")) flag_bits |= LIBLLDB_LOG_LANGUAGE;
+ else if (0 == ::strncasecmp(arg, "formatters", 10)) flag_bits |= LIBLLDB_LOG_DATAFORMATTERS;
else
{
feedback_strm->Printf("error: unrecognized log category '%s'\n", arg);
@@ -254,6 +256,7 @@ lldb_private::ListLogCategories (Stream
" dyld - log shared library related activities\n"
" events - log broadcaster, listener and event queue activities\n"
" expr - log expressions\n"
+ " formatters - log data formatters related activities\n"
" host - log host activities\n"
" jit - log JIT events in the target\n"
" language - log language runtime events\n"
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=249433&r1=249432&r2=249433&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Oct 6 12:55:14 2015
@@ -275,7 +275,7 @@ ValueObject::UpdateValueIfNeeded (bool u
bool
ValueObject::UpdateFormatsIfNeeded()
{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (log)
log->Printf("[%s %p] checking for FormatManager revisions. ValueObject rev: %d - Global rev: %d",
GetName().GetCString(), static_cast<void*>(this),
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=249433&r1=249432&r2=249433&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Oct 6 12:55:14 2015
@@ -720,7 +720,7 @@ FormatManager::GetFormat (ValueObject& v
FormattersMatchData match_data(valobj, use_dynamic);
TypeFormatImplSP retval;
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (match_data.GetTypeForCache())
{
if (log)
@@ -803,7 +803,7 @@ FormatManager::GetSummaryFormat (ValueOb
FormattersMatchData match_data(valobj, use_dynamic);
TypeSummaryImplSP retval;
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (match_data.GetTypeForCache())
{
if (log)
@@ -887,7 +887,7 @@ FormatManager::GetSyntheticChildren (Val
FormattersMatchData match_data(valobj, use_dynamic);
SyntheticChildrenSP retval;
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (match_data.GetTypeForCache())
{
if (log)
@@ -954,7 +954,7 @@ FormatManager::GetValidator (ValueObject
FormattersMatchData match_data(valobj, use_dynamic);
TypeValidatorImplSP retval;
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (match_data.GetTypeForCache())
{
if (log)
Modified: lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp?rev=249433&r1=249432&r2=249433&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp Tue Oct 6 12:55:14 2015
@@ -225,7 +225,7 @@ TypeCategoryMap::GetFormat (FormattersMa
uint32_t reason_why;
ActiveCategoriesIterator begin, end = m_active_categories.end();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (log)
{
@@ -263,7 +263,7 @@ TypeCategoryMap::GetSummaryFormat (Forma
uint32_t reason_why;
ActiveCategoriesIterator begin, end = m_active_categories.end();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (log)
{
@@ -303,7 +303,7 @@ TypeCategoryMap::GetSyntheticChildren (F
ActiveCategoriesIterator begin, end = m_active_categories.end();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (log)
{
@@ -342,7 +342,7 @@ TypeCategoryMap::GetValidator (Formatter
uint32_t reason_why;
ActiveCategoriesIterator begin, end = m_active_categories.end();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS));
if (log)
{
More information about the lldb-commits
mailing list