diff options
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
| -rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index f07bb9a7136a..a8390c5d79c6 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -8,15 +8,14 @@ #include "lldb/DataFormatters/FormatManager.h" -#include "llvm/ADT/STLExtras.h" - - #include "lldb/Core/Debugger.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/LanguageCategory.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" +#include "llvm/ADT/STLExtras.h" using namespace lldb; using namespace lldb_private; @@ -90,11 +89,11 @@ static bool GetFormatFromFormatChar(char format_char, Format &format) { return false; } -static bool GetFormatFromFormatName(const char *format_name, +static bool GetFormatFromFormatName(llvm::StringRef format_name, bool partial_match_ok, Format &format) { uint32_t i; for (i = 0; i < g_num_format_infos; ++i) { - if (strcasecmp(g_format_infos[i].format_name, format_name) == 0) { + if (format_name.equals_insensitive(g_format_infos[i].format_name)) { format = g_format_infos[i].format; return true; } @@ -102,8 +101,8 @@ static bool GetFormatFromFormatName(const char *format_name, if (partial_match_ok) { for (i = 0; i < g_num_format_infos; ++i) { - if (strcasestr(g_format_infos[i].format_name, format_name) == - g_format_infos[i].format_name) { + if (llvm::StringRef(g_format_infos[i].format_name) + .startswith_insensitive(format_name)) { format = g_format_infos[i].format; return true; } @@ -614,7 +613,7 @@ ImplSP FormatManager::Get(ValueObject &valobj, if (ImplSP retval_sp = GetCached<ImplSP>(match_data)) return retval_sp; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS)); + Log *log = GetLog(LLDBLog::DataFormatters); LLDB_LOGF(log, "[%s] Search failed. Giving language a chance.", __FUNCTION__); for (lldb::LanguageType lang_type : match_data.GetCandidateLanguages()) { @@ -637,7 +636,7 @@ ImplSP FormatManager::Get(ValueObject &valobj, template <typename ImplSP> ImplSP FormatManager::GetCached(FormattersMatchData &match_data) { ImplSP retval_sp; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS)); + Log *log = GetLog(LLDBLog::DataFormatters); if (match_data.GetTypeForCache()) { LLDB_LOGF(log, "\n\n[%s] Looking into cache for type %s", __FUNCTION__, match_data.GetTypeForCache().AsCString("<invalid>")); |
