Create a logging category that is specific to data formatters activity

llvm-svn: 249433
This commit is contained in:
Enrico Granata 2015-10-06 17:55:14 +00:00
parent cb14dd0265
commit 4edfef454d
6 changed files with 16 additions and 12 deletions

View File

@ -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 |\

View File

@ -533,7 +533,7 @@ ScanBracketedRange (llvm::StringRef subpath,
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* valobj,
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;

View File

@ -148,6 +148,7 @@ lldb_private::DisableLog (const char **categories, Stream *feedback_strm)
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_stream_sp, uint32_t log_options, const ch
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 *strm)
" 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"

View File

@ -275,7 +275,7 @@ ValueObject::UpdateValueIfNeeded (bool update_format)
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),

View File

@ -720,7 +720,7 @@ FormatManager::GetFormat (ValueObject& valobj,
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 (ValueObject& valobj,
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 (ValueObject& valobj,
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& valobj,
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)

View File

@ -225,7 +225,7 @@ TypeCategoryMap::GetFormat (FormattersMatchData& match_data)
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 (FormattersMatchData& match_data)
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 (FormattersMatchData& match_data)
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 (FormattersMatchData& match_data)
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)
{